/* ============================================================
   微蜘科技 · 后台管理样式（玻璃拟态 / 深色科技风）
   ============================================================ */
:root {
  --bg: #070b14;
  --bg-2: #0b1120;
  --glass: rgba(20, 30, 52, 0.55);
  --glass-2: rgba(28, 40, 66, 0.5);
  --stroke: rgba(120, 170, 255, 0.18);
  --stroke-strong: rgba(120, 180, 255, 0.4);
  --text: #e7efff;
  --muted: #93a4c4;
  --brand: #38bdf8;
  --brand-2: #6366f1;
  --ok: #34d399;
  --danger: #fb7185;
  --radius: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: radial-gradient(1200px 700px at 15% -10%, #132043 0%, transparent 60%),
              radial-gradient(900px 600px at 110% 10%, #10263f 0%, transparent 55%),
              linear-gradient(180deg, var(--bg), var(--bg-2));
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
.bg-decor { position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(600px 400px at 80% 90%, rgba(56,189,248,.10), transparent 70%),
              radial-gradient(500px 400px at 10% 80%, rgba(99,102,241,.10), transparent 70%);
}
.glass {
  background: var(--glass);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 10px 40px rgba(2, 8, 23, .45), inset 0 1px 0 rgba(255,255,255,.06);
}
.glass-soft { background: var(--glass-2); border: 1px solid var(--stroke); border-radius: 14px; }

/* ---------- 顶栏 ---------- */
.topbar { position: sticky; top: 0; z-index: 20; backdrop-filter: blur(16px);
  background: rgba(8, 13, 26, .72); border-bottom: 1px solid var(--stroke); }
.topbar-inner { max-width: 1240px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 26px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .5px; }
.brand-mark { width: 26px; height: 26px; border-radius: 9px; display: inline-block;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 0 18px rgba(56,189,248,.6); position: relative; }
.brand-mark.big { width: 52px; height: 52px; border-radius: 16px; }
.brand-mark::after { content: ""; position: absolute; inset: 6px; border-radius: 6px;
  border: 1.5px solid rgba(255,255,255,.75); }
.brand-mark.big::after { inset: 12px; border-radius: 10px; }
.brand-text { font-size: 16px; }
.brand-text em { font-style: normal; color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 6px; }
.topnav { display: flex; gap: 6px; margin-left: 12px; }
.topnav a { padding: 8px 14px; border-radius: 10px; color: var(--muted); font-size: 14px; transition: .2s; }
.topnav a:hover { color: var(--text); background: rgba(120,170,255,.08); }
.topnav a.active { color: #fff; background: linear-gradient(135deg, rgba(56,189,248,.22), rgba(99,102,241,.22));
  border: 1px solid var(--stroke-strong); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.ghost-link { color: var(--muted); font-size: 13px; }
.ghost-link:hover { color: var(--brand); }
.user-chip { font-size: 13px; color: var(--muted); padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--stroke); background: rgba(255,255,255,.03); }

/* ---------- 布局 ---------- */
.page { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: 30px 24px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: .5px; }
.muted { color: var(--muted); }
.page-head p { margin: 0; font-size: 14px; }
.page-foot { position: relative; z-index: 1; text-align: center; color: var(--muted); font-size: 12.5px; padding: 22px; }
.page-foot .dot { margin: 0 8px; opacity: .5; }

/* ---------- 按钮 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 12px; font-size: 14px; cursor: pointer; border: 1px solid transparent;
  transition: .2s; white-space: nowrap; font-family: inherit; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff;
  box-shadow: 0 8px 24px rgba(56,189,248,.3); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 30px rgba(56,189,248,.45); }
.btn-outline { border-color: var(--stroke); color: var(--text); background: rgba(255,255,255,.03); }
.btn-outline:hover { border-color: var(--stroke-strong); background: rgba(120,170,255,.1); }
.btn-danger { border-color: rgba(251,113,133,.4); color: var(--danger); background: rgba(251,113,133,.08); }
.btn-danger:hover { background: rgba(251,113,133,.18); }
.btn-block { width: 100%; margin-top: 6px; }
.inline { display: inline; }
.link { color: var(--brand); font-size: 13px; }
.link:hover { text-decoration: underline; }

/* ---------- 提示 ---------- */
.alert { padding: 12px 16px; border-radius: 12px; font-size: 14px; margin-bottom: 16px; border: 1px solid; }
.alert-ok { color: #b8f3d9; background: rgba(52,211,153,.12); border-color: rgba(52,211,153,.35); }
.alert-error { color: #ffd0d8; background: rgba(251,113,133,.12); border-color: rgba(251,113,133,.35); }

/* ---------- 统计卡 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 24px; }
.stat-card { padding: 22px; display: flex; flex-direction: column; gap: 8px; transition: .2s; }
.stat-card:hover { transform: translateY(-3px); border-color: var(--stroke-strong); }
.stat-num { font-size: 34px; font-weight: 700; background: linear-gradient(135deg, #7dd3fc, #a5b4fc);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-label { color: var(--muted); font-size: 13.5px; }

/* ---------- 面板 ---------- */
.panel { padding: 24px; margin-bottom: 22px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.panel-head h2 { margin: 0; font-size: 17px; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th, .data-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid rgba(120,170,255,.1); }
.data-table th { color: var(--muted); font-weight: 500; font-size: 13px; }
.data-table tr:last-child td { border-bottom: none; }
.ta-r { text-align: right; }
.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; border: 1px solid; }
.tag-internal { color: #7dd3fc; border-color: rgba(125,211,252,.4); background: rgba(125,211,252,.1); }
.tag-client { color: #c4b5fd; border-color: rgba(196,181,253,.4); background: rgba(196,181,253,.1); }
.dot-ok, .dot-off { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot-ok { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.dot-off { background: #64748b; }

/* ---------- 项目卡片 ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.project-card { overflow: hidden; display: flex; flex-direction: column; transition: .2s; }
.project-card:hover { transform: translateY(-3px); border-color: var(--stroke-strong); }
.project-card.is-off { opacity: .62; }
.pc-thumb { position: relative; height: 150px; background: linear-gradient(135deg, rgba(56,189,248,.14), rgba(99,102,241,.14));
  background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; }
.thumb-empty { color: var(--muted); font-size: 13px; }
.pc-badge { position: absolute; left: 10px; top: 10px; font-size: 12px; padding: 3px 10px; border-radius: 999px;
  background: rgba(7,11,20,.65); border: 1px solid var(--stroke); backdrop-filter: blur(6px); }
.pc-off { position: absolute; right: 10px; top: 10px; font-size: 12px; padding: 3px 10px; border-radius: 999px;
  background: rgba(251,113,133,.2); border: 1px solid rgba(251,113,133,.4); color: #ffd0d8; }
.pc-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.pc-body h3 { margin: 0; font-size: 16px; }
.pc-sub { margin: 0; font-size: 13px; }
.pc-meta { display: flex; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 12px; }
.pc-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 8px; flex-wrap: wrap; }

/* ---------- 表单 ---------- */
.form-panel { padding: 26px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 22px; }
.form-grid .span-2 { grid-column: span 2; }
.field { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.field > span { color: var(--muted); font-size: 13px; }
.field .req { color: var(--danger); }
.field input[type=text], .field input[type=number], .field input[type=password], .field textarea, .field select {
  width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--stroke);
  background: rgba(8,13,26,.55); color: var(--text); font-size: 14px; font-family: inherit; transition: .2s; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--stroke-strong); box-shadow: 0 0 0 3px rgba(56,189,248,.14); }
.field textarea { resize: vertical; }
.hint { color: var(--muted); font-size: 12px; }
.form-section-title { font-size: 15px; color: #b9cdf0; margin: 8px 0 16px; padding-left: 11px;
  border-left: 3px solid var(--brand); }
.section-sep { height: 1px; background: linear-gradient(90deg, transparent, var(--stroke), transparent); margin: 24px 0; }
.form-actions { display: flex; gap: 12px; margin-top: 26px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.switch { display: flex; align-items: center; gap: 10px; padding: 11px 0; }
.switch input { width: 18px; height: 18px; accent-color: var(--brand); }

/* ---------- 上传 ---------- */
.upload-box { display: flex; flex-direction: column; gap: 10px; }
.upload-preview { width: 100%; height: 140px; border-radius: 12px; border: 1px dashed var(--stroke);
  background: rgba(8,13,26,.4) center/cover no-repeat; }
.upload-preview.qr { max-width: 160px; }

/* 原生文件选择框美化 */
.field input[type=file] {
  width: 100%; font-size: 13px; color: var(--muted); cursor: pointer;
  padding: 8px; border: 1px dashed var(--stroke); border-radius: 12px;
  background: rgba(8,13,26,.4); transition: border-color .2s, background .2s; }
.field input[type=file]:hover { border-color: var(--stroke-strong); background: rgba(56,189,248,.06); }
.field input[type=file]:focus { outline: none; border-color: var(--stroke-strong); box-shadow: 0 0 0 3px rgba(56,189,248,.14); }
.field input[type=file]::-webkit-file-upload-button {
  -webkit-appearance: none; appearance: none; margin-right: 12px; padding: 8px 16px;
  border: 1px solid var(--stroke-strong); border-radius: 9px;
  background: linear-gradient(135deg, rgba(56,189,248,.25), rgba(99,102,241,.25));
  color: var(--text); font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: .2s; }
.field input[type=file]::-webkit-file-upload-button:hover {
  background: linear-gradient(135deg, rgba(56,189,248,.42), rgba(99,102,241,.42));
  box-shadow: 0 0 0 3px rgba(56,189,248,.12); }
.field input[type=file]::file-selector-button {
  appearance: none; margin-right: 12px; padding: 8px 16px;
  border: 1px solid var(--stroke-strong); border-radius: 9px;
  background: linear-gradient(135deg, rgba(56,189,248,.25), rgba(99,102,241,.25));
  color: var(--text); font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: .2s; }
.field input[type=file]::file-selector-button:hover {
  background: linear-gradient(135deg, rgba(56,189,248,.42), rgba(99,102,241,.42));
  box-shadow: 0 0 0 3px rgba(56,189,248,.12); }
.img-manage { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.img-item { position: relative; display: block; padding: 6px; cursor: pointer;
  transition: border-color .15s, opacity .15s, transform .15s; }
.img-item img { width: 100%; height: 110px; object-fit: cover; border-radius: 9px; display: block;
  -webkit-user-drag: none; user-select: none; }
.img-item input[type=checkbox] { position: absolute; top: 12px; left: 12px; width: 18px; height: 18px; accent-color: var(--danger); }
.img-item:has(input[type=checkbox]:checked) { border-color: rgba(251,113,133,.6); }
.img-item:has(input[type=checkbox]:checked) img { opacity: .4; }
.img-handle { position: absolute; top: 11px; right: 11px; z-index: 2; font-size: 12px; line-height: 1;
  padding: 4px 6px; border-radius: 7px; color: #cfe0ff; letter-spacing: 1px;
  background: rgba(5,8,15,.62); border: 1px solid var(--stroke); cursor: grab; user-select: none; }
.img-item:active .img-handle { cursor: grabbing; }
.img-item.dragging { opacity: .45; border-color: var(--brand); transform: scale(.97); }
.img-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; padding: 0 2px; }
.img-no { font-size: 11.5px; font-weight: 700; color: #bcd4f5; min-width: 20px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 5px;
  border-radius: 6px; background: rgba(125,175,255,.14); border: 1px solid var(--stroke); }
.img-del { font-size: 12px; color: var(--muted); }

/* ---------- 登录页 ---------- */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.login-wrap { position: relative; z-index: 1; width: 100%; max-width: 400px; }
.login-card { padding: 38px 32px; }
.login-brand { text-align: center; margin-bottom: 26px; }
.login-brand h1 { margin: 16px 0 4px; font-size: 22px; letter-spacing: 2px; }
.login-brand p { margin: 0; color: var(--muted); font-size: 13px; }
.login-card .field { margin-bottom: 16px; }
.login-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 20px; }

@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
  .topbar-inner { flex-wrap: wrap; gap: 12px; }
  .topnav { order: 3; width: 100%; overflow-x: auto; }
  .ghost-link, .user-chip { display: none; }
}
