:root {
  --ink: #17312d; --muted: #6e7e7a; --line: #dce5e2; --line-soft: #eaf0ee;
  --paper: #f5f8f7; --white: #fff; --brand: #17675a; --brand-dark: #0e4d43;
  --brand-soft: #e5f2ed; --sidebar: #f9fbfa; --danger: #b93a36;
  --shadow: 0 22px 60px rgba(24, 63, 55, .1);
  font-family: "Aptos", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink); background: var(--paper); font-synthesis: none;
}
[data-theme="dark"] {
  --ink: #e7efed; --muted: #94a7a2; --line: #30413d; --line-soft: #293a36;
  --paper: #15201e; --white: #1b2926; --brand: #55aa96; --brand-dark: #73c2af;
  --brand-soft: #233e37; --sidebar: #182522; --danger: #e36c67;
  --shadow: 0 22px 60px rgba(0, 0, 0, .28);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100dvh; background: var(--paper); transition: background .25s, color .25s; }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, [tabindex]:focus-visible, a:focus-visible { outline: 3px solid rgba(23, 103, 90, .2); outline-offset: 2px; }
svg { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-size: 18px; font-weight: 720; letter-spacing: -.02em; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; background: var(--brand); display: grid; place-items: center; color: #dff3e6; box-shadow: 0 8px 18px rgba(23, 103, 90, .16); }
.brand-mark svg { width: 28px; height: 28px; stroke-width: 2; }
.brand-mark svg path:first-child { fill: currentColor; stroke: none; }
.eyebrow { margin: 0 0 12px; color: var(--brand); font-size: 11px; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; }

/* Login page */
.login-shell { min-height: 100dvh; display: grid; grid-template-columns: minmax(480px, 46%) 1fr; background: #fbfcfb; }
.login-card { width: min(480px, calc(100% - 64px)); margin: auto; padding: 48px 0; }
.brand-login { margin-bottom: clamp(72px, 11vh, 124px); }
.login-copy h1 { font-family: "Songti SC", STSong, serif; margin: 0; font-size: clamp(40px, 4vw, 58px); line-height: 1.16; letter-spacing: -.055em; font-weight: 700; text-wrap: balance; }
.login-copy > p:last-child { margin: 22px 0 42px; color: var(--muted); font-size: 16px; }
.login-form label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 9px; }
.password-row { position: relative; }
.username-row { margin-bottom: 18px; }
.password-row input { width: 100%; height: 54px; border: 1px solid var(--line); border-radius: 13px; background: white; padding: 0 50px 0 16px; color: var(--ink); outline: none; transition: border-color .2s, box-shadow .2s; }
.password-row input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(23, 103, 90, .1); }
.password-row .icon-button { position: absolute; right: 6px; top: 6px; }
.security-note { margin: 30px 0 0; color: #8b9895; font-size: 12px; }
.security-note span { font-size: 8px; color: #65a18d; margin-right: 7px; }
.login-art { position: relative; overflow: hidden; background: #c9e4db; min-height: 100dvh; }
.art-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(21, 96, 82, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(21, 96, 82, .07) 1px, transparent 1px); background-size: 58px 58px; mask-image: linear-gradient(to bottom, transparent 4%, black 35%, black 70%, transparent 100%); }
.orbit { position: absolute; border: 1px solid rgba(17, 89, 76, .2); border-radius: 50%; }
.orbit-one { width: 720px; height: 720px; left: 7%; top: 7%; }
.orbit-two { width: 470px; height: 470px; left: 22%; top: 22%; border-style: dashed; }
.art-folder { position: absolute; left: 50%; top: 45%; width: 260px; height: 176px; transform: translate(-50%, -50%) rotate(-5deg); background: #f1f8f5; border-radius: 18px 28px 28px 28px; box-shadow: 0 42px 70px rgba(18, 84, 72, .16); }
.art-folder:before { content: ""; position: absolute; width: 115px; height: 34px; left: 0; top: -24px; border-radius: 18px 18px 0 0; background: #f1f8f5; }
.art-folder span, .art-folder i, .art-folder b { position: absolute; display: block; border-radius: 10px; background: white; box-shadow: 0 8px 20px rgba(26, 76, 67, .08); }
.art-folder span { width: 155px; height: 102px; left: 46px; top: 32px; transform: rotate(8deg); }
.art-folder i { width: 145px; height: 95px; left: 65px; top: 44px; transform: rotate(-4deg); background: #7fbba8; }
.art-folder b { width: 135px; height: 88px; left: 55px; top: 61px; background: #175f53; }
.login-art > p { position: absolute; left: 7%; bottom: 7%; font-family: Georgia, serif; font-size: 16px; line-height: 1.15; color: rgba(15, 77, 66, .6); font-style: italic; }

/* Drive workspace */
.app-shell { min-height: 100dvh; display: grid; grid-template-columns: 244px minmax(0, 1fr); background: var(--paper); }
.app-sidebar { position: sticky; top: 0; height: 100dvh; padding: 28px 20px 22px; border-right: 1px solid var(--line); background: var(--sidebar); display: flex; flex-direction: column; }
.app-brand { padding: 0 10px; }
.side-nav { margin-top: 42px; }
.side-link { width: 100%; min-height: 46px; display: flex; align-items: center; gap: 12px; padding: 0 13px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); text-align: left; font-size: 14px; font-weight: 650; transition: background .18s, color .18s, transform .18s; }
.side-link svg { width: 20px; }
.side-link:hover { color: var(--ink); background: #eef4f2; transform: translateX(2px); }
.side-link.active { color: var(--brand-dark); background: var(--brand-soft); }
.sidebar-bottom { margin-top: auto; display: grid; gap: 4px; }
.storage-summary { margin: 0 7px 16px; padding: 15px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.storage-summary span, .storage-summary small { display: block; color: var(--muted); font-size: 11px; }
.storage-summary strong { display: block; margin: 6px 0 4px; font-size: 20px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.storage-summary small b { color: var(--ink); font-weight: 700; }
.storage-status { margin: 0 7px 20px; padding: 14px 0 0; border-top: 1px solid var(--line); }
.storage-status span, .storage-status small { display: block; }
.storage-status span { font-size: 12px; font-weight: 700; }
.storage-status i { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #57a184; box-shadow: 0 0 0 4px #e0f1ea; }
.storage-status small { margin: 6px 0 0 14px; color: var(--muted); font-size: 11px; }
.side-utility { width: 100%; min-height: 38px; border: 0; border-radius: 9px; padding: 0 10px; display: flex; align-items: center; background: transparent; color: var(--muted); text-decoration: none; font-size: 12px; transition: background .18s, color .18s; }
.side-utility:hover { background: #eef3f1; color: var(--ink); }
.theme-toggle { gap: 10px; }
.theme-toggle svg { width: 17px; }
.app-main { min-width: 0; }
.mobile-topbar { display: none; }
.mobile-filters { display: none; }
.panel-open { overflow: hidden; }
.workspace { width: min(1180px, calc(100% - 72px)); margin: 0 auto; padding: 56px 0 88px; }
.workspace-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-bottom: 28px; }
.workspace-kicker { margin: 0 0 10px; color: var(--brand); font-size: 11px; font-weight: 780; letter-spacing: .08em; }
.workspace-head h1 { margin: 0 0 8px; font-size: clamp(30px, 3vw, 42px); line-height: 1.08; letter-spacing: -.045em; font-weight: 760; }
.subtitle { color: var(--muted); margin: 0; font-size: 14px; }

.icon-button { display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); transition: background .18s, color .18s, transform .18s; }
.icon-button:hover { background: #edf3f1; color: var(--ink); transform: translateY(-1px); }
.icon-button:active, .primary-button:active, .secondary-button:active, .danger-button:active, .side-link:active, .side-utility:active { transform: translateY(1px) scale(.98); }
.primary-button, .secondary-button, .danger-button { border: 0; border-radius: 11px; min-height: 46px; padding: 0 18px; font-weight: 720; display: inline-flex; align-items: center; justify-content: center; gap: 9px; transition: transform .18s, background .18s, box-shadow .18s; }
.primary-button { background: var(--brand); color: white; box-shadow: 0 8px 20px rgba(23, 103, 90, .18); }
.primary-button:hover { background: var(--brand-dark); transform: translateY(-1px); }
.primary-button:disabled, .secondary-button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.secondary-button { background: white; border: 1px solid var(--line); color: var(--ink); box-shadow: 0 3px 8px rgba(23, 49, 45, .04); }
.secondary-button:hover { background: #f3f7f5; }
.danger-button { background: var(--danger); color: #fff; }
.danger-button:hover { background: #9f2e2b; }
.login-button { width: 100%; margin-top: 6px; justify-content: space-between; padding: 0 18px; }
.field-error { min-height: 20px; margin: 7px 0; color: var(--danger); font-size: 13px; }
.text-button { border: 0; border-radius: 8px; background: transparent; color: var(--muted); padding: 8px; font-size: 13px; transition: background .18s, color .18s, transform .18s; }
.text-button:hover { background: var(--brand-soft); color: var(--ink); }

.upload-item { padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.upload-item:last-child { border: 0; }
.upload-meta { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 13px; }
.upload-select { width: 15px; height: 15px; accent-color: var(--brand); }
.upload-meta strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upload-meta > span { flex: 0 0 auto; color: var(--brand); font-size: 11px; font-variant-numeric: tabular-nums; }
.upload-details { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 7px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.upload-item.failed .upload-meta > span { color: var(--danger); }
.upload-item.paused .upload-meta > span, .upload-item[data-state="waiting"] .upload-meta > span { color: #8a6b20; }
.upload-item.done .progress i { background: #5d9f8d; }
.progress { height: 4px; background: #e8efed; border-radius: 10px; margin-top: 10px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--brand); border-radius: 10px; transition: width .2s; }
.upload-actions { display: flex; justify-content: flex-end; gap: 4px; margin-top: 8px; }
.upload-actions .text-button { padding: 6px 8px; font-size: 11px; }
.upload-actions .cancel-upload:hover { color: var(--danger); background: #faeceb; }

.file-section { position: relative; min-height: 430px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--white); box-shadow: 0 10px 30px rgba(35, 73, 65, .045); transition: border-color .18s, box-shadow .18s; }
.section-head { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 20px; border-bottom: 1px solid var(--line-soft); }
.section-title { display: flex; align-items: baseline; gap: 10px; }
.section-title h2 { margin: 0; font-size: 16px; }
.section-title span { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.file-tools { display: flex; gap: 8px; }
.search-box { height: 40px; width: 230px; display: flex; align-items: center; gap: 8px; background: var(--paper); border: 1px solid transparent; border-radius: 10px; padding: 0 12px; color: var(--muted); transition: border-color .18s, background .18s; }
.search-box:focus-within { background: white; border-color: #a9c6bd; }
.search-box input { border: 0; outline: 0; background: transparent; width: 100%; min-width: 0; color: var(--ink); }
.search-box svg { width: 17px; }
.sort-box { height: 40px; position: relative; display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--white); color: var(--muted); }
.sort-box select { height: 100%; appearance: none; border: 0; outline: 0; background: transparent; color: var(--muted); padding: 0 31px 0 12px; font-size: 12px; cursor: pointer; }
.sort-box svg { position: absolute; right: 8px; width: 15px; pointer-events: none; }
.bordered { border: 1px solid var(--line); background: white; }
.upload-manager-button { position: relative; }
.upload-manager-button[aria-expanded="true"] { color: var(--brand); background: var(--brand-soft); border-color: transparent; }
.upload-manager-button span { position: absolute; right: -5px; top: -5px; min-width: 18px; height: 18px; padding: 0 5px; border: 2px solid var(--white); border-radius: 10px; display: grid; place-items: center; background: var(--brand); color: white; font-size: 9px; font-weight: 800; }
.file-content { min-width: 0; }
.file-section.preview-open .file-content { display: grid; grid-template-columns: minmax(0, 1fr) 340px; }
.file-browser { min-width: 0; overflow-x: auto; }
.file-table-head, .file-row { min-width: 760px; display: grid; grid-template-columns: minmax(210px, 1fr) 135px 145px 90px 148px; align-items: center; }
.file-table-head { min-height: 40px; padding: 0 16px; background: #fafcfb; color: #85918e; font-size: 11px; border-bottom: 1px solid var(--line-soft); }
.file-table-head span:last-child { text-align: right; padding-right: 7px; }
.file-list { min-height: 0; }
.file-row { min-height: 68px; padding: 0 16px; border-bottom: 1px solid var(--line-soft); transition: background .15s; cursor: default; }
.file-row:last-child { border-bottom: 0; }
.file-row:hover { background: #f7faf9; }
.file-row.selected { background: var(--brand-soft); box-shadow: inset 3px 0 var(--brand); }
.file-main { display: flex; align-items: center; min-width: 0; gap: 12px; }
.file-icon { width: 36px; height: 40px; border: 1px solid var(--line); border-radius: 8px; background: white; display: grid; place-items: center; color: #49746b; position: relative; flex: 0 0 auto; }
.file-icon:after { content: ""; position: absolute; right: 5px; top: 5px; width: 6px; height: 6px; border-top: 1px solid currentColor; border-right: 1px solid currentColor; }
.file-name { overflow: hidden; }
.file-name strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; font-weight: 680; }
.file-name span { display: none; color: var(--muted); font-size: 11px; margin-top: 3px; }
.file-cell { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.file-type { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-actions { display: flex; justify-content: flex-end; gap: 2px; }
.file-actions .icon-button { width: 34px; height: 34px; }
.file-actions .delete-action:hover { color: var(--danger); background: #faeceb; }
.loading-list i { display: block; height: 68px; border-bottom: 1px solid var(--line-soft); background: linear-gradient(90deg, transparent 20%, #f1f5f3 45%, transparent 70%); background-size: 230% 100%; animation: shimmer 1.3s infinite; }
.empty-state, .error-state { text-align: center; padding: 68px 20px 74px; }
.empty-state > div { width: 58px; height: 58px; border-radius: 17px; background: var(--brand-soft); display: grid; place-items: center; color: var(--brand); margin: 0 auto 17px; }
.empty-state svg { width: 28px; height: 28px; }
.empty-state h3, .error-state strong { display: block; margin: 0 0 7px; font-size: 15px; }
.empty-state p, .error-state span { display: block; max-width: 430px; margin: 0 auto 20px; color: var(--muted); font-size: 12px; line-height: 1.6; text-wrap: pretty; }
.drop-overlay { position: absolute; inset: 8px; z-index: 8; border: 2px dashed var(--brand); border-radius: 12px; background: rgba(229, 242, 237, .94); display: grid; place-content: center; justify-items: center; text-align: center; opacity: 0; visibility: hidden; transform: scale(.985); transition: opacity .16s, transform .16s, visibility .16s; pointer-events: none; }
.file-section.drag-active { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(23, 103, 90, .09), 0 18px 45px rgba(23, 73, 63, .1); }
.file-section.drag-active .drop-overlay { opacity: 1; visibility: visible; transform: scale(1); }
.drop-overlay div { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 18px; background: var(--white); color: var(--brand); box-shadow: var(--shadow); }
.drop-overlay svg { width: 31px; height: 31px; }
.drop-overlay strong { margin-top: 18px; font-size: 20px; letter-spacing: -.02em; }
.drop-overlay span { margin-top: 7px; color: var(--muted); font-size: 12px; }

.preview-pane { min-width: 0; min-height: 430px; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--paper); }
.preview-pane > header { min-height: 68px; padding: 13px 14px 12px 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line-soft); }
.preview-pane > header p { margin: 0 0 3px; color: var(--muted); font-size: 10px; }
.preview-pane > header h3 { max-width: 255px; margin: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; }
.preview-body { flex: 1; min-height: 0; display: grid; place-items: center; overflow: auto; padding: 18px; }
.preview-body img { display: block; max-width: 100%; max-height: 520px; object-fit: contain; border-radius: 8px; box-shadow: 0 8px 24px rgba(20, 45, 39, .12); }
.preview-body video { width: 100%; max-height: 480px; border-radius: 8px; background: #101312; }
.preview-body iframe { width: 100%; height: 520px; border: 0; border-radius: 8px; background: white; }
.audio-preview { width: 100%; display: grid; place-items: center; gap: 22px; }
.audio-preview audio { width: 100%; }
.preview-file-icon { width: 72px; height: 82px; display: grid; place-items: center; color: var(--brand); background: var(--white); border: 1px solid var(--line); border-radius: 14px; }
.preview-file-icon svg { width: 34px; }
.preview-fallback { max-width: 260px; text-align: center; color: var(--muted); }
.preview-fallback .preview-file-icon { margin: 0 auto 18px; }
.preview-fallback strong { display: block; color: var(--ink); overflow-wrap: anywhere; }
.preview-fallback span { display: block; margin-top: 6px; font-size: 11px; }
.preview-fallback p, .preview-loading { color: var(--muted); font-size: 12px; line-height: 1.6; }
.preview-pane > footer { min-height: 64px; padding: 11px 16px; display: flex; justify-content: flex-end; align-items: center; border-top: 1px solid var(--line-soft); }

.upload-panel-scrim { position: fixed; inset: 0; z-index: 39; border: 0; background: rgba(12, 27, 24, .25); backdrop-filter: blur(2px); }
.upload-panel { position: fixed; right: 0; top: 0; z-index: 40; width: min(420px, 100vw); height: 100dvh; display: flex; flex-direction: column; background: var(--white); border-left: 1px solid var(--line); box-shadow: -18px 0 50px rgba(19, 49, 42, .16); animation: panel-in .22s ease; }
.upload-panel > header { min-height: 92px; padding: 22px 20px 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line-soft); }
.upload-panel > header p { margin: 0 0 4px; color: var(--brand); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.upload-panel > header h2 { margin: 0; font-size: 20px; letter-spacing: -.03em; }
.upload-batch-bar { min-height: 48px; padding: 7px 14px 7px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line-soft); background: var(--paper); }
.upload-batch-bar label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.upload-batch-bar label input { accent-color: var(--brand); }
.upload-batch-bar > div { display: flex; }
.danger-text { color: var(--danger); }
.danger-text:hover { color: var(--danger); background: #faeceb; }
.upload-queue { overflow-y: auto; }
.upload-empty { margin: auto 28px; text-align: center; color: var(--muted); }
.upload-empty div { width: 54px; height: 54px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 16px; background: var(--brand-soft); color: var(--brand); }
.upload-empty strong, .upload-empty span { display: block; }
.upload-empty strong { color: var(--ink); font-size: 14px; }
.upload-empty span { margin-top: 7px; font-size: 12px; line-height: 1.6; }
.upload-panel > footer { min-height: 64px; margin-top: auto; padding: 10px 14px; display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid var(--line-soft); }
.upload-panel-footer > div { display: flex; flex-wrap: wrap; }
@keyframes panel-in { from { opacity: 0; transform: translateX(24px); } }
.mobile-upload { display: none; position: fixed; right: 22px; bottom: 22px; width: 58px; height: 58px; border-radius: 18px; background: var(--brand); color: white; border: 0; box-shadow: 0 12px 28px rgba(23, 103, 90, .3); }
.mobile-upload svg { width: 25px; height: 25px; }

[data-theme="dark"] .login-shell { background: #15201e; }
[data-theme="dark"] .login-art { background: #24443c; }
[data-theme="dark"] .password-row input, [data-theme="dark"] .bordered, [data-theme="dark"] .secondary-button { background: var(--white); color: var(--ink); }
[data-theme="dark"] .side-link:hover, [data-theme="dark"] .side-utility:hover, [data-theme="dark"] .icon-button:hover { background: #263a35; }
[data-theme="dark"] .storage-status i { box-shadow: 0 0 0 4px #26453d; }
[data-theme="dark"] .search-box, [data-theme="dark"] .file-table-head { background: #182522; }
[data-theme="dark"] .search-box:focus-within { background: var(--white); }
[data-theme="dark"] .file-row:hover { background: #20312d; }
[data-theme="dark"] .file-icon { background: #22332f; }
[data-theme="dark"] .progress { background: #314640; }
[data-theme="dark"] .drop-overlay { background: rgba(29, 54, 47, .96); }
[data-theme="dark"] .modal-card, [data-theme="dark"] .share-result input, [data-theme="dark"] .modal-input { background: var(--white); color: var(--ink); }

.modal { border: 0; padding: 0; background: transparent; max-width: none; }
.modal::backdrop { background: rgba(15, 34, 31, .45); backdrop-filter: blur(4px); }
.modal-card { position: relative; width: min(460px, calc(100vw - 32px)); background: white; border-radius: 18px; padding: 30px; box-shadow: var(--shadow); }
.modal-close { position: absolute; right: 16px; top: 16px; }
.modal-icon { width: 46px; height: 46px; border-radius: 14px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin-bottom: 20px; }
.modal-icon.danger { background: #fae9e8; color: var(--danger); }
.modal-card h2 { font-size: 24px; letter-spacing: -.035em; margin: 0 0 6px; }
.modal-filename { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0 0 24px; }
.modal-card fieldset { border: 0; padding: 0; margin: 0 0 22px; }
.modal-card legend, .modal-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 9px; font-weight: 700; }
.modal-label { margin-top: 22px; }
.modal-input { width: 100%; height: 48px; border: 1px solid var(--line); border-radius: 11px; padding: 0 13px; color: var(--ink); outline: none; }
.modal-input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(23, 103, 90, .09); }
.duration-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.duration-options input { position: absolute; opacity: 0; }
.duration-options span { display: grid; place-items: center; height: 42px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; }
.duration-options input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.full-button { width: 100%; }
.share-result { display: flex; gap: 8px; margin-top: 12px; }
.share-result input { min-width: 0; flex: 1; border: 1px solid var(--line); border-radius: 10px; background: #f7f9f8; padding: 0 11px; color: var(--muted); font-size: 12px; }
.modal-hint { color: var(--muted); font-size: 12px; line-height: 1.55; margin: 14px 0 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; }
.toast-region { position: fixed; right: 24px; bottom: 24px; z-index: 100; display: grid; gap: 10px; }
.toast { max-width: 360px; background: #183b35; color: white; padding: 13px 16px; border-radius: 12px; box-shadow: var(--shadow); font-size: 13px; animation: toast-in .24s ease; }
.toast.error { background: #8f302d; }
@keyframes shimmer { to { background-position: -130% 0; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 900px) {
  .login-shell { display: block; }
  .login-art { display: none; }
  .login-card { width: min(460px, calc(100% - 40px)); min-height: 100dvh; padding: 34px 0; display: flex; flex-direction: column; }
  .brand-login { margin-bottom: auto; }
  .login-copy { margin-top: 70px; }
  .security-note { margin-top: auto; padding-top: 40px; }
  .app-shell { display: block; }
  .app-sidebar { display: none; }
  .mobile-topbar { height: 66px; padding: 0 22px; border-bottom: 1px solid var(--line); background: rgba(249, 251, 250, .94); backdrop-filter: blur(14px); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 20; }
  [data-theme="dark"] .mobile-topbar { background: rgba(24, 37, 34, .94); }
  .mobile-top-actions { display: flex; align-items: center; gap: 4px; }
  .workspace { width: calc(100% - 40px); padding-top: 38px; }
  .mobile-filters { display: flex; gap: 7px; margin: 0 0 16px; overflow-x: auto; scrollbar-width: none; }
  .mobile-filters::-webkit-scrollbar { display: none; }
  .mobile-filters button { flex: 0 0 auto; min-height: 34px; padding: 0 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--white); color: var(--muted); font-size: 12px; transition: background .18s, color .18s, border-color .18s, transform .18s; }
  .mobile-filters button:hover { color: var(--ink); border-color: #a9c6bd; }
  .mobile-filters button:active { transform: scale(.97); }
  .mobile-filters button.active { border-color: transparent; background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; }
}
@media (max-width: 650px) {
  .mobile-topbar { height: 62px; padding: 0 16px; }
  .mobile-topbar .brand { font-size: 16px; }
  .mobile-topbar .brand-mark { width: 32px; height: 32px; border-radius: 9px; }
  .workspace { width: calc(100% - 28px); padding: 30px 0 98px; }
  .workspace-head { align-items: flex-start; margin-bottom: 22px; }
  .workspace-head h1 { font-size: 30px; }
  .desktop-upload { display: none; }
  .file-section { min-height: 470px; border-radius: 14px; }
  .section-head { min-height: 72px; padding: 12px 14px; align-items: center; gap: 12px; }
  .section-title { display: block; }
  .section-title h2 { margin-bottom: 3px; }
  .file-tools { flex: 1; justify-content: flex-end; }
  .search-box { width: min(176px, 100%); }
  .sort-box { display: none; }
  .upload-manager-button { flex: 0 0 auto; }
  .file-table-head { display: none; }
  .file-table-head, .file-row { min-width: 0; }
  .file-row { grid-template-columns: minmax(0, 1fr) 108px; min-height: 70px; padding: 0 12px; }
  .file-row > .file-cell { display: none; }
  .file-name span { display: block; }
  .file-actions .icon-button { width: 32px; height: 34px; }
  .file-actions .share-action { display: none; }
  .mobile-upload { display: grid; place-items: center; z-index: 21; }
  .empty-state, .error-state { padding: 54px 18px 60px; }
  .toast-region { right: 16px; left: 16px; bottom: 92px; }
  .toast { max-width: none; }
  .login-copy h1 { font-size: 42px; }
  .duration-options { gap: 5px; }
  .modal-card { padding: 26px 22px; }
  .upload-panel { width: min(360px, calc(100vw - 20px)); }
  .file-section.preview-open .file-content { display: block; }
  .preview-pane { position: fixed; inset: 62px 0 0; z-index: 30; min-height: 0; border-left: 0; background: var(--paper); }
  .preview-pane > header h3 { max-width: calc(100vw - 110px); }
  .drop-overlay strong { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
