/*!
 * IDCGo 应用中心 — 全站样式（一份 CSS 覆盖前台商店 / 用户中心 / 管理后台）
 *
 * 设计口径：
 *  · 主色 #1a6dff（与 IDCGo 主站主题的经典蓝一致），强调色 #ffb020；
 *  · 卡片化布局 + 圆角 12px + 浅阴影，与参考站（智简魔方应用商店）观感一致；
 *  · 所有颜色走 CSS 变量，后台改主题时只需覆盖 :root；
 *  · 不引外部字体与图标库：图标用内联 SVG symbol（见 layout 里的 sprite），
 *    这样授权中心可以在完全离线的内网环境里跑起来。
 */

:root {
  --brand: #1a6dff;
  --brand-dark: #0f52cc;
  --brand-light: #eaf1ff;
  --brand-shadow: rgba(26, 109, 255, 0.28);
  --amber: #ffb020;
  --green: #12b76a;
  --green-light: #e7f8f0;
  --red: #f04438;
  --red-light: #feeceb;
  --ink: #1e293b;
  --muted: #6b7a90;
  --line: #e6ebf2;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --r: 12px;
  --r-sm: 8px;
  --shadow: 0 2px 10px rgba(24, 44, 80, 0.06);
  --shadow-lg: 0 12px 32px rgba(24, 44, 80, 0.12);
  --max: 1200px;
}

* { box-sizing: border-box; }

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

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
img { max-width: 100%; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: 720px; margin: 0 auto; padding: 0 20px; }

/* ==================== 顶栏 ==================== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(24, 44, 80, 0.04);
}

.topbar-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.logo { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; color: var(--ink); }
.logo:hover { color: var(--ink); }
.logo-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), #4d92ff);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 15px; font-weight: 700;
  box-shadow: 0 4px 12px var(--brand-shadow);
}
.logo small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); line-height: 1; }

.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
  padding: 8px 14px; border-radius: var(--r-sm);
  color: var(--muted); font-weight: 500;
}
.nav a:hover { background: var(--brand-light); color: var(--brand); }
.nav a.on { color: var(--brand); background: var(--brand-light); font-weight: 600; }

.topbar-right { display: flex; align-items: center; gap: 10px; }

/* ==================== 按钮 ==================== */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: all .15s ease; font-family: inherit;
}
.btn:hover { border-color: #c9d6e8; background: #fbfcfe; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 12px var(--brand-shadow); }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-amber { background: var(--amber); border-color: var(--amber); color: #4a3200; }
.btn-amber:hover { background: #f0a30f; border-color: #f0a30f; color: #4a3200; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #d92d20; border-color: #d92d20; color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--brand-light); color: var(--brand); }
.btn-sm { padding: 5px 11px; font-size: 13px; }
.btn-lg { padding: 12px 26px; font-size: 15px; font-weight: 600; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.btn-block { width: 100%; }

/* ==================== 卡片与网格 ==================== */

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow);
}
.card-pad { padding: 20px; }
.card + .card { margin-top: 16px; }
.card-head {
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-head h2, .card-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.card-head .sub { color: var(--muted); font-size: 13px; font-weight: 400; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-apps { grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); }

@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .topbar-inner { gap: 14px; height: auto; padding: 10px 16px; flex-wrap: wrap; }
  .nav { order: 3; width: 100%; overflow-x: auto; }
}

/* ==================== 应用卡片 ==================== */

.app-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 12px;
  transition: all .18s ease;
}
.app-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: #d7e3f5; }

