/* ==========================================================================
   AI 聚合中枢 · 科技风格样式基座
   设计语言：深空底 + 霓虹青/紫渐变 + 玻璃拟态 + 网格光晕
   零外部依赖：不引用任何 CDN，字体走系统中文无衬线栈（含 HarmonyOS Sans）
   ========================================================================== */

:root {
  --bg-0: #05070f;
  --bg-1: #080c18;
  --bg-2: #0d1424;
  --panel: rgba(18, 27, 48, .72);
  --panel-2: rgba(13, 20, 36, .86);
  --line: rgba(120, 200, 255, .16);
  --line-strong: rgba(120, 220, 255, .34);
  --cyan: #4fd8ff;
  --cyan-soft: #7fe9ff;
  --violet: #a97bff;
  --green: #3ddc97;
  --amber: #ffb86b;
  --red: #ff6b7d;
  --text: #dce7fb;
  --text-dim: #8fa2c4;
  --text-faint: #62748f;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 18px 44px rgba(0, 0, 0, .5);
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --sans: "HarmonyOS Sans SC", "Source Han Sans SC", "Noto Sans CJK SC",
          "PingFang SC", "Microsoft YaHei UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; min-height: 100%;
  background: var(--bg-0); color: var(--text);
  font-family: var(--sans); font-size: 14px; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* 背景：径向光晕 + 细网格，营造科技纵深感 */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(79, 216, 255, .17), transparent 62%),
    radial-gradient(760px 480px at 92% 4%, rgba(169, 123, 255, .15), transparent 60%),
    radial-gradient(700px 600px at 50% 108%, rgba(61, 220, 151, .09), transparent 64%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0) 60%);
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(rgba(120, 200, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 200, 255, .045) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 78%);
}

a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--cyan-soft); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: rgba(255, 255, 255, .02); }
::-webkit-scrollbar-thumb { background: rgba(120, 200, 255, .2); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: rgba(120, 200, 255, .34); }

