:root {
  color: #18201d;
  background: #f4f6f5;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
  letter-spacing: 0;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; }
button, input, select { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.login-shell { min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 28px; padding: 28px; background: #edf1ef; }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-lockup strong, .brand-lockup small { display: block; }
.brand-lockup strong { font-size: 18px; }
.brand-lockup small { margin-top: 3px; color: #68736e; font-size: 12px; }
.brand-mark { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 7px; background: #16624a; color: white; font: 700 20px/1 Georgia, serif; }
.login-panel { width: min(100%, 388px); display: grid; gap: 20px; padding: 30px; border: 1px solid #d7ddda; border-radius: 8px; background: white; box-shadow: 0 18px 50px rgba(20, 38, 31, .08); }
.login-panel h1 { margin: 0; font-size: 24px; }
.login-panel p { margin: 7px 0 0; color: #68736e; font-size: 14px; }
.login-panel label { display: grid; gap: 8px; color: #3f4a45; font-size: 13px; font-weight: 600; }
.login-panel input { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid #c8d0cc; border-radius: 6px; outline: none; }
.login-panel input:focus, .search input:focus { border-color: #16624a; box-shadow: 0 0 0 3px rgba(22, 98, 74, .12); }
.primary { min-height: 44px; border: 0; border-radius: 6px; background: #16624a; color: white; cursor: pointer; font-weight: 700; }
.primary:hover { background: #0f513d; }
.primary:disabled { opacity: .65; cursor: wait; }
.form-error { padding: 10px 12px; border-left: 3px solid #b43131; background: #fff3f3; color: #8d2424 !important; }
.security-note { margin: 0; color: #78827e; font-size: 12px; }

.workspace { min-height: 100vh; }
.topbar { height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 34px; border-bottom: 1px solid #dce1de; background: #fff; }
.brand-lockup.compact .brand-mark { width: 34px; height: 34px; font-size: 17px; }
.brand-lockup.compact strong { font-size: 15px; }
.account { display: flex; align-items: center; gap: 12px; color: #4f5a55; font-size: 13px; }
.icon-button { display: inline-grid; width: 36px; height: 36px; place-items: center; border: 0; border-radius: 6px; background: transparent; color: #4c5852; cursor: pointer; text-decoration: none; }
.icon-button:hover { background: #eef2f0; color: #145a45; }
.icon-button:disabled { opacity: .45; cursor: wait; }
.icon-button.bordered { border: 1px solid #ccd4d0; background: white; }
.command-button { display: inline-flex; height: 38px; align-items: center; gap: 8px; padding: 0 13px; border: 0; border-radius: 6px; background: #16624a; color: white; cursor: pointer; font-weight: 700; white-space: nowrap; }
.command-button:hover { background: #0f513d; }
.command-button:disabled { opacity: .6; cursor: wait; }
.toolbar { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 30px 34px 22px; }
.toolbar h1 { margin: 0; font-size: 24px; }
.toolbar p { margin: 6px 0 0; color: #6e7974; font-size: 13px; }
.actions { display: flex; gap: 10px; }
.project-select { display: flex; height: 38px; align-items: center; gap: 8px; padding: 0 9px; border: 1px solid #ccd4d0; border-radius: 6px; background: white; color: #68736e; font-size: 12px; font-weight: 700; }
.project-select select { min-width: 110px; max-width: 200px; border: 0; outline: 0; background: white; color: #25312b; }
.search { display: flex; width: 280px; height: 38px; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid #ccd4d0; border-radius: 6px; background: white; color: #7a8580; }
.search input { width: 100%; height: 100%; border: 0; outline: 0; background: transparent; box-shadow: none !important; }
.file-table { margin: 0 34px 40px; overflow: hidden; border: 1px solid #d8dfdb; border-radius: 7px; background: white; }
.table-head, .file-row { display: grid; grid-template-columns: minmax(260px, 2.2fr) minmax(120px, 1fr) 100px 150px 90px 82px; align-items: center; gap: 18px; }
.table-head { min-height: 42px; padding: 0 18px; border-bottom: 1px solid #dfe4e1; background: #f7f9f8; color: #69746f; font-size: 12px; font-weight: 700; }
.file-row { min-height: 66px; padding: 9px 18px; border-bottom: 1px solid #edf0ee; color: #4e5954; font-size: 13px; }
.file-row:last-child { border-bottom: 0; }
.file-row:hover { background: #fafcfb; }
.file-details { display: contents; }
.file-name { min-width: 0; display: flex; align-items: center; gap: 12px; }
.file-name > span:last-child { min-width: 0; }
.file-name .file-link, .file-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-link { width: 100%; padding: 0; border: 0; background: transparent; color: #1e2823; cursor: pointer; font-size: 14px; font-weight: 700; text-align: left; }
.file-link:hover { color: #16624a; text-decoration: underline; }
.file-name small { margin-top: 4px; color: #7a8580; font-size: 11px; font-weight: 400; }
.file-icon { display: grid; flex: 0 0 34px; width: 34px; height: 38px; place-items: center; border: 1px solid #cfe0d8; border-radius: 5px; background: #edf6f2; color: #16624a; }
.directory { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status { display: inline-block; padding: 4px 7px; border-radius: 4px; background: #eef1ef; color: #58635e; font-size: 11px; }
.status.ready { background: #e0f3ea; color: #176247; }
.row-actions { display: flex; justify-content: flex-end; gap: 2px; }
.empty { padding: 64px 20px; color: #74807a; text-align: center; }
.toast { position: fixed; right: 28px; bottom: 28px; max-width: min(360px, calc(100vw - 40px)); padding: 12px 16px; border: 1px solid #a9cabe; border-radius: 6px; background: #e5f4ee; color: #164f3b; box-shadow: 0 12px 35px rgba(20, 38, 31, .14); font-size: 13px; }
.toast.error { border-color: #e1b4b4; background: #fff0f0; color: #8b2828; }
.preview-dialog { width: min(960px, calc(100vw - 40px)); max-height: calc(100vh - 60px); padding: 0; overflow: hidden; border: 1px solid #cfd7d3; border-radius: 8px; background: white; box-shadow: 0 24px 70px rgba(15, 31, 25, .22); }
.preview-dialog::backdrop { background: rgba(17, 28, 24, .56); }
.preview-head { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 10px 14px 10px 20px; border-bottom: 1px solid #e1e5e3; }
.preview-head strong, .preview-head small { display: block; max-width: min(720px, calc(100vw - 150px)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-head small { margin-top: 4px; color: #74807a; font-size: 11px; }
.preview-media { display: grid; min-height: 320px; max-height: calc(100vh - 126px); place-items: center; overflow: auto; background: #121715; color: white; }
.preview-media video, .preview-media img { display: block; max-width: 100%; max-height: calc(100vh - 126px); object-fit: contain; }
.preview-media audio { width: min(620px, calc(100% - 40px)); }

@media (max-width: 920px) {
  .topbar, .toolbar { padding-left: 18px; padding-right: 18px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .actions, .search { width: 100%; }
  .actions { flex-wrap: wrap; }
  .project-select { flex: 1 1 200px; }
  .file-table { margin-left: 18px; margin-right: 18px; overflow-x: auto; }
  .table-head, .file-row { min-width: 920px; }
}

@media (max-width: 520px) {
  .login-shell { padding: 18px; }
  .login-panel { padding: 24px 20px; }
  .brand-lockup.compact small, .account > span { display: none; }
  .toolbar { padding-top: 22px; }
  .actions { align-items: stretch; }
  .file-table { overflow: hidden; }
  .table-head { display: none; }
  .file-row { min-width: 0; grid-template-columns: minmax(0, 1fr) 78px; gap: 8px 10px; padding: 13px 12px; }
  .file-name { grid-column: 1; min-width: 0; }
  .file-details { grid-column: 1; display: flex; min-width: 0; align-items: center; gap: 8px; color: #6f7a75; font-size: 11px; }
  .file-details .directory { max-width: 45%; }
  .file-date { display: none; }
  .status { padding: 3px 5px; }
  .row-actions { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
}
