/* ==========================================================================
   数智星云 API 商城 · 页面外壳
   顶栏（含整行弹出面板）· 底部控制条 · 页脚
   参考：阿里云云市场 / 聚合数据 / RapidAPI 的信息架构
   ========================================================================== */

/* ------------------------------------------------------------------ 顶栏 */
.topbar {
  height: 64px;
  display: flex; align-items: center; gap: 26px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 80;
}
.topbar .tb-inner { display: flex; align-items: center; gap: 26px; width: 100%; max-width: var(--maxw); margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: var(--r); flex: none;
  background: linear-gradient(140deg, var(--blue-400), var(--blue-600) 60%, var(--navy-700));
  display: grid; place-items: center; color: #fff;
}
.brand-text { line-height: 1.25; }
.brand-name { font-weight: 700; font-size: 15.5px; letter-spacing: -.01em; display: block; white-space: nowrap; }
.brand-sub { font-size: 10.5px; color: var(--ink-400); white-space: nowrap; }

.nav { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; }
.nav > a, .nav .navbtn {
  padding: 8px 13px; border-radius: var(--r-sm); font-size: 14px; font-weight: 500;
  color: var(--ink-700); white-space: nowrap; display: inline-flex; align-items: center; gap: 5px;
}
.nav > a:hover, .nav .navbtn:hover { background: var(--ice-100); color: var(--blue-600); }
.nav > a.active, .nav .navitem.active > .navbtn { color: var(--blue-600); font-weight: 640; }
.nav .navbtn .ic { transition: transform .18s; color: var(--ink-400); }
.nav .navitem.open .navbtn { background: var(--ice-100); color: var(--blue-600); }
.nav .navitem.open .navbtn .ic { transform: rotate(180deg); color: var(--blue-600); }
.navitem { position: static; }
.nav .nav-todo { cursor: default; opacity: .5; }

