:root {
  --ink: #172f33;
  --ink-soft: #607477;
  --forest: #153b40;
  --forest-2: #20555a;
  --jade: #38a39a;
  --jade-soft: #dff3ef;
  --paper: #f6f7f2;
  --surface: #fff;
  --line: #e2e8e4;
  --warm: #f2a66f;
  --danger: #ba514c;
  --danger-soft: #fbe9e7;
  --shadow: 0 18px 60px rgba(27, 57, 58, .10);
  --small-shadow: 0 8px 24px rgba(27, 57, 58, .08);
  --radius: 20px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% 94%, rgba(244, 184, 136, .18), transparent 25rem),
    linear-gradient(145deg, #f8f8f3 0%, #eef4f0 100%);
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

svg {
  width: 1.2em;
  height: 1.2em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(4px);
  pointer-events: none;
}

.ambient-one {
  top: -12rem;
  right: -8rem;
  width: 34rem;
  height: 34rem;
  background: rgba(71, 161, 151, .10);
}

.ambient-two {
  bottom: -12rem;
  left: 14%;
  width: 28rem;
  height: 28rem;
  background: rgba(243, 173, 119, .12);
}

.brand {
  display: flex;
  align-items: center;
  gap: .8rem;
  color: var(--forest);
}

.brand-mark {
  display: grid;
  width: 2.7rem;
  height: 2.7rem;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: var(--forest);
  box-shadow: 0 8px 20px rgba(21, 59, 64, .18);
}

.brand-mark svg {
  width: 1.55rem;
  height: 1.55rem;
  stroke-width: 1.8;
}

.brand > span:last-child {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand strong {
  font-family: Georgia, "Songti SC", "SimSun", serif;
  font-size: 1.3rem;
  letter-spacing: .16em;
}

.brand small {
  margin-top: .38rem;
  color: var(--ink-soft);
  font-size: .57rem;
  font-weight: 700;
  letter-spacing: .18em;
}

.brand-light,
.brand-light small {
  color: #fff;
}

.eyebrow {
  margin: 0 0 .65rem;
  color: var(--jade);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .19em;
}

.primary-button,
.secondary-button,
.danger-button,
.text-button,
.icon-button,
.nav-item,
.file-main,
.file-action,
.reveal-button {
  border: 0;
  cursor: pointer;
}

.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  min-height: 2.85rem;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: .7rem 1.05rem;
  border-radius: 12px;
  font-weight: 750;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.primary-button {
  color: #fff;
  background: var(--forest);
  box-shadow: 0 8px 22px rgba(21, 59, 64, .18);
}

.primary-button:hover {
  transform: translateY(-1px);
  background: #0f3034;
  box-shadow: 0 10px 28px rgba(21, 59, 64, .24);
}

.secondary-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
}

.secondary-button:hover {
  transform: translateY(-1px);
  border-color: #c7d5d0;
  box-shadow: var(--small-shadow);
}

.danger-button {
  color: #fff;
  background: var(--danger);
}

.danger-button:hover {
  transform: translateY(-1px);
  background: #a74440;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(56, 163, 154, .25);
  outline-offset: 2px;
}

button:disabled {
  cursor: wait;
  opacity: .62;
}

.icon-button {
  display: inline-grid;
  width: 2.5rem;
  height: 2.5rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
  color: var(--ink-soft);
  background: transparent;
  transition: color .18s ease, background .18s ease;
}

.icon-button:hover {
  color: var(--forest);
  background: var(--jade-soft);
}

/* Login */
.login-shell {
  display: grid;
  width: min(1060px, calc(100% - 3rem));
  min-height: 650px;
  margin: max(2rem, 5vh) auto;
  grid-template-columns: 1.08fr .92fr;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 30px;
  background: #fff;
  box-shadow: 0 35px 100px rgba(26, 64, 64, .17);
}

.login-story {
  position: relative;
  display: flex;
  min-height: 650px;
  flex-direction: column;
  padding: 3.1rem 3.4rem;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 92% 9%, rgba(93, 191, 180, .32), transparent 16rem),
    radial-gradient(circle at 16% 96%, rgba(243, 173, 119, .22), transparent 18rem),
    var(--forest);
}

.login-story::before,
.login-story::after {
  position: absolute;
  content: "";
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 50%;
}

.login-story::before {
  top: 4rem;
  right: -10rem;
  width: 26rem;
  height: 26rem;
}