/* ---------- 通用组件 ---------- */
.glass {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.grad-text {
  background: linear-gradient(100deg, var(--cyan) 0%, #9be9ff 42%, var(--violet) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid var(--line-strong); background: rgba(79, 216, 255, .08);
  color: var(--cyan-soft); font-family: inherit; font-size: 13px; font-weight: 500;
  transition: .18s ease; white-space: nowrap; user-select: none;
}
.btn:hover { background: rgba(79, 216, 255, .18); border-color: var(--cyan); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary {
  background: linear-gradient(100deg, rgba(79, 216, 255, .92), rgba(169, 123, 255, .92));
  border-color: transparent; color: #04101c; font-weight: 700;
}
.btn-primary:hover { filter: brightness(1.12); background: linear-gradient(100deg, #6fe2ff, #b98fff); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text-dim); }
.btn-ghost:hover { color: var(--cyan-soft); border-color: var(--line-strong); background: rgba(79, 216, 255, .06); }
.btn-danger { border-color: rgba(255, 107, 125, .45); color: var(--red); background: rgba(255, 107, 125, .08); }
.btn-danger:hover { background: rgba(255, 107, 125, .18); border-color: var(--red); }
.btn-warn { border-color: rgba(255, 184, 107, .45); color: var(--amber); background: rgba(255, 184, 107, .08); }
.btn-warn:hover { background: rgba(255, 184, 107, .18); }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-lg { padding: 11px 24px; font-size: 14.5px; }
.btn-block { width: 100%; }

input, select, textarea {
  width: 100%; padding: 9px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: rgba(6, 11, 22, .78);
  color: var(--text); font-family: inherit; font-size: 13.5px; outline: none;
  transition: .16s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--cyan); background: rgba(6, 11, 22, .96);
  box-shadow: 0 0 0 3px rgba(79, 216, 255, .13);
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
select { cursor: pointer; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--cyan) 50%),
                    linear-gradient(135deg, var(--cyan) 50%, transparent 50%);
  background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
select option { background: #0d1424; color: var(--text); }
textarea { resize: vertical; min-height: 76px; line-height: 1.6; }
label { display: block; font-size: 12.5px; color: var(--text-dim); margin-bottom: 5px; }

.field { margin-bottom: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 120px; }
.hidden { display: none !important; }
.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12px; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 12px; } .mt2 { margin-top: 20px; }
.mb { margin-bottom: 12px; } .mb2 { margin-bottom: 20px; }

.tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 20px;
  font-size: 11.5px; border: 1px solid var(--line); background: rgba(79, 216, 255, .07);
  color: var(--cyan-soft); white-space: nowrap;
}
.tag-green { border-color: rgba(61, 220, 151, .4); background: rgba(61, 220, 151, .1); color: var(--green); }
.tag-amber { border-color: rgba(255, 184, 107, .4); background: rgba(255, 184, 107, .1); color: var(--amber); }
.tag-red { border-color: rgba(255, 107, 125, .4); background: rgba(255, 107, 125, .1); color: var(--red); }
.tag-violet { border-color: rgba(169, 123, 255, .4); background: rgba(169, 123, 255, .1); color: var(--violet); }
.tag-gray { border-color: var(--line); background: rgba(255, 255, 255, .03); color: var(--text-faint); }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  text-align: left; padding: 9px 10px; font-weight: 500; font-size: 12px;
  color: var(--cyan-soft); background: rgba(79, 216, 255, .06);
  border-bottom: 1px solid var(--line-strong); white-space: nowrap;
}
table.tbl td { padding: 9px 10px; border-bottom: 1px solid rgba(120, 200, 255, .08); vertical-align: top; }
table.tbl tr:hover td { background: rgba(79, 216, 255, .04); }
table.tbl td.num { font-family: var(--mono); text-align: right; }

.empty { padding: 40px 16px; text-align: center; color: var(--text-faint); font-size: 13px; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 900; display: flex; align-items: center; justify-content: center;
  background: rgba(3, 6, 14, .78); backdrop-filter: blur(5px); padding: 16px;
  animation: fade .16s ease;
}
.modal {
  width: 100%; max-width: 520px; max-height: 88vh; overflow: auto;
  background: linear-gradient(170deg, rgba(21, 31, 54, .98), rgba(11, 17, 31, .99));
  border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: var(--shadow);
  animation: pop .2s cubic-bezier(.2, 1.1, .4, 1);
}
.modal.wide { max-width: 780px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 18px; border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 15.5px; font-weight: 600; color: #eaf4ff; }
.modal-body { padding: 18px; }
.modal-foot {
  display: flex; gap: 10px; justify-content: flex-end; padding: 13px 18px;
  border-top: 1px solid var(--line); background: rgba(0, 0, 0, .16);
}
.modal-x { cursor: pointer; color: var(--text-faint); font-size: 20px; line-height: 1; padding: 0 4px; }
.modal-x:hover { color: var(--red); }

@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97) } to { opacity: 1; transform: none } }

/* ---------- 轻提示 ---------- */
#toasts { position: fixed; top: 16px; right: 16px; z-index: 1200; display: flex; flex-direction: column; gap: 9px; max-width: 380px; }
.toast {
  padding: 11px 15px; border-radius: 11px; font-size: 13px; line-height: 1.5;
  border: 1px solid var(--line-strong); background: rgba(16, 25, 44, .97);
  box-shadow: var(--shadow); animation: slide .22s ease; word-break: break-word;
}
.toast-ok { border-color: rgba(61, 220, 151, .5); color: #b6f5d8; }
.toast-err { border-color: rgba(255, 107, 125, .5); color: #ffc6ce; }
.toast-warn { border-color: rgba(255, 184, 107, .5); color: #ffe0bd; }
.toast-info { border-color: rgba(79, 216, 255, .5); color: #c7edff; }
@keyframes slide { from { opacity: 0; transform: translateX(26px) } to { opacity: 1; transform: none } }

/* ---------- 加载动画 ---------- */
.spinner {
  width: 15px; height: 15px; border-radius: 50%; display: inline-block;
  border: 2px solid rgba(79, 216, 255, .25); border-top-color: var(--cyan);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }
.loading-bar {
  position: fixed; top: 0; left: 0; height: 2px; z-index: 1300; width: 0;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  box-shadow: 0 0 12px rgba(79, 216, 255, .8); transition: width .3s ease, opacity .3s;
}

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 0; font-size: 12.5px; }
.pager span { color: var(--text-faint); }

/* ---------- 响应式 ---------- */
@media (max-width: 760px) {
  .row { flex-direction: column; }
  .row > * { min-width: 0; }
  #toasts { left: 12px; right: 12px; max-width: none; }
  table.tbl { font-size: 12px; }
  table.tbl th, table.tbl td { padding: 7px 6px; }
}