/* ------------------------------------------- 整行弹出面板（mega menu） */
.megapanel {
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(16, 24, 40, .12);
  display: none; z-index: 79;
}
.navitem.open .megapanel { display: block; }
.mp-inner { max-width: var(--maxw); margin: 0 auto; padding: 22px 24px 0; }
.mp-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; }
.mp-col h5 {
  font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-400); margin-bottom: 11px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line-2);
}
.mp-col a {
  display: flex; align-items: center; gap: 8px; padding: 7px 9px; margin: 0 -9px;
  border-radius: var(--r-sm); font-size: 13.5px; color: var(--ink-700);
}
.mp-col a:hover { background: var(--ice-100); color: var(--blue-600); }
.mp-col a .cnt { margin-left: auto; font-size: 11px; color: var(--ink-400); font-variant-numeric: tabular-nums; }
.mp-col a b { font-weight: 560; }
.mp-col a .sub { display: block; font-size: 11.5px; color: var(--ink-400); font-weight: 400; margin-top: 1px; }
.mp-foot {
  margin-top: 20px; padding: 14px 0 16px; border-top: 1px solid var(--line-2);
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.mp-foot .mp-all { font-size: 13.5px; font-weight: 600; color: var(--blue-600); display: inline-flex; align-items: center; gap: 6px; }
.mp-foot .mp-all:hover { text-decoration: underline; }
.mp-foot .spacer { flex: 1; }

/* ------------------------------------------------------ 顶栏右侧动作区 */
.top-actions { display: flex; align-items: center; gap: 9px; flex: none; }
.topbar .btn { font-size: 13.5px; }
.iconbtn {
  width: 34px; height: 34px; border-radius: var(--r-sm); display: grid; place-items: center;
  color: var(--ink-600); position: relative;
}
.iconbtn:hover { background: var(--ice-100); color: var(--blue-600); }
.iconbtn .dotbadge {
  position: absolute; top: 5px; right: 5px; min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: 100px; background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; display: grid; place-items: center; line-height: 1;
}

/* 账号下拉 */
.acct { position: relative; }
.acct > button {
  display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 5px;
  border: 1px solid var(--line); border-radius: 100px; background: var(--surface);
  font-size: 13px; color: var(--ink-800);
}
.acct > button:hover { border-color: var(--blue-300); }
.avatar {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: linear-gradient(140deg, var(--blue-400), var(--blue-600));
  color: #fff; display: grid; place-items: center; font-size: 11.5px; font-weight: 700;
}
.acct-menu {
  position: absolute; right: 0; top: calc(100% + 9px); min-width: 246px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: 0 16px 40px rgba(16, 24, 40, .14);
  padding: 7px; display: none; z-index: 90;
}
.acct.open .acct-menu { display: block; }
.acct-head { padding: 11px 12px 12px; border-bottom: 1px solid var(--line-2); margin-bottom: 6px; }
.acct-head b { font-size: 13.5px; display: block; }
.acct-head .meta { font-size: 11.5px; color: var(--ink-500); margin-top: 3px; }
.acct-menu a {
  display: flex; align-items: center; gap: 10px; padding: 8px 11px;
  border-radius: var(--r-sm); font-size: 13.5px; color: var(--ink-700);
}
.acct-menu a:hover { background: var(--ice-100); color: var(--blue-600); }
.acct-menu a .ic { color: var(--ink-400); }
.acct-menu hr { border: 0; border-top: 1px solid var(--line-2); margin: 6px 4px; }

/* 未登录 / 已登录 两种顶栏状态：由 JS 按登录态切换 */
body.logged-out .only-in { display: none !important; }
body.logged-in .only-out { display: none !important; }

/* ------------------------------------------------------- 底部控制条 */
.demobar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 12px; z-index: 210;
  display: flex; align-items: center; gap: 0;
  padding: 6px 8px; border-radius: 100px;
  background: rgba(11, 22, 38, .90); color: #C6D6E8;
  border: 1px solid rgba(255, 255, 255, .14);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .32);
  font-size: 11.5px; max-width: calc(100vw - 24px); overflow-x: auto;
}
.demobar .db-group { display: flex; align-items: center; gap: 3px; padding: 0 7px; }
.demobar .db-label { color: #7E97B2; padding-right: 5px; letter-spacing: .04em; white-space: nowrap; }
.demobar a {
  padding: 4px 10px; border-radius: 100px; color: #C6D6E8;
  border: 1px solid transparent; white-space: nowrap; cursor: pointer;
}
.demobar a:hover { background: rgba(255, 255, 255, .10); color: #fff; }
.demobar a.on { background: #2E8BFF; color: #fff; border-color: #2E8BFF; font-weight: 640; }
.demobar .db-sep { width: 1px; align-self: stretch; margin: 2px 5px; background: rgba(255, 255, 255, .14); }
.demobar .db-toggle { background: rgba(255, 255, 255, .10); }

/* ------------------------------------------------------------------ 页脚 */
.footer { background: var(--footer-bg); color: #93AAC4; padding: 46px 0 26px; margin-top: 0; }
.footer .f-top { display: grid; grid-template-columns: 1.5fr repeat(4, 1fr); gap: 30px; }
.footer h5 { color: #E4EEF9; font-size: 12.5px; margin-bottom: 12px; letter-spacing: .02em; }
.footer a { font-size: 12.5px; color: #93AAC4; display: block; padding: 3.5px 0; }
.footer a:hover { color: var(--blue-300); }
.footer .f-brand .brand-name { color: #fff; }
.footer .f-brand p { font-size: 12.5px; color: #7E97B2; margin-top: 12px; line-height: 1.75; max-width: 300px; }
.footer .f-brand .contacts { margin-top: 14px; font-size: 12.5px; color: #A9C0D8; }
.footer .f-brand .contacts b { color: #fff; font-size: 15px; font-variant-numeric: tabular-nums; }
.fl-todo { font-size: 12.5px; color: #6C86A3; display: block; padding: 3.5px 0; cursor: default; }

.footer .f-trust {
  margin-top: 30px; padding: 16px 0; border-top: 1px solid var(--line-dark-2);
  border-bottom: 1px solid var(--line-dark-2);
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap; font-size: 12px; color: #8FA8C4;
}
.footer .f-trust .tl { display: flex; align-items: center; gap: 7px; }
.footer .f-trust .ic { color: #6C86A3; }
.footer .f-bot {
  margin-top: 18px; display: flex; gap: 18px; align-items: flex-start;
  justify-content: space-between; font-size: 11.5px; color: #7A93AF; flex-wrap: wrap;
}
.footer .f-bot .discl { max-width: 760px; line-height: 1.7; }
.footer .parties { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.footer .party { display: flex; align-items: center; gap: 7px; font-size: 12px; color: #B4C8DE; }

/* --------------------------------------------------- 规格字段行（通用） */
.speclist { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1px;
  background: var(--line-2); border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; }
.specitem { background: var(--surface); padding: 12px 14px; }
.specitem .sk { font-size: 11.5px; color: var(--ink-500); display: flex; align-items: center; gap: 5px; }
.specitem .sv { font-size: 14px; font-weight: 620; color: var(--ink-900); margin-top: 4px; }
.specitem .sn { font-size: 11px; color: var(--ink-400); margin-top: 2px; }

/* 时效档位勾选矩阵（参考 Planet 定价表的 Recency 行） */
.recency { width: 100%; font-size: 12.5px; }
.recency th, .recency td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); text-align: center; }
.recency th:first-child, .recency td:first-child { text-align: left; }
.recency thead th { background: var(--surface-2); color: var(--ink-600); font-weight: 620; font-size: 11.5px; }
.recency .yes { color: var(--ok); }
.recency .no { color: var(--ink-300); }

@media (max-width: 1180px) {
  .mp-cols { grid-template-columns: repeat(2, 1fr); }
  .footer .f-top { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .nav { display: none; }
  .footer .f-top { grid-template-columns: 1fr; }
}

/* ==========================================================================
   认证页（登录 / 注册）
   ========================================================================== */
.authpg { display: grid; grid-template-columns: 1.05fr .95fr; min-height: calc(100vh - 64px); }
.ap-brand {
  position: relative; overflow: hidden; background: var(--navy-900); color: #E9F1FB;
  padding: 56px 52px; display: flex; flex-direction: column;
}
.ap-brand::before {
  content: ""; position: absolute; inset: 0;
  background-image: url("img/earth-orbit.jpg"); background-size: cover;
  background-position: 60% 45%; opacity: .30;
}
.ap-brand::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(14,44,82,.90) 0%, rgba(14,44,82,.60) 55%, rgba(14,44,82,.95) 100%);
}
.ap-brand > * { position: relative; z-index: 1; }
.ap-brand h2 { color: #fff; font-size: 27px; line-height: 1.35; margin-top: 22px; max-width: 430px; }
.ap-brand p.lead { color: #B6CBE2; font-size: 14px; margin-top: 14px; max-width: 430px; line-height: 1.78; }
.ap-list { display: flex; flex-direction: column; gap: 13px; margin-top: auto; }
.ap-list .li { display: flex; gap: 11px; align-items: flex-start; }
.ap-list .li .ic { color: #7FB2E8; margin-top: 2px; flex: none; }
.ap-list .li b { color: #fff; display: block; font-size: 13.5px; }
.ap-list .li .d { color: #93AAC4; font-size: 12.5px; }

.ap-form { display: grid; place-items: center; padding: 40px 24px; background: var(--bg); }
.ap-card { width: 100%; max-width: 400px; }
.ap-card h1 { font-size: 24px; }
.ap-card .sub { color: var(--ink-600); font-size: 13.5px; margin-top: 8px; }
.ap-field { margin-top: 16px; }
.ap-field label { display: block; font-size: 12.5px; color: var(--ink-600); margin-bottom: 7px; }
.ap-input {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--r);
  font-size: 14px; background: var(--surface); color: var(--ink-800);
}
.ap-input:focus { border-color: var(--blue-400); outline: none; box-shadow: 0 0 0 3px rgba(26,78,156,.12); }
.ap-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 15px; font-size: 12.5px; }
.ap-row a { color: var(--blue-600); }
.ap-seg { display: flex; gap: 8px; }
.ap-seg label {
  flex: 1; text-align: center; padding: 10px; border: 1px solid var(--line);
  border-radius: var(--r); font-size: 13px; cursor: pointer; color: var(--ink-700); margin: 0;
}
.ap-seg input { display: none; }
.ap-seg label.on { border-color: var(--blue-400); background: var(--ice-100); color: var(--blue-600); font-weight: 640; }
.ap-steps { display: flex; align-items: center; gap: 8px; margin-bottom: 24px; }
.ap-steps .s { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-400); }
.ap-steps .s i {
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; font-style: normal;
  background: var(--ice-100); color: var(--ink-500);
}
.ap-steps .s.on { color: var(--blue-600); }
.ap-steps .s.on i { background: var(--blue-600); color: #fff; }
.ap-steps .sp { flex: 1; height: 1px; background: var(--line); }

/* ==========================================================================
   控制台外壳（侧栏 + 主区）
   ========================================================================== */
.cshell { display: grid; grid-template-columns: 232px 1fr; gap: 18px; align-items: start; }
.cside { position: sticky; top: 82px; }
.cside .card { overflow: hidden; }
.cside .me { padding: 16px; border-bottom: 1px solid var(--line-2); display: flex; gap: 11px; align-items: center; }
.cside .me .avatar { width: 38px; height: 38px; font-size: 14px; }
.cside .me b { font-size: 14px; display: block; }
.cside .me .meta { font-size: 11.5px; color: var(--ink-500); margin-top: 2px; }
.cside nav { padding: 8px; }
.cside nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px;
  border-radius: var(--r-sm); font-size: 13.5px; color: var(--ink-700);
}
.cside nav a:hover { background: var(--ice-100); color: var(--blue-600); }
.cside nav a.active { background: var(--ice-100); color: var(--blue-600); font-weight: 640; }
.cside nav a .ic { color: var(--ink-400); }
.cside nav a.active .ic { color: var(--blue-600); }
.cside nav a .cnt {
  margin-left: auto; font-size: 11px; font-weight: 640; color: #fff;
  background: var(--danger); border-radius: 100px; padding: 1px 6px; min-width: 18px; text-align: center;
}
.cside nav .grp {
  font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-400); padding: 13px 11px 5px;
}

/* 登录引导（未登录态） */
.gate {
  min-height: 470px; display: grid; place-items: center; text-align: center;
  border: 1px dashed var(--line); border-radius: var(--r-lg); background: var(--surface);
  padding: 40px 24px;
}
.gate .gi {
  width: 54px; height: 54px; border-radius: 16px; margin: 0 auto 18px;
  background: var(--ice-100); color: var(--blue-600); display: grid; place-items: center;
}
.gate h2 { font-size: 20px; }
.gate p { color: var(--ink-600); font-size: 13.5px; margin-top: 10px; max-width: 440px; }
.gate .btns { display: flex; gap: 10px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }

/* 待办条目 */
.todo { display: flex; align-items: flex-start; gap: 11px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.todo:last-child { border-bottom: 0; }
.todo .ti {
  width: 32px; height: 32px; border-radius: var(--r-sm); flex: none;
  display: grid; place-items: center; background: var(--warn-bg); color: #A9761A;
}
.todo .ti.ok { background: var(--ok-bg); color: #2E8249; }
.todo .ti.info { background: var(--info-bg); color: var(--blue-600); }
.todo b { font-size: 13px; display: block; }
.todo .d { font-size: 12px; color: var(--ink-500); }

/* 应用卡（应用 → 订阅 → 密钥 三层结构） */
.appcard { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.appcard .ah { padding: 15px 17px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 11px; }
.appcard .ah .ai {
  width: 34px; height: 34px; border-radius: var(--r); flex: none;
  background: var(--ice-100); color: var(--blue-600); display: grid; place-items: center;
}
.appcard .ah b { font-size: 14px; }
.appcard .ah .meta { font-size: 11.5px; color: var(--ink-500); margin-top: 2px; }
.appcard .ab { padding: 14px 17px; }
.appcard .layers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.appcard .ly { padding: 11px 13px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line-2); }
.appcard .ly .k { font-size: 11.5px; color: var(--ink-500); display: flex; align-items: center; gap: 5px; }
.appcard .ly .v { font-size: 17px; font-weight: 700; color: var(--ink-900); margin-top: 4px; font-variant-numeric: tabular-nums; }
.appcard .ly .v small { font-size: 11.5px; font-weight: 500; color: var(--ink-500); }
.keyrow { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 12.5px; border-bottom: 1px solid var(--line-2); }
.keyrow:last-child { border-bottom: 0; }
.keyrow .kn { font-family: "JetBrains Mono", Consolas, monospace; color: var(--ink-700); }

/* ==========================================================================
   FAQ（details / summary）
   ========================================================================== */
.faq { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.faq details { border-bottom: 1px solid var(--line-2); }
.faq details:last-child { border-bottom: 0; }
.faq summary {
  padding: 15px 18px; cursor: pointer; font-size: 14px; font-weight: 560; color: var(--ink-800);
  display: flex; align-items: center; gap: 10px; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; margin-left: auto; color: var(--ink-400); font-size: 18px; font-weight: 400; }
.faq details[open] summary::after { content: "\2013"; }
.faq details[open] summary { color: var(--blue-600); }
.faq .fb { padding: 0 18px 17px 46px; font-size: 13px; color: var(--ink-600); line-height: 1.78; }

/* ==========================================================================
   计价估算器
   ========================================================================== */
.est { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.est .field { margin-bottom: 18px; }
.est .field label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12.5px; color: var(--ink-600); margin-bottom: 9px;
}
.est .field label b { color: var(--blue-600); font-size: 14px; font-variant-numeric: tabular-nums; }
.est input[type=range] { width: 100%; accent-color: var(--blue-600); }
.est-out { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.est-out .big { font-size: 30px; font-weight: 700; color: var(--blue-600); font-variant-numeric: tabular-nums; }
.est-out .big small { font-size: 13px; font-weight: 500; color: var(--ink-500); margin-left: 5px; }
.est-lines { margin-top: 16px; }
.est-lines .l { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.est-lines .l:last-child { border-bottom: 0; }
.est-lines .l b { font-variant-numeric: tabular-nums; }

@media (max-width: 1080px) {
  .authpg { grid-template-columns: 1fr; }
  .ap-brand { display: none; }
  .cshell { grid-template-columns: 1fr; }
  .cside { position: static; }
  .est { grid-template-columns: 1fr; }
}
