/* 宇霖AI·数字名片 —— 设计系统
   与「宇霖科技官网」同一套视觉语言（深空指挥舱）：深底 #05070f / 青 #22d3ee / 紫 #8b7cf6。
   换肤约定：类名与旧版完全一致，落地页 / 模板库 / 后台三处自动同步，改这一处即全站生效。 */
:root {
  /* 深空底 */
  --bg: #05070f;
  --bg-2: #0a0f1e;
  --panel: rgba(13, 20, 38, .72);
  --panel-2: rgba(19, 28, 50, .72);
  --panel-solid: #0d1426;
  --line: rgba(64, 156, 255, .16);
  --line-2: rgba(64, 156, 255, .32);

  /* 光色 */
  --cyan: #22d3ee;
  --cyan-dim: rgba(34, 211, 238, .12);
  --violet: #8b7cf6;
  --violet-dim: rgba(139, 124, 246, .12);
  --amber: #f5a524;
  --amber-dim: rgba(245, 165, 36, .12);

  /* 文字 */
  --text: #e6f0ff;
  --text-dim: #8fa3c4;
  --text-dim2: #64789a;

  /* 兼容旧类名的语义变量 */
  --brand: #22d3ee;
  --brand-dark: #0ea5c4;
  --ink: #e6f0ff;
  --ink-2: #b9c9e2;
  --ink-3: #8fa3c4;
  --card: var(--panel);
  --ok: #34d399;
  --warn: #f5a524;
  --gold: #f5a524;
  --radius: 16px;
  --shadow: 0 12px 38px rgba(0, 0, 0, .5);
  --glow: 0 0 26px rgba(34, 211, 238, .26);

  --font-disp: 'Orbitron', 'Noto Sans SC', -apple-system, sans-serif;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background:
    radial-gradient(1100px 620px at 82% -8%, rgba(139, 124, 246, .16), transparent 62%),
    radial-gradient(900px 540px at 8% 4%, rgba(34, 211, 238, .12), transparent 58%),
    linear-gradient(180deg, var(--bg), var(--bg-2) 70%, var(--bg));
  background-attachment: fixed;
  color: var(--text);
  font-size: 15px; line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
::selection { background: var(--cyan); color: #04121a; }
/* 轻扫描线质感（与官网一致，很淡） */
body::after {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .5;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(120, 180, 255, .015) 3px 4px);
}
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 18px; position: relative; z-index: 2; }
.wrap-sm { max-width: 760px; }
.hide { display: none !important; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(5, 7, 15, .82); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { display: flex; align-items: center; gap: 14px; height: 62px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .3px; color: var(--text); }
.logo-mark {
  width: 30px; height: 30px; border-radius: 8px; flex: 0 0 30px;
  background: conic-gradient(from 210deg, var(--cyan), var(--violet), var(--cyan));
  color: #04121a; display: grid; place-items: center; font-size: 15px; font-weight: 800;
  box-shadow: var(--glow);
}
.logo small { display: block; font-size: 11px; color: var(--text-dim); font-weight: 500; letter-spacing: 1px; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a { padding: 7px 13px; border-radius: 9px; color: var(--text-dim); font-size: 14px; transition: .22s; }
.nav a:hover { color: var(--text); background: var(--cyan-dim); }
.nav a.act { color: var(--cyan); font-weight: 600; background: var(--cyan-dim); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 20px; border-radius: 11px; border: 1px solid transparent;
  background: linear-gradient(120deg, var(--cyan), #55e6ff); color: #04121a;
  font-weight: 700; cursor: pointer; transition: .22s; white-space: nowrap;
  box-shadow: 0 0 22px rgba(34, 211, 238, .3);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 0 34px rgba(34, 211, 238, .5); }
.btn:active { transform: none; }
.btn.ghost { background: rgba(255, 255, 255, .04); color: var(--text); border-color: var(--line-2); box-shadow: none; }
.btn.ghost:hover { background: var(--cyan-dim); border-color: var(--cyan); color: var(--cyan); }
.btn.dark { background: #0b1120; border-color: var(--line-2); color: var(--text); box-shadow: none; }
.btn.dark:hover { border-color: var(--cyan); }
.btn.sm { padding: 7px 13px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.green { background: linear-gradient(120deg, #34d399, #6ee7b7); }
.btn.green:hover { box-shadow: 0 0 30px rgba(52, 211, 153, .45); }

/* ---------- 面板 / 区块 ---------- */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  backdrop-filter: blur(10px);
}
.pad { padding: 20px; }
.pad-lg { padding: 28px; }
.sec-title { display: flex; align-items: baseline; gap: 10px; margin: 0 0 14px; flex-wrap: wrap; }
.sec-title h2 { margin: 0; font-size: 18px; letter-spacing: .6px; }
.sec-title h2::before { content: ''; display: inline-block; width: 3px; height: 15px; border-radius: 2px; background: linear-gradient(180deg, var(--cyan), var(--violet)); margin-right: 9px; vertical-align: -2px; }
.sec-title span { color: var(--text-dim); font-size: 13px; }
.kicker { font-family: var(--font-disp); font-size: 11px; letter-spacing: 5px; color: var(--violet); text-transform: uppercase; }
.muted { color: var(--text-dim); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.mt { margin-top: 16px; } .mt-lg { margin-top: 30px; } .mb { margin-bottom: 16px; }
.row { display: flex; gap: 12px; } .row.wrap { flex-wrap: wrap; }
.center { text-align: center; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- 徽章 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600;
  background: rgba(255, 255, 255, .07); color: var(--ink-2); border: 1px solid var(--line);
}
.badge.brand { background: var(--cyan-dim); color: var(--cyan); border-color: rgba(34, 211, 238, .3); }
.badge.gold { background: var(--amber-dim); color: var(--amber); border-color: rgba(245, 165, 36, .3); }
.badge.ok { background: rgba(52, 211, 153, .12); color: var(--ok); border-color: rgba(52, 211, 153, .28); }
.badge.warn { background: var(--amber-dim); color: var(--amber); border-color: rgba(245, 165, 36, .3); }
.badge.dark { background: rgba(139, 124, 246, .14); color: #c7bfff; border-color: rgba(139, 124, 246, .3); }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field .hint { font-size: 12px; color: var(--text-dim); margin-top: 5px; }
input[type=text], input[type=tel], input[type=password], select, textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px;
  background: rgba(4, 8, 18, .6); color: var(--text); outline: none; transition: .18s;
}
input::placeholder, textarea::placeholder { color: var(--text-dim2); }
input:focus, select:focus, textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-dim); }
select option { background: var(--panel-solid); color: var(--text); }
textarea { resize: vertical; min-height: 86px; line-height: 1.6; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 13px; border-radius: 20px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04);
  font-size: 13px; cursor: pointer; transition: .18s; color: var(--text-dim); white-space: nowrap;
}
.chip:hover { border-color: var(--line-2); color: var(--text); }
.chip.on { background: var(--cyan-dim); border-color: var(--cyan); color: var(--cyan); font-weight: 600; }
.chip.on.soft { background: var(--cyan-dim); color: var(--cyan); border-color: rgba(34, 211, 238, .35); }
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.switch i {
  width: 44px; height: 25px; border-radius: 20px; background: rgba(255, 255, 255, .14); position: relative; transition: .2s; flex: 0 0 44px;
}
.switch i::after {
  content: ''; position: absolute; top: 2.5px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.switch.on i { background: var(--ok); box-shadow: 0 0 16px rgba(52, 211, 153, .4); }
.switch.on i::after { left: 21px; }

/* ---------- 表格 ---------- */
table.tb { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tb th { text-align: left; font-size: 12px; color: var(--text-dim); font-weight: 600; padding: 9px 10px; border-bottom: 1px solid var(--line); letter-spacing: .5px; }
table.tb td { padding: 11px 10px; border-bottom: 1px solid rgba(64, 156, 255, .09); vertical-align: top; }
table.tb tr:last-child td { border-bottom: 0; }

/* ---------- 提示条 ---------- */
.note {
  padding: 12px 14px; border-radius: 11px; font-size: 13px; line-height: 1.65;
  background: rgba(255, 255, 255, .04); color: var(--ink-2); border-left: 3px solid var(--line-2);
}
.note.warn { background: var(--amber-dim); border-left-color: var(--amber); }
.note.ok { background: rgba(52, 211, 153, .1); border-left-color: var(--ok); }
.note.brand { background: var(--cyan-dim); border-left-color: var(--cyan); }

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 40px; transform: translate(-50%, 20px);
  background: rgba(6, 12, 24, .96); color: var(--text); padding: 11px 20px; border-radius: 30px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 999;
  max-width: 86vw; text-align: center; border: 1px solid var(--line-2); box-shadow: var(--glow);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 后台布局 ---------- */
.admin { display: grid; grid-template-columns: 214px 1fr; gap: 20px; padding: 22px 0 70px; }
.side { position: sticky; top: 84px; align-self: start; }
.side a {
  display: flex; align-items: center; gap: 9px; padding: 10px 13px; border-radius: 10px;
  color: var(--text-dim); font-size: 14px; margin-bottom: 3px; cursor: pointer; transition: .18s;
  border: 1px solid transparent;
}
.side a:hover { background: rgba(255, 255, 255, .04); color: var(--text); }
.side a.act { background: var(--cyan-dim); color: var(--cyan); font-weight: 600; border-color: rgba(34, 211, 238, .28); }
.side a .ic { width: 20px; text-align: center; }
.panel { display: none; }
.panel.act { display: block; animation: fade .24s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px; backdrop-filter: blur(10px); }
.stat b { display: block; font-size: 24px; letter-spacing: -.3px; line-height: 1.2; color: var(--cyan); text-shadow: 0 0 20px rgba(34, 211, 238, .35); font-family: var(--font-disp); }
.stat span { font-size: 12px; color: var(--text-dim); }

/* ---------- 对话框（后台 AI 助理 / 预览） ---------- */
.chat {
  display: flex; flex-direction: column; gap: 12px; max-height: 460px; overflow-y: auto; padding: 4px;
  scrollbar-width: thin;
}
.chat::-webkit-scrollbar { width: 6px; }
.chat::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 6px; }
.msg { max-width: 84%; padding: 11px 15px; border-radius: 14px; font-size: 14px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.msg.me { align-self: flex-end; background: linear-gradient(120deg, var(--cyan), #4dd8f0); color: #04121a; border-bottom-right-radius: 5px; font-weight: 500; }
.msg.ai { align-self: flex-start; background: rgba(255, 255, 255, .06); color: var(--text); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.msg.sys { align-self: center; background: transparent; color: var(--text-dim); font-size: 12px; }
.typing i { display: inline-block; width: 5px; height: 5px; margin: 0 1px; border-radius: 50%; background: var(--cyan); animation: bl 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes bl { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }

/* ---------- 加载骨架 ---------- */
.skeleton { padding: 44px 20px; text-align: center; color: var(--text-dim); }
.skeleton .sp {
  width: 30px; height: 30px; margin: 0 auto 12px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .12); border-top-color: var(--cyan); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 通用小组件 ---------- */
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; padding: 8px 0; border-bottom: 1px dashed rgba(64, 156, 255, .14); }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--text-dim); }
.bar { height: 8px; border-radius: 6px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--cyan), var(--violet)); box-shadow: 0 0 14px rgba(34, 211, 238, .4); }
.kbd { background: rgba(255, 255, 255, .07); border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; font-size: 12px; color: var(--cyan); }
.foot { padding: 34px 0; color: var(--text-dim2); font-size: 13px; border-top: 1px solid var(--line); margin-top: 40px; }
.foot a { color: var(--text-dim); }
.foot a:hover { color: var(--cyan); }

/* ---------- 弹窗（模板预览等） ---------- */
.modal { position: fixed; inset: 0; z-index: 200; background: rgba(3, 6, 14, .82); backdrop-filter: blur(6px); display: none; align-items: center; justify-content: center; padding: 18px; }
.modal.show { display: flex; }
.modal .box {
  width: 100%; max-width: 940px; max-height: 92vh; overflow: hidden; display: flex; flex-direction: column;
  background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.modal .m-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal .m-head b { font-size: 15px; }
.modal .m-head .x { margin-left: auto; background: transparent; border: 0; color: var(--text-dim); font-size: 22px; cursor: pointer; line-height: 1; }
.modal .m-head .x:hover { color: var(--text); }
.modal .m-body { padding: 16px 18px 20px; overflow: auto; }
.pv-wrap { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }
.pv-frame { width: 100%; height: 560px; border: 1px solid var(--line); border-radius: 14px; background: #0b1120; }
@media (max-width: 820px) { .pv-wrap { grid-template-columns: 1fr; } .pv-frame { height: 480px; } }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .g3, .g4 { grid-template-columns: repeat(2, 1fr); }
  .admin { grid-template-columns: 1fr; }
  .side { position: static; display: flex; overflow-x: auto; gap: 6px; padding-bottom: 6px; }
  .side a { margin: 0; white-space: nowrap; }
}
@media (max-width: 560px) {
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .pad-lg { padding: 20px; }
  .wrap { padding: 0 14px; }
  body { font-size: 14.5px; }
  .nav a { padding: 7px 9px; font-size: 13px; }
}
