/* share.codingnuts.net — 简约现代风 */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --border: #e7e9ee;
  --border-strong: #d5d9e2;
  --text: #1b1f2a;
  --text-soft: #69707f;
  --text-faint: #9aa1b0;
  --brand: #4f46e5;
  --brand-strong: #4338ca;
  --brand-soft: #eef0ff;
  --ok: #16a34a;
  --ok-soft: #ecfdf3;
  --bad: #dc2626;
  --bad-soft: #fef2f2;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.07), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 8px 24px rgba(16, 24, 40, 0.10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.3; margin: 0 0 12px; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn:hover {
  border-color: var(--text-faint);
  background: var(--surface-2);
  text-decoration: none;
}
.btn:active { transform: translateY(0.5px); }
.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn-primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.btn-danger { color: var(--bad); }
.btn-danger:hover { background: var(--bad-soft); border-color: var(--bad); }
.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--text-soft);
}
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; color: var(--text); }

/* ---------- 表单 ---------- */
label.field { display: block; margin-bottom: 16px; }
label.field > span {
  display: block;
  font-size: 13px;
  font-weight: 550;
  color: var(--text-soft);
  margin-bottom: 6px;
}
input[type="text"], input[type="password"], input[type="file"] {
  font: inherit;
  font-size: 14px;
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  width: 100%;
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
input[type="text"]:focus, input[type="password"]:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* ---------- 提示框 ---------- */
.alert {
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 16px;
}
.alert-error { background: var(--bad-soft); color: var(--bad); border: 1px solid #fecaca; }

/* ============ 登录页 ============ */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 50% -10%, #e8eaff 0%, transparent 60%),
    var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 36px 32px 32px;
}
.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
}
.logo-mark {
  width: 40px; height: 40px;
  border-radius: 11px;
  background: var(--brand);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}
.auth-brand .name { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.auth-brand .kicker { display: block; font-size: 12px; color: var(--text-faint); font-weight: 400; margin-top: 1px; }
.auth-card h1 { font-size: 20px; margin-bottom: 4px; }
.auth-card .sub { color: var(--text-soft); font-size: 14px; margin: 0 0 22px; }

/* ============ 顶部导航 ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand .logo-mark { width: 32px; height: 32px; border-radius: 9px; font-size: 16px; }
.brand .kicker { display: block; font-size: 11px; color: var(--text-faint); font-weight: 400; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-soft);
}
.user-chip .avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.role-tag {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}
.role-tag.admin { background: #fff7ed; color: #c2410c; }

/* ============ 主体布局 ============ */
.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}
.page-head { margin-bottom: 20px; }
.page-head h1 { margin-bottom: 2px; }
.page-head .sub { color: var(--text-soft); font-size: 14px; margin: 0; }

.section { margin-bottom: 28px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.section-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
.section-head .badge-count {
  font-size: 12px;
  color: var(--text-faint);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 9px;
  font-weight: 500;
}

.breadcrumb {
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 14px;
  padding: 8px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.breadcrumb .sep { color: var(--text-faint); margin: 0 4px; }

/* ---------- 上传区 ---------- */
.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  color: var(--text-soft);
  background: var(--surface-2);
  text-align: center;
  font-size: 14px;
  transition: border-color .15s, background .15s;
}
.dropzone:hover { border-color: var(--brand); background: var(--brand-soft); }
.dropzone.dz-over { border-color: var(--brand); background: var(--brand-soft); }
.dropzone input[type=file] { width: auto; margin-top: 8px; font-size: 13px; }
.dz-status { margin-top: 8px; font-size: 13px; }
.dz-ok { color: var(--ok); }
.dz-error { color: var(--bad); }

/* ---------- 文件列表 ---------- */
.file-list { list-style: none; margin: 0; padding: 0; }
.file-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.file-list li:last-child { border-bottom: none; }
.file-list li:hover { background: var(--surface-2); }
.ficon {
  width: 36px; height: 36px;
  flex: none;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.ficon.folder { background: #fef7e6; border-color: #f3e3bd; }
.fmeta { flex: 1 1 auto; min-width: 0; }
.fname {
  display: inline-block;
  font-weight: 550;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.fmeta .fname:hover { color: var(--brand); }
.fsize { font-size: 12px; color: var(--text-faint); }
.factions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.factions .inline { display: inline-flex; }
.factions input[type="text"] { width: 110px; padding: 5px 9px; font-size: 13px; }
.factions .btn { padding: 5px 10px; font-size: 12.5px; }

.empty {
  color: var(--text-faint);
  text-align: center;
  padding: 28px 12px;
  font-size: 14px;
}

/* ---------- 小树洞用户列表 ---------- */
.user-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.user-list a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 550;
  transition: border-color .15s, background .15s;
}
.user-list a:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); text-decoration: none; }

/* ---------- 页脚 ---------- */
.foot {
  text-align: center;
  color: var(--text-faint);
  font-size: 12.5px;
  padding: 20px 0 32px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .topbar-inner { padding: 0 14px; }
  .wrap { padding: 16px 14px 40px; }
  .file-list li { flex-wrap: wrap; }
  .factions { width: 100%; padding-left: 48px; justify-content: flex-start; }
  .brand .kicker { display: none; }
}
