/* ============================================================
   如团云 · 云端 Web — 设计系统
   深色科技风 · 玻璃拟态 · 渐变 Hero · 卡片化
   ============================================================ */
:root {
  --bg: #081711;
  --bg-2: #0c231a;
  --panel: rgba(236, 243, 238, .05);
  --panel-2: rgba(236, 243, 238, .09);
  --line: rgba(236, 243, 238, .09);
  --line-2: rgba(236, 243, 238, .16);
  --text: #edf2ec;
  --muted: #9db4a6;
  --dim: #6e8678;
  --brand: #2fa06c;
  --brand-2: #57c795;
  --pink: #e8a87c;
  --grad: linear-gradient(120deg, #1f7a50, #2fa06c 45%, #d4af37);
  --ok: #22c55e;
  --warn: #f59e0b;
  --err: #ef4444;
  --gold: #d4af37;
  --radius: 16px;
  --radius-s: 10px;
  --shadow: 0 8px 32px rgba(2, 12, 8, .5);
  --font: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
}
::selection { background: rgba(212, 175, 55, .35); }
a { color: #b8e0c8; text-decoration: none; }
button { font-family: inherit; }
input, textarea, select { font-family: inherit; color: var(--text); }

/* 背景光斑 */
.bg-orbs { position: fixed; inset: 0; z-index: -1; overflow: hidden; background:
  radial-gradient(1200px 700px at 85% -10%, rgba(47, 160, 108, .15), transparent 60%),
  radial-gradient(900px 600px at -10% 20%, rgba(212, 175, 55, .09), transparent 60%),
  radial-gradient(800px 800px at 50% 120%, rgba(87, 199, 149, .07), transparent 60%), var(--bg); }
.orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; animation: drift 22s ease-in-out infinite alternate; }
.orb.a { width: 420px; height: 420px; background: #1b5e40; top: -120px; right: -80px; }
.orb.b { width: 360px; height: 360px; background: #2fa06c; bottom: -140px; left: -100px; animation-delay: -8s; }
@keyframes drift { to { transform: translate(60px, 40px) scale(1.12); } }

/* ---------- 布局 ---------- */
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px 80px; }
.topbar {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  background: rgba(8, 23, 17, .72); border-bottom: 1px solid var(--line);
}
.topbar-in { max-width: 1200px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 14px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: .5px; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px; background: var(--grad);
  display: grid; place-items: center; font-size: 16px; color: #fff;
  box-shadow: 0 4px 18px rgba(31, 122, 80, .5);
}
.topbar .spacer { flex: 1; }

/* 状态胶囊 */
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px; border-radius: 999px; font-size: 12.5px;
  background: var(--panel); border: 1px solid var(--line); color: var(--muted);
  white-space: nowrap;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 4px rgba(34, 197, 94, .18); animation: pulse 2s infinite; }
.dot.off { background: var(--err); }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); } }