.app-card-top { display: flex; gap: 12px; align-items: flex-start; }
.app-icon {
  width: 48px; height: 48px; border-radius: 12px; flex: 0 0 48px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand-light), #dbe9ff);
  color: var(--brand); font-size: 20px;
}
.app-icon.theme { background: linear-gradient(135deg, #fff2dd, #ffe0b0); color: #b26a00; }
.app-card-title { font-size: 15px; font-weight: 600; margin: 0 0 2px; }
.app-card-title a { color: var(--ink); }
.app-card-title a:hover { color: var(--brand); }
.app-card-meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.app-card-summary { color: var(--muted); font-size: 13px; flex: 1; min-height: 40px; }

.app-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px dashed var(--line); }
.price { font-size: 17px; font-weight: 700; color: var(--red); }
.price.free { color: var(--green); font-size: 15px; }
.price small { font-size: 12px; font-weight: 400; color: var(--muted); }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 20px; font-size: 12px; font-weight: 500;
  background: var(--brand-light); color: var(--brand);
}
.badge-amber { background: #fff5e0; color: #b26a00; }
.badge-green { background: var(--green-light); color: #07783f; }
.badge-red { background: var(--red-light); color: #b42318; }
.badge-gray { background: #f1f4f9; color: var(--muted); }
.badge-lg { font-size: 12px; padding: 4px 12px; }

/* ==================== 首页 hero ==================== */

.hero {
  background: linear-gradient(120deg, #eef4ff 0%, #f8fbff 55%, #fff7ea 100%);
  border-bottom: 1px solid var(--line);
  padding: 52px 0 44px;
}
.hero h1 { margin: 0 0 12px; font-size: 30px; font-weight: 700; letter-spacing: -.3px; }
.hero p { margin: 0 0 22px; color: var(--muted); font-size: 15px; max-width: 640px; }
.hero-stats { display: flex; gap: 34px; flex-wrap: wrap; margin-top: 26px; }
.hero-stat b { display: block; font-size: 22px; font-weight: 700; color: var(--brand); line-height: 1.2; }
.hero-stat span { font-size: 13px; color: var(--muted); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ==================== 工具条 / 筛选 ==================== */

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 18px 0; }
.toolbar .spacer { flex: 1; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 6px 14px; border-radius: 20px; border: 1px solid var(--line);
  background: var(--surface); color: var(--muted); font-size: 13px; cursor: pointer;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 500; }
.chip .count { opacity: .7; margin-left: 4px; font-size: 12px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 500; color: #334155; }
.field .hint { font-size: 12px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: var(--r-sm); font-size: 14px; font-family: inherit;
  background: var(--surface); color: var(--ink); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.7; }
.input-sm { padding: 6px 10px; font-size: 13px; }

.search { display: flex; gap: 8px; align-items: center; }
.search .input { width: 240px; }

/* ==================== 表格 ==================== */

.table-wrap { overflow-x: auto; }
table.tb { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tb th, table.tb td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.tb th { background: #fafbfd; color: var(--muted); font-weight: 500; font-size: 12px; white-space: nowrap; }
table.tb tr:hover td { background: #fbfcfe; }
table.tb td.num, table.tb th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tb .nowrap { white-space: nowrap; }
table.tb .actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ==================== 统计块 ==================== */

.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px 18px; box-shadow: var(--shadow);
}
.stat .label { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.stat .value { font-size: 24px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat .value.brand { color: var(--brand); }
.stat .value.green { color: var(--green); }
.stat .value.red { color: var(--red); }
.stat .foot { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ==================== 提示条 ==================== */

.alert {
  padding: 12px 16px; border-radius: var(--r-sm); margin-bottom: 16px;
  border: 1px solid transparent; font-size: 13px;
}
.alert-ok { background: var(--green-light); border-color: #b7e7cd; color: #07783f; }
.alert-error { background: var(--red-light); border-color: #fbc9c4; color: #b42318; }
.alert-info { background: var(--brand-light); border-color: #c8dbff; color: var(--brand-dark); }
.alert-warn { background: #fff8e6; border-color: #ffe2a8; color: #8a5a00; }
.alert b { font-weight: 600; }

.empty { text-align: center; padding: 54px 20px; color: var(--muted); }
.empty .big { font-size: 34px; margin-bottom: 10px; opacity: .5; }

/* ==================== 详情页 ==================== */

.detail-head {
  background: var(--surface); border-bottom: 1px solid var(--line);
  padding: 28px 0;
}
.detail-head-inner { display: flex; gap: 22px; align-items: flex-start; }
.detail-icon {
  width: 76px; height: 76px; border-radius: 18px; flex: 0 0 76px;
  display: flex; align-items: center; justify-content: center; font-size: 30px;
  background: linear-gradient(135deg, var(--brand-light), #dbe9ff); color: var(--brand);
}
.detail-icon.theme { background: linear-gradient(135deg, #fff2dd, #ffe0b0); color: #b26a00; }
.detail-title { font-size: 24px; font-weight: 700; margin: 0 0 6px; }
.detail-sub { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.detail-tags { display: flex; gap: 8px; flex-wrap: wrap; }

.buy-box {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 20px; box-shadow: var(--shadow);
  position: sticky; top: 84px;
}
.buy-price { font-size: 28px; font-weight: 700; color: var(--red); line-height: 1.1; }
.buy-price.free { color: var(--green); }
.buy-price small { font-size: 13px; color: var(--muted); font-weight: 400; }
.buy-list { margin: 16px 0; padding: 0; list-style: none; font-size: 13px; }
.buy-list li { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--line); color: var(--muted); }
.buy-list li b { color: var(--ink); font-weight: 500; }
.buy-list li:last-child { border-bottom: none; }

.prose { font-size: 14px; line-height: 1.85; color: #334155; white-space: pre-wrap; word-break: break-word; }

.ver-item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.ver-item:last-child { border-bottom: none; }
.ver-no { font-weight: 600; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
.ver-body { flex: 1; font-size: 13px; color: var(--muted); white-space: pre-wrap; }

/* ==================== 布局：侧栏 + 内容 ==================== */

.shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); gap: 20px; padding: 24px 0 60px; }
@media (max-width: 900px) { .shell { grid-template-columns: 1fr; } }

.side { display: flex; flex-direction: column; gap: 4px; }
.side-group { font-size: 12px; color: var(--muted); padding: 14px 12px 6px; font-weight: 500; }
.side a {
  padding: 9px 12px; border-radius: var(--r-sm); color: #475569; font-size: 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.side a:hover { background: var(--surface); color: var(--brand); }
.side a.on { background: var(--surface); color: var(--brand); font-weight: 600; box-shadow: var(--shadow); }
.side .count { font-size: 12px; color: var(--muted); background: #eef2f8; border-radius: 20px; padding: 1px 8px; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 20px; font-weight: 700; }
.page-head .desc { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* ==================== 表单栅格 ==================== */

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 760px) { .form-grid { grid-template-columns: 1fr; } }

.check { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.check-list { display: flex; flex-wrap: wrap; gap: 14px 20px; }

/* ==================== 授权码 ==================== */

.key {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px; background: #f4f7fc; border: 1px dashed #c8d8ee;
  border-radius: 6px; padding: 3px 8px; color: var(--brand-dark);
  word-break: break-all; cursor: copy;
}
.key-lg { font-size: 15px; padding: 8px 12px; display: inline-block; }

.secret-box {
  background: #fffbf0; border: 1px solid #ffe2a8; border-radius: var(--r-sm);
  padding: 14px 16px; margin: 12px 0;
}
.secret-box .row { display: flex; gap: 10px; align-items: center; margin: 6px 0; }
.secret-box .row b { min-width: 96px; color: #8a5a00; font-weight: 500; font-size: 13px; }
.secret-box code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px;
  background: #fff; padding: 4px 8px; border-radius: 5px; border: 1px solid #f0dcae;
  word-break: break-all; flex: 1;
}

/* ==================== 登录 / 注册 ==================== */

.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 20px; background: linear-gradient(140deg, #eef4ff, #f7faff 60%, #fff7ea); }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 34px 32px; }
.auth-card h1 { margin: 0 0 6px; font-size: 21px; }
.auth-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.auth-card .field { margin-bottom: 14px; }
.auth-foot { margin-top: 18px; text-align: center; font-size: 13px; color: var(--muted); }

/* ==================== 分页 ==================== */

.pager { display: flex; gap: 6px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }
.pager a, .pager span {
  min-width: 34px; height: 34px; padding: 0 10px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px;
}
.pager a:hover { border-color: var(--brand); color: var(--brand); }
.pager .on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.pager .off { opacity: .45; pointer-events: none; }

/* ==================== 页脚 ==================== */

.foot { border-top: 1px solid var(--line); background: var(--surface); padding: 26px 0; margin-top: auto; color: var(--muted); font-size: 13px; }
.foot-inner { max-width: var(--max); margin: 0 auto; padding: 0 20px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ==================== 步骤条（安装器） ==================== */

.steps { display: flex; gap: 10px; margin-bottom: 24px; }
.step { flex: 1; padding: 12px 14px; border-radius: var(--r-sm); background: #f1f5fb; color: var(--muted); font-size: 13px; }
.step.on { background: var(--brand-light); color: var(--brand); font-weight: 600; }

.check-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.check-row:last-child { border-bottom: none; }
.check-row .name { font-weight: 500; }
.check-row .val { color: var(--muted); font-size: 12px; word-break: break-all; text-align: right; max-width: 60%; }
.check-row .ok { color: var(--green); }
.check-row .no { color: var(--red); }

/* ==================== 杂项 ==================== */

.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.strong { font-weight: 600; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.center { text-align: center; }
.hidden { display: none; }

.section-title { font-size: 16px; font-weight: 600; margin: 26px 0 12px; display: flex; align-items: center; gap: 8px; }
.section-title::before { content: ''; width: 3px; height: 15px; border-radius: 2px; background: var(--brand); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs a { padding: 10px 16px; color: var(--muted); font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--brand); }
.tabs a.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

@media print { .topbar, .side, .foot, .btn { display: none !important; } }