.login-story::after {
  top: 8rem;
  right: -6rem;
  width: 18rem;
  height: 18rem;
}

.brand-light .brand-mark {
  color: var(--forest);
  background: #fff;
}

.story-copy {
  position: relative;
  z-index: 1;
  margin: auto 0;
}

.story-copy .eyebrow {
  color: #85d9cf;
}

.story-copy h1 {
  margin: 0 0 1.5rem;
  font-family: Georgia, "Songti SC", "SimSun", serif;
  font-size: clamp(2.4rem, 4vw, 3.65rem);
  font-weight: 500;
  line-height: 1.27;
  letter-spacing: .02em;
}

.story-copy > p:last-child {
  max-width: 27rem;
  margin: 0;
  color: rgba(255, 255, 255, .68);
  font-size: .96rem;
  line-height: 1.9;
}

.trust-note {
  position: relative;
  z-index: 1;
  display: flex;
  width: fit-content;
  align-items: center;
  gap: .8rem;
  padding: .85rem 1rem;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 14px;
  background: rgba(255, 255, 255, .06);
  backdrop-filter: blur(8px);
}

.trust-note > svg {
  width: 1.45rem;
  height: 1.45rem;
  color: #85d9cf;
}

.trust-note span {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.trust-note strong {
  font-size: .82rem;
}

.trust-note small {
  color: rgba(255, 255, 255, .58);
  font-size: .68rem;
}

.login-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  background: #fff;
}

.mobile-brand {
  display: none;
}

.login-form {
  width: min(100%, 330px);
}

.login-form h2 {
  margin: 0;
  font-family: Georgia, "Songti SC", "SimSun", serif;
  font-size: 2rem;
  font-weight: 600;
}

.form-intro {
  margin: .75rem 0 2.2rem;
  color: var(--ink-soft);
  font-size: .88rem;
}

.field-label {
  display: block;
  margin: 0 0 .52rem;
  color: #41585b;
  font-size: .78rem;
  font-weight: 750;
}

.input-wrap {
  position: relative;
  margin-bottom: 1.2rem;
}

.input-wrap input,
.dialog-input {
  width: 100%;
  height: 3.15rem;
  padding: 0 .95rem;
  border: 1px solid #dce5e1;
  border-radius: 12px;
  color: var(--ink);
  background: #fbfcfa;
  transition: border .18s ease, box-shadow .18s ease, background .18s ease;
}

.input-wrap input:focus,
.dialog-input:focus {
  border-color: var(--jade);
  outline: 0;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(56, 163, 154, .11);
}

.password-wrap input {
  padding-right: 4rem;
}

.reveal-button {
  position: absolute;
  top: 50%;
  right: .7rem;
  padding: .35rem;
  transform: translateY(-50%);
  color: var(--jade);
  background: transparent;
  font-size: .72rem;
  font-weight: 750;
}

.form-error {
  margin: -.25rem 0 1rem;
  padding: .7rem .85rem;
  border-radius: 10px;
  color: #9c3f3b;
  background: var(--danger-soft);
  font-size: .78rem;
  line-height: 1.5;
}

.login-button {
  width: 100%;
  margin-top: .45rem;
}

.login-button svg {
  margin-left: auto;
}

.login-footnote {
  position: absolute;
  bottom: 1.65rem;
  margin: 0;
  color: #a3afac;
  font-size: .54rem;
  font-weight: 700;
  letter-spacing: .17em;
}

/* Main application */
.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  position: fixed;
  z-index: 10;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  width: 260px;
  flex-direction: column;
  padding: 1.9rem 1.35rem 1.35rem;
  border-right: 1px solid rgba(222, 231, 226, .75);
  background: rgba(251, 252, 249, .86);
  backdrop-filter: blur(18px);
}

.sidebar > .brand {
  padding: 0 .55rem;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  margin-top: 2.5rem;
}

.nav-item {
  display: flex;
  width: 100%;
  min-height: 3rem;
  align-items: center;
  gap: .75rem;
  padding: .7rem .9rem;
  border-radius: 12px;
  color: var(--ink-soft);
  background: transparent;
  font-size: .86rem;
  font-weight: 700;
  text-align: left;
}

.nav-item svg {
  width: 1.25rem;
  height: 1.25rem;
}

.nav-item.active,
.nav-item:hover {
  color: var(--forest);
  background: var(--jade-soft);
}