/* ---------- 通用组件 ---------- */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--text); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: .18s; user-select: none;
}
.btn:hover { border-color: rgba(255, 255, 255, .3); transform: translateY(-1px); }
.btn:active { transform: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--grad); border: none; color: #fff; box-shadow: 0 6px 24px rgba(31, 122, 80, .45); }
.btn.primary:hover:not(:disabled) { box-shadow: 0 8px 30px rgba(31, 122, 80, .65); }
.btn.danger { background: rgba(239, 68, 68, .14); border-color: rgba(239, 68, 68, .35); color: #fca5a5; }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.sm { padding: 6px 13px; font-size: 12.5px; border-radius: 9px; }
.btn.lg { padding: 13px 30px; font-size: 15px; border-radius: 14px; }

.input, textarea.input, select.input {
  width: 100%; padding: 11px 14px; border-radius: 12px;
  background: rgba(0, 0, 0, .28); border: 1px solid var(--line-2); color: var(--text);
  font-size: 14px; outline: none; transition: .18s;
}
.input:focus { border-color: #d4af37; box-shadow: 0 0 0 3px rgba(212, 175, 55, .18); }
.input::placeholder { color: var(--dim); }
textarea.input { resize: vertical; min-height: 110px; line-height: 1.7; }
label.fld { display: block; font-size: 12.5px; color: var(--muted); margin: 0 0 6px 2px; font-weight: 600; }
.field { margin-bottom: 14px; }

.tag { display: inline-flex; align-items: center; gap: 5px; padding: 2.5px 9px; border-radius: 7px; font-size: 11.5px; font-weight: 700; letter-spacing: .3px; }
.tag.tuan { background: rgba(251, 191, 36, .14); color: var(--gold); border: 1px solid rgba(251, 191, 36, .3); }
.tag.no { background: rgba(148, 163, 184, .12); color: #94a3b8; border: 1px solid rgba(148, 163, 184, .25); }
.tag.ok { background: rgba(34, 197, 94, .13); color: #4ade80; border: 1px solid rgba(34, 197, 94, .3); }
.tag.err { background: rgba(239, 68, 68, .13); color: #f87171; border: 1px solid rgba(239, 68, 68, .3); }
.tag.wait { background: rgba(245, 158, 11, .13); color: #fbbf24; border: 1px solid rgba(245, 158, 11, .3); }
.tag.info { background: rgba(47, 160, 108, .15); color: #a9d8be; border: 1px solid rgba(47, 160, 108, .32); }

.muted { color: var(--muted); }
.dim { color: var(--dim); }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }

/* ---------- 登录视图 ---------- */
[data-view] { display: none; }
body[data-view="login"] #view-login, body[data-view="app"] #view-app, body[data-view="admin"] #view-admin { display: block; }

.login-stage { min-height: calc(100vh - 60px); display: grid; place-items: center; padding: 30px 16px; }
.login-card { width: 400px; max-width: 100%; padding: 40px 36px 34px; text-align: center; }
.login-card .logo-mark { width: 56px; height: 56px; border-radius: 16px; font-size: 26px; margin: 0 auto 16px; }
.login-card h1 { font-size: 24px; font-weight: 800; letter-spacing: 1px; }
.login-card .sub { color: var(--muted); font-size: 13px; margin: 6px 0 26px; }
.login-card .field { text-align: left; }
.login-card .btn { width: 100%; margin-top: 6px; }
.login-err { color: #f87171; font-size: 12.5px; min-height: 18px; margin: 8px 0 4px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 22px; margin-top: 22px;
  padding: 34px 34px 30px; border: 1px solid rgba(212, 175, 55, .22);
  background: linear-gradient(135deg, rgba(31, 122, 80, .55), rgba(47, 160, 108, .32) 40%, rgba(212, 175, 55, .16));
  box-shadow: var(--shadow);
}
.hero::before { content: ""; position: absolute; inset: 0;
  background: radial-gradient(700px 300px at 90% -40%, rgba(212, 175, 55, .22), transparent 65%); pointer-events: none; }
.hero h2 { font-size: 25px; font-weight: 800; letter-spacing: .3px; }
.hero .sub { color: #cfe3d4; margin-top: 4px; font-size: 13.5px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; position: relative; }
.hstat {
  flex: 1; min-width: 150px; padding: 14px 18px; border-radius: 14px;
  background: rgba(7, 11, 24, .38); border: 1px solid rgba(255, 255, 255, .12);
}
.hstat .k { font-size: 12px; color: #aab3e0; }
.hstat .v { font-size: 23px; font-weight: 800; margin-top: 2px; font-variant-numeric: tabular-nums; }
.hstat .v small { font-size: 12px; color: #aab3e0; font-weight: 600; margin-left: 3px; }

/* ---------- 分区 ---------- */
section.block { margin-top: 26px; }
.block-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.block-head h3 { font-size: 16.5px; font-weight: 800; }
.block-head .spacer { flex: 1; }
.block-head .hint { font-size: 12px; color: var(--dim); }

/* 提交面板 */
.submit-grid { display: grid; grid-template-columns: 1fr 300px; gap: 16px; }
.submit-grid .card { padding: 20px; }
.count-tip { display: flex; justify-content: space-between; font-size: 12px; color: var(--dim); margin-top: 8px; }
.side-panel .field { margin-bottom: 12px; }
.side-panel .btn { width: 100%; }

/* 活跃任务 */
.task-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; }
.task-row + .task-row { border-top: 1px solid var(--line); }
.task-main { flex: 1; min-width: 0; }
.task-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13.5px; }
.task-msg { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.progress { height: 7px; border-radius: 99px; background: rgba(255, 255, 255, .08); margin-top: 9px; overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 99px; background: var(--grad); transition: width .5s ease; width: 0; }

/* ---------- 商品卡片 ---------- */
.grid-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.pcard { padding: 18px; display: flex; flex-direction: column; gap: 12px; transition: .2s; position: relative; overflow: hidden; }
.pcard:hover { border-color: rgba(212, 175, 55, .35); transform: translateY(-2px); }
.pcard-top { display: flex; gap: 13px; }
.pcard-img {
  width: 76px; height: 76px; border-radius: 12px; flex: none; object-fit: cover;
  background: rgba(255, 255, 255, .06); border: 1px solid var(--line);
}
.pcard-name {
  font-size: 13.5px; font-weight: 600; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pcard-id { font-size: 11.5px; color: var(--dim); margin-top: 4px; }
.pcard-tags { display: flex; gap: 6px; margin-top: 7px; flex-wrap: wrap; }

.pdata { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pdata .cell { background: rgba(0, 0, 0, .22); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.pdata .k { font-size: 10.5px; color: var(--dim); white-space: nowrap; }
.pdata .v { font-size: 14.5px; font-weight: 800; margin-top: 1px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pdata .v.gold { color: var(--gold); }
.pdata .v.pink { color: #f9a8d4; }

.plink { display: flex; gap: 8px; align-items: stretch; }
.plink .input { flex: 1; font-size: 12px; padding: 8px 11px; color: #b8e0c8; }
.plink .btn { padding: 8px 14px; font-size: 12.5px; border-radius: 10px; }
.perr { font-size: 12px; color: #f87171; background: rgba(239, 68, 68, .08); border: 1px solid rgba(239, 68, 68, .22); border-radius: 9px; padding: 7px 10px; }

/* ---------- 历史列表 ---------- */
.history { display: flex; flex-direction: column; }
.hrow { display: flex; align-items: center; gap: 14px; padding: 12px 18px; cursor: pointer; transition: .15s; }
.hrow:hover { background: rgba(255, 255, 255, .04); }
.hrow + .hrow { border-top: 1px solid var(--line); }
.hrow .id { font-size: 12.5px; }
.hrow .when { font-size: 12px; color: var(--dim); white-space: nowrap; }

/* ---------- 管理后台 ---------- */
.admin-tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.atab { padding: 8px 18px; border-radius: 11px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); cursor: pointer; font-size: 13.5px; font-weight: 600; transition: .15s; }
.atab.on { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 4px 16px rgba(31, 122, 80, .4); }
.apane { display: none; }
.apane.on { display: block; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.stat { padding: 18px 20px; }
.stat .k { font-size: 12.5px; color: var(--muted); }
.stat .v { font-size: 26px; font-weight: 800; margin-top: 3px; font-variant-numeric: tabular-nums; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; padding: 11px 14px; color: var(--dim); font-weight: 600; font-size: 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: rgba(255, 255, 255, .03); }
.tbl .num { white-space: nowrap; }
.tbl-wrap { overflow-x: auto; }

.qrow { display: flex; align-items: center; gap: 12px; padding: 11px 16px; }
.qrow + .qrow { border-top: 1px solid var(--line); }
.qpos { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: rgba(212, 175, 55, .14); color: #e5c76b; flex: none; }

.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.settings-card { padding: 20px; }
.settings-card h4 { font-size: 14px; margin-bottom: 14px; font-weight: 700; }

/* ---------- 弹窗 / Toast ---------- */
.modal-mask { position: fixed; inset: 0; z-index: 100; background: rgba(4, 7, 17, .66); backdrop-filter: blur(6px); display: none; place-items: center; padding: 20px; }
.modal-mask.show { display: grid; }
.modal { width: 460px; max-width: 100%; max-height: 88vh; overflow-y: auto; padding: 26px; animation: pop .22s ease; }
.modal.wide { width: 640px; }
@keyframes pop { from { transform: scale(.94) translateY(8px); opacity: 0; } }
.modal h3 { font-size: 17px; font-weight: 800; margin-bottom: 4px; display: flex; align-items: center; gap: 9px; }
.modal .sub { color: var(--muted); font-size: 12.5px; margin-bottom: 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

.done-hero { text-align: center; padding: 8px 0 4px; }
.done-icon { width: 62px; height: 62px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; }
.done-icon.ok { background: rgba(34, 197, 94, .14); border: 1px solid rgba(34, 197, 94, .4); }
.done-icon.err { background: rgba(239, 68, 68, .13); border: 1px solid rgba(239, 68, 68, .4); }
.done-stats { display: flex; justify-content: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.done-stats .pill { font-size: 13px; padding: 7px 15px; }

#toasts { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.toast {
  padding: 13px 17px; border-radius: 13px; font-size: 13.5px;
  background: rgba(15, 20, 40, .92); border: 1px solid var(--line-2);
  box-shadow: var(--shadow); backdrop-filter: blur(14px);
  animation: slideIn .25s ease; display: flex; gap: 9px; align-items: flex-start;
}
.toast.ok { border-color: rgba(34, 197, 94, .45); }
.toast.err { border-color: rgba(239, 68, 68, .45); }
.toast .ic { flex: none; font-size: 15px; }
.toast .tx b { display: block; margin-bottom: 1px; }
.toast .tx span { color: var(--muted); font-size: 12.5px; }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } }
.toast.out { transition: .3s; opacity: 0; transform: translateX(30px); }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .submit-grid { grid-template-columns: 1fr; }
  .hero { padding: 24px 20px; }
  .topbar .pill.hide-m { display: none; }
}
@media (max-width: 520px) {
  .grid-products { grid-template-columns: 1fr; }
  .hstat { min-width: calc(50% - 6px); }
}
