/* 文件分享站样式（T8/T9）：外链独立 CSS，页面无内联样式，维持严格 CSP。 */
:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #1c2430;
  --muted: #6b7280;
  --primary: #2563eb;
  --danger: #dc2626;
  --border: #e5e7eb;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  line-height: 1.5;
}
[hidden] { display: none !important; }

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px; background: var(--card); border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; font-size: 16px; }
.nav a { margin-left: 14px; color: var(--muted); text-decoration: none; font-size: 14px; }
.nav a.active { color: var(--primary); font-weight: 600; }

main { max-width: 720px; margin: 24px auto; padding: 0 16px; }
.view {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 24px 20px;
}
h1 { font-size: 22px; margin: 0 0 6px; }
.hint, .empty { color: var(--muted); font-size: 14px; }

.login-form { display: flex; gap: 10px; margin-top: 14px; }
.login-form input {
  flex: 1; min-width: 0; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 8px; font-size: 15px;
}
button {
  padding: 10px 18px; border: none; border-radius: 8px;
  font-size: 15px; cursor: pointer; background: #e5e7eb; color: #374151;
}
button.btn-primary { background: var(--primary); color: #fff; }
button.btn-danger { background: var(--danger); color: #fff; }
button:disabled { opacity: 0.55; cursor: not-allowed; }

.message { margin-top: 12px; padding: 10px 12px; border-radius: 8px; font-size: 14px; background: #eef2ff; color: #3730a3; }
.message.error { background: #fef2f2; color: #b91c1c; }

.panel { margin-top: 18px; }
.file-list { list-style: none; margin: 0; padding: 0; }
.file-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--border);
}
.file-row:last-child { border-bottom: none; }
.file-info { min-width: 0; display: flex; flex-direction: column; }
.file-name { font-weight: 600; word-break: break-all; }
.file-meta { color: var(--muted); font-size: 13px; margin-top: 2px; }

.upload-zone {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin: 14px 0; padding: 14px;
  border: 1px dashed var(--border); border-radius: 10px;
}
.file-picked { color: var(--muted); flex: 1; min-width: 120px; font-size: 14px; word-break: break-all; }
.progress { flex-basis: 100%; display: flex; align-items: center; gap: 8px; }
.progress-track { flex: 1; height: 8px; background: #e5e7eb; border-radius: 4px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--primary); transition: width 0.15s ease; }
#admin-progress-text { font-size: 13px; color: var(--muted); min-width: 44px; text-align: right; }

.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 20px 16px; }

/* 管理页：行内操作按钮（下载+删除）与口令设置区 */
.file-actions { display: flex; gap: 8px; flex-shrink: 0; }
.file-actions button { white-space: nowrap; }
.settings-zone {
  margin-top: 18px; padding: 14px;
  border: 1px solid var(--border); border-radius: 10px;
}
.settings-zone h2 { margin: 0 0 6px; font-size: 16px; }
.field { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.field label { font-size: 13px; color: var(--muted); }
.field input[type="password"] {
  padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; min-width: 180px; flex: 1;
}
#pwd-message { margin-top: 8px; }

@media (max-width: 560px) {
  main { margin: 12px auto; }
  .view { padding: 18px 14px; }
  .login-form { flex-direction: column; }
  .file-row { flex-wrap: wrap; }
  .file-row button { width: 100%; }
  .nav a { margin-left: 10px; }
}
