:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --soft: #f9fafb;
  --accent: #111827;
  --danger: #b91c1c;
  --radius: 16px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
button, input { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.center-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 24px; padding: 32px; box-shadow: 0 18px 60px rgba(17,24,39,.08); }
.brand-mark { width: 52px; height: 52px; display: grid; place-items: center; background: var(--accent); color: #fff; border-radius: 15px; font-weight: 800; font-size: 22px; }
h1, h2, h3, p { margin-top: 0; }
.login-card h1 { margin: 18px 0 6px; font-size: 26px; }
label { display: block; font-size: 14px; font-weight: 700; margin: 18px 0 8px; }
input { width: 100%; border: 1px solid var(--line); background: #fff; color: var(--text); border-radius: 12px; padding: 12px 14px; outline: none; }
input:focus { border-color: #9ca3af; box-shadow: 0 0 0 3px rgba(17,24,39,.05); }
button, .upload-label { border: 0; border-radius: 11px; padding: 10px 14px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.primary { background: var(--accent); color: white; }
.secondary { background: #fff; color: var(--text); border: 1px solid var(--line); }
.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.full { width: 100%; margin-top: 20px; }
.message { min-height: 20px; margin: 12px 0 0; color: var(--danger); font-size: 14px; }
.app { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 34px 0 70px; }
.topbar { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 22px; }
.topbar h1 { margin: 2px 0 0; font-size: clamp(24px, 4vw, 36px); }
.eyebrow { font-size: 11px; letter-spacing: .14em; font-weight: 800; color: var(--muted); }
.toolbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 14px; }
.toolbar-left { display: flex; gap: 10px; flex-wrap: wrap; }
.upload-label { cursor: pointer; }
.search { max-width: 320px; }
.breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 14px; color: var(--muted); margin: 14px 0; min-height: 26px; }
.crumb { border: 0; background: none; color: var(--muted); padding: 4px 2px; font-weight: 700; }
.crumb:hover { color: var(--text); }
.drop-zone { min-height: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; transition: .15s ease; }
.drop-zone.dragging { outline: 3px dashed #9ca3af; outline-offset: -9px; background: #fbfbfc; }
.status-line { font-size: 13px; color: var(--muted); margin: 0 0 12px 2px; }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.file-card { border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 14px; min-width: 0; }
.file-card:hover { box-shadow: 0 8px 26px rgba(17,24,39,.06); }
.file-main { display: grid; grid-template-columns: 42px 1fr; gap: 10px; align-items: center; cursor: pointer; min-width: 0; }
.file-icon { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--soft); font-size: 22px; }
.file-name { font-weight: 800; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { margin-top: 4px; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-actions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.mini-btn { border: 0; background: var(--soft); padding: 7px 9px; border-radius: 9px; font-size: 12px; font-weight: 700; }
.mini-btn.danger { color: var(--danger); }
.empty { min-height: 290px; display: grid; place-items: center; align-content: center; text-align: center; color: var(--muted); }
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty h3 { color: var(--text); margin-bottom: 6px; }
.modal { position: fixed; inset: 0; background: rgba(17,24,39,.58); display: grid; place-items: center; padding: 18px; z-index: 50; }
.modal-panel { width: min(1000px, 100%); max-height: 92vh; display: flex; flex-direction: column; background: #fff; border-radius: 18px; overflow: hidden; }
.modal-head { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.modal-head h2 { margin: 4px 0 0; font-size: 18px; overflow-wrap: anywhere; }
.icon-btn { width: 38px; height: 38px; padding: 0; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 25px; line-height: 1; }
.preview-body { flex: 1; min-height: 55vh; overflow: auto; background: #f7f7f8; padding: 14px; }
.preview-body iframe { width: 100%; height: 65vh; border: 0; background: #fff; border-radius: 10px; }
.preview-body img { max-width: 100%; height: auto; display: block; margin: 0 auto; border-radius: 8px; }
.preview-body pre { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.preview-note { display: grid; place-items: center; min-height: 45vh; text-align: center; color: var(--muted); }
.modal-actions { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: #111827; color: #fff; padding: 10px 14px; border-radius: 10px; font-size: 14px; z-index: 100; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
@media (max-width: 700px) {
  .app { width: min(100% - 20px, 1180px); padding-top: 18px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search { max-width: none; }
  .file-grid { grid-template-columns: 1fr; }
  .drop-zone { padding: 12px; }
  .modal { padding: 0; }
  .modal-panel { width: 100%; height: 100vh; max-height: none; border-radius: 0; }
  .preview-body iframe { height: calc(100vh - 170px); }
}