.mobile-nav-actions {
  display: flex;
  align-items: center;
  gap: .15rem;
}

.mobile-nav-actions .icon-button.active {
  color: var(--forest);
  background: var(--jade-soft);
}

.capacity-card {
  margin-top: 1.7rem;
  padding: 1.05rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .72);
}

.capacity-heading,
.capacity-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.capacity-heading {
  font-size: .75rem;
  font-weight: 700;
}

.capacity-heading strong {
  color: var(--jade);
}

.capacity-card progress {
  width: 100%;
  height: .45rem;
  margin: .8rem 0 .5rem;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  color: var(--jade);
  background: #e9efec;
  appearance: none;
}

.capacity-card progress::-webkit-progress-bar {
  border-radius: 999px;
  background: #e9efec;
}

.capacity-card progress::-webkit-progress-value {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--jade), #72c5bb);
}

.capacity-card progress::-moz-progress-bar {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--jade), #72c5bb);
}

.capacity-meta {
  color: var(--ink-soft);
  font-size: .65rem;
}

.side-tip {
  display: flex;
  gap: .8rem;
  margin-top: auto;
  padding: 1rem;
  border-radius: 16px;
  color: #dcebe8;
  background: var(--forest);
}

.tip-icon {
  display: grid;
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  color: #9ce0d8;
  background: rgba(255, 255, 255, .08);
}

.side-tip strong {
  color: #fff;
  font-size: .75rem;
}

.side-tip p {
  margin: .28rem 0 0;
  font-size: .64rem;
  line-height: 1.55;
}

.side-account {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-top: 1rem;
  padding: .75rem .25rem 0;
  border-top: 1px solid var(--line);
}

.avatar {
  display: grid;
  width: 2.2rem;
  height: 2.2rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: var(--forest);
  background: #f2d4bd;
  font-family: Georgia, serif;
  font-size: .85rem;
  font-weight: 700;
}

.account-name {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.account-name strong {
  overflow: hidden;
  font-size: .75rem;
  text-overflow: ellipsis;
}

.account-name small {
  margin-top: .16rem;
  color: var(--ink-soft);
  font-size: .62rem;
}

.workspace {
  min-width: 0;
  grid-column: 2;
  padding: 2.15rem clamp(1.5rem, 4vw, 4rem) 3rem;
}

.mobile-header {
  display: none;
}

.workspace-head {
  max-width: 1380px;
  margin: 0 auto 1.35rem;
}

.breadcrumbs {
  display: flex;
  min-height: 2rem;
  align-items: center;
  gap: .25rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  color: var(--ink-soft);
  scrollbar-width: none;
}

.breadcrumbs::-webkit-scrollbar {
  display: none;
}

.crumb-button {
  flex: 0 0 auto;
  padding: .3rem .45rem;
  border: 0;
  border-radius: 7px;
  color: inherit;
  background: transparent;
  cursor: pointer;
  font-size: .72rem;
}

.crumb-button:hover {
  color: var(--forest);
  background: rgba(56, 163, 154, .09);
}

.crumb-separator {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
}

.crumb-separator svg {
  width: .75rem;
  height: .75rem;
}

.headline-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
}

.headline-row h1 {
  margin: 0;
  font-family: Georgia, "Songti SC", "SimSun", serif;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 600;
  letter-spacing: .02em;
}

.folder-summary {
  margin: .48rem 0 0;
  color: var(--ink-soft);
  font-size: .76rem;
}

.head-actions {
  display: flex;
  flex: 0 0 auto;
  gap: .65rem;
}

.content-card {
  max-width: 1380px;
  min-height: 470px;
  margin: 0 auto;
  padding: 1rem 1.15rem 1.4rem;
  border: 1px solid rgba(222, 231, 226, .9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.content-toolbar {
  display: flex;
  min-height: 3.8rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .35rem .3rem .8rem;
  border-bottom: 1px solid var(--line);
}

.search-box {
  display: flex;
  width: min(390px, 70%);
  height: 2.65rem;
  align-items: center;
  gap: .6rem;
  padding: 0 .8rem;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #899997;
  background: #f3f6f3;
  transition: border .18s ease, background .18s ease;
}

.search-box:focus-within {
  border-color: #bedbd5;
  background: #fff;
}

.search-box svg {
  flex: 0 0 auto;
}

.search-box input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: .78rem;
}

.search-box input::placeholder {
  color: #93a19f;
}

.search-box kbd {
  display: grid;
  width: 1.35rem;
  height: 1.35rem;
  place-items: center;
  border: 1px solid #d7dfdc;
  border-radius: 5px;
  color: #879694;
  background: #fff;
  font: 600 .65rem/1 ui-monospace, monospace;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
}

.result-count {
  color: var(--ink-soft);
  font-size: .72rem;
}

.file-list-head,
.file-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 110px 170px 150px;
  align-items: center;
  gap: .8rem;
}

.file-list-head {
  min-height: 2.65rem;
  padding: 0 .8rem;
  color: #899795;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .04em;
}

.file-list-head span:last-child {
  text-align: center;
}

.file-row {
  position: relative;
  min-height: 4.35rem;
  padding: .55rem .8rem;
  border-top: 1px solid #edf1ef;
  border-radius: 12px;
  transition: background .16s ease, transform .16s ease;
}

.file-row:hover {
  z-index: 1;
  background: #f5f9f6;
}

.file-main {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: .8rem;
  padding: 0;
  overflow: hidden;
  background: transparent;
  text-align: left;
}

.file-icon {
  display: grid;
  width: 2.55rem;
  height: 2.55rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  color: #687a7b;
  background: #eef2ef;
}

.file-icon svg {
  width: 1.35rem;
  height: 1.35rem;
}

.file-icon.folder {
  color: #2f887f;
  background: #dff3ef;
}

.file-icon.image {
  color: #b46e42;
  background: #f9e9db;
}

.file-icon.video {
  color: #6a6cae;
  background: #e9e9f8;
}

.file-icon.pdf {
  color: #b74d49;
  background: #f9e6e4;
}

.file-name-block {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: .22rem;
}

.file-name {
  overflow: hidden;
  color: var(--ink);
  font-size: .79rem;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-kind {
  color: #91a09e;
  font-size: .61rem;
  text-transform: uppercase;
}

.file-kind.location {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.trash-row .file-main {
  cursor: default;
}

.content-card.trash-mode .empty-illustration {
  color: var(--danger);
  background: var(--danger-soft);
}

.file-size,
.file-date {
  color: var(--ink-soft);
  font-size: .7rem;
}

.file-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .15rem;
  opacity: .35;
  transition: opacity .16s ease;
}

.file-row:hover .file-actions,
.file-row:focus-within .file-actions {
  opacity: 1;
}

.file-action {
  display: grid;
  width: 2.1rem;
  height: 2.1rem;
  place-items: center;
  border-radius: 9px;
  color: #718281;
  background: transparent;
  text-decoration: none;
  transition: color .16s ease, background .16s ease;
}

.file-action:hover {
  color: var(--forest);
  background: #e2f0ec;
}

.file-action.danger:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.file-action svg {
  width: 1.05rem;
  height: 1.05rem;
}

.loading-state,
.empty-state {
  min-height: 320px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}

.loading-state:not([hidden]),
.empty-state:not([hidden]) {
  display: flex;
}

.spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid #dce8e4;
  border-top-color: var(--jade);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-state p {
  color: var(--ink-soft);
  font-size: .75rem;
}

.empty-illustration {
  display: grid;
  width: 4.8rem;
  height: 4.8rem;
  place-items: center;
  border-radius: 22px;
  color: var(--jade);
  background: var(--jade-soft);
  transform: rotate(-3deg);
}

.empty-illustration svg {
  width: 2.3rem;
  height: 2.3rem;
}

.empty-state h2 {
  margin: 1.2rem 0 .45rem;
  font-family: Georgia, "Songti SC", serif;
  font-size: 1.25rem;
}

.empty-state p {
  max-width: 26rem;
  margin: 0;
  color: var(--ink-soft);
  font-size: .75rem;
  line-height: 1.6;
}

.text-button {
  margin-top: .8rem;
  padding: .4rem;
  color: var(--jade);
  background: transparent;
  font-size: .75rem;
  font-weight: 750;
}

/* Dialogs */
dialog {
  border: 0;
  color: var(--ink);
}

dialog::backdrop {
  background: rgba(14, 38, 41, .52);
  backdrop-filter: blur(6px);
}

.form-dialog {
  width: min(440px, calc(100% - 2rem));
  padding: 0;
  overflow: hidden;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 90px rgba(11, 34, 37, .28);
}

.form-dialog[open] {
  animation: dialog-in .2s ease-out;
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.form-dialog form {
  padding: 1.55rem;
}

.dialog-head,
.preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.dialog-head {
  margin-bottom: 1.4rem;
}

.dialog-head h2,
.preview-head h2 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: 1.4rem;
}

.dialog-hint {
  margin: .55rem 0 0;
  color: var(--ink-soft);
  font-size: .68rem;
}

.dialog-error {
  margin: .8rem 0 0;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: .55rem;
  margin-top: 1.5rem;
}

.confirm-copy {
  margin: 0;
  color: var(--ink-soft);
  font-size: .82rem;
  line-height: 1.75;
}

.confirm-copy strong {
  color: var(--ink);
  word-break: break-all;
}

.preview-dialog {
  width: min(1100px, calc(100% - 2.5rem));
  height: min(780px, calc(100vh - 3rem));
  padding: 0;
  overflow: hidden;
  border-radius: 22px;
  background: #f5f7f4;
  box-shadow: 0 30px 100px rgba(9, 31, 33, .35);
}

.preview-dialog[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  animation: dialog-in .2s ease-out;
}

.preview-head {
  align-items: center;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.preview-head .eyebrow {
  margin-bottom: .25rem;
}

.preview-head h2 {
  max-width: min(60vw, 700px);
  overflow: hidden;
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.preview-host {
  display: grid;
  min-height: 0;
  place-items: center;
  overflow: auto;
  background:
    linear-gradient(45deg, #eef1ef 25%, transparent 25%),
    linear-gradient(-45deg, #eef1ef 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eef1ef 75%),
    linear-gradient(-45deg, transparent 75%, #eef1ef 75%), #f7f8f6;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}

.preview-host img,
.preview-host video {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.preview-host video {
  width: min(100%, 1000px);
  background: #081315;
}

.preview-host iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

/* Upload and feedback */
.drop-overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  padding: 1.2rem;
  pointer-events: none;
  background: rgba(20, 58, 62, .72);
  backdrop-filter: blur(7px);
}

.drop-overlay:not([hidden]) {
  display: grid;
  place-items: center;
}

.drop-overlay > div {
  display: flex;
  width: min(520px, 100%);
  min-height: 280px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border: 2px dashed rgba(255, 255, 255, .62);
  border-radius: 28px;
  color: #fff;
  background: rgba(255, 255, 255, .08);
}

.drop-overlay svg {
  width: 3rem;
  height: 3rem;
  margin-bottom: 1rem;
  color: #9be1d8;
}

.drop-overlay strong {
  font-family: Georgia, "Songti SC", serif;
  font-size: 1.7rem;
}

.drop-overlay span {
  margin-top: .55rem;
  color: rgba(255, 255, 255, .68);
  font-size: .78rem;
}

.upload-panel {
  position: fixed;
  z-index: 80;
  right: 1.4rem;
  bottom: 1.4rem;
  width: min(390px, calc(100% - 2rem));
  max-height: min(500px, calc(100vh - 3rem));
  overflow: hidden;
  border: 1px solid rgba(218, 228, 223, .9);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(13, 44, 46, .24);
}

.upload-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 1rem;
  color: #fff;
  background: var(--forest);
}

.upload-panel-head > div {
  display: flex;
  flex-direction: column;
  gap: .2rem;
}

.upload-panel-head strong {
  font-size: .82rem;
}

.upload-panel-head span {
  color: rgba(255, 255, 255, .62);
  font-size: .64rem;
}

.upload-panel-head .icon-button {
  color: rgba(255, 255, 255, .72);
}

.upload-panel-head .icon-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, .1);
}

.upload-queue {
  max-height: 380px;
  padding: .35rem .8rem;
  overflow-y: auto;
}

.upload-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .35rem .8rem;
  padding: .75rem .25rem;
  border-bottom: 1px solid var(--line);
}

.upload-item:last-child {
  border-bottom: 0;
}

.upload-item-name {
  overflow: hidden;
  font-size: .72rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-item-status {
  color: var(--ink-soft);
  font-size: .62rem;
}

.upload-item.error .upload-item-status {
  color: var(--danger);
}

.upload-item.done .upload-item-status {
  color: var(--jade);
}

.upload-item progress {
  width: 100%;
  height: .28rem;
  grid-column: 1 / -1;
  border: 0;
  border-radius: 99px;
  appearance: none;
}

.upload-item progress::-webkit-progress-bar {
  border-radius: 99px;
  background: #e8efec;
}

.upload-item progress::-webkit-progress-value {
  border-radius: 99px;
  background: var(--jade);
}

.upload-item progress::-moz-progress-bar {
  border-radius: 99px;
  background: var(--jade);
}

.toast-region {
  position: fixed;
  z-index: 120;
  top: 1rem;
  right: 1rem;
  display: flex;
  width: min(350px, calc(100% - 2rem));
  flex-direction: column;
  gap: .55rem;
  pointer-events: none;
}

.toast {
  padding: .85rem 1rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--jade);
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
  box-shadow: var(--small-shadow);
  font-size: .75rem;
  line-height: 1.5;
  animation: toast-in .22s ease-out;
}

.toast.error {
  border-left-color: var(--danger);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 980px) {
  .login-shell {
    grid-template-columns: .9fr 1.1fr;
  }

  .login-story {
    padding: 2.5rem;
  }

  .story-copy h1 {
    font-size: 2.4rem;
  }

  .app-shell {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .sidebar {
    width: 88px;
    align-items: center;
    padding-inline: .7rem;
  }

  .sidebar > .brand > span:last-child,
  .nav-item span,
  .capacity-card,
  .side-tip,
  .account-name {
    display: none;
  }

  .sidebar > .brand {
    padding: 0;
  }

  .side-nav {
    width: 100%;
  }

  .nav-item {
    justify-content: center;
  }

  .side-account {
    width: 100%;
    flex-direction: column;
    margin-top: auto;
  }

  .workspace {
    grid-column: 2;
  }

  .file-list-head,
  .file-row {
    grid-template-columns: minmax(220px, 1fr) 90px 140px 125px;
  }
}

@media (max-width: 760px) {
  .login-shell {
    display: block;
    width: min(520px, calc(100% - 1.5rem));
    min-height: 0;
    margin: 1rem auto;
  }

  .login-story {
    display: none;
  }

  .login-panel {
    min-height: calc(100vh - 2rem);
    align-items: stretch;
    flex-direction: column;
    padding: 1.6rem clamp(1.35rem, 8vw, 3rem);
  }

  .mobile-brand {
    display: flex;
  }

  .login-form {
    margin: auto;
  }

  .login-footnote {
    position: static;
    margin-top: auto;
    padding-top: 2rem;
    text-align: center;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .workspace {
    padding: 0 1rem 2rem;
  }

  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .9rem 0 1.25rem;
  }

  .mobile-header .brand-mark {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 11px;
  }

  .breadcrumbs {
    margin-bottom: .6rem;
  }

  .headline-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
  }

  .head-actions {
    width: 100%;
  }

  .head-actions > button {
    flex: 1;
  }

  .content-card {
    min-height: 430px;
    margin-top: 1.1rem;
    padding: .75rem;
    border-radius: 16px;
  }

  .search-box {
    width: 100%;
  }

  .search-box kbd,
  .result-count,
  .file-list-head {
    display: none;
  }

  .file-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .65rem;
    padding-top: .75rem;
  }

  .file-row {
    display: flex;
    min-height: 155px;
    align-items: stretch;
    flex-direction: column;
    gap: .6rem;
    padding: .85rem;
    border: 1px solid #e8eeeb;
    background: #fff;
  }

  .file-main {
    align-items: flex-start;
    flex: 1;
    flex-direction: column;
    gap: .65rem;
  }

  .file-icon {
    width: 2.8rem;
    height: 2.8rem;
  }

  .file-name-block {
    width: 100%;
  }

  .file-size {
    display: none;
  }

  .file-date {
    font-size: .6rem;
  }

  .file-actions {
    justify-content: flex-start;
    opacity: 1;
  }

  .file-action {
    background: #f3f6f4;
  }

  .preview-dialog {
    width: calc(100% - 1rem);
    height: calc(100vh - 1rem);
  }

  .preview-head .secondary-button span {
    display: none;
  }

  .upload-panel {
    right: .65rem;
    bottom: .65rem;
    width: calc(100% - 1.3rem);
  }
}

@media (max-width: 430px) {
  .head-actions .secondary-button span {
    font-size: .74rem;
  }

  .head-actions .primary-button span {
    font-size: .74rem;
  }

  .file-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .file-row {
    min-height: 125px;
  }

  .file-main {
    align-items: center;
    flex-direction: row;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
