:root{
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei",sans-serif;
  color-scheme:light dark;
  --bg:#f6f3ea; --surface:#fffdf7; --surface-2:#f1ede1; --text:#21302a; --sub:#5d6b62;
  --line:#ded9c8; --accent:#1f5c46; --accent-strong:#174836; --soft:#e7efe9; --soft-2:#dce8df;
  --danger:#a13427; --warning:#7a5520; --focus:#287351; --adult:#7a3540; --adult-soft:#f3e5e7;
  background:var(--bg); color:var(--text); line-height:1.65;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;overflow-x:hidden}
button,input,select,textarea{font:inherit}
button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}
a{color:var(--accent);text-underline-offset:3px}
button{cursor:pointer;min-height:44px;padding:.55rem 1rem;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--text);font-weight:600;white-space:normal;text-align:center}
button:hover{background:var(--soft)}
button:disabled{cursor:wait;opacity:.6}
button.primary{background:var(--accent);color:#fff;border-color:var(--accent)}
button.primary:hover{background:var(--accent-strong)}
button.danger{color:var(--danger);border-color:var(--danger)}
button.quiet{border-color:transparent;background:transparent;padding-inline:.5rem}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid var(--focus);outline-offset:2px}
input,select,textarea{min-width:0;width:100%;min-height:46px;border:1px solid var(--line);border-radius:7px;background:var(--surface);color:var(--text);padding:.65rem .8rem}
input[type=checkbox]{width:20px;min-height:20px;height:20px;flex-shrink:0}
label{display:flex;flex-direction:column;gap:.45rem;font-size:.94rem;font-weight:600}
label.check{flex-direction:row;align-items:flex-start;gap:.65rem;font-weight:400;font-size:.95rem}
p{margin:0 0 1rem}
h1,h2,h3{line-height:1.3;letter-spacing:-.02em;margin:0}
h1{font-size:clamp(1.55rem,1.1rem+2.4vw,2.35rem);font-weight:750}
h2{font-size:clamp(1.25rem,1.05rem+1vw,1.7rem)}
h3{font-size:1.05rem;font-weight:700}
small,.muted{color:var(--sub);font-size:.875rem}
code,.mono{font-family:ui-monospace,"Cascadia Code",Consolas,monospace;font-size:.84rem;overflow-wrap:anywhere}
.loading{padding:3rem 1.25rem;max-width:760px;margin:auto}
.wrap{width:min(1120px,100%);margin:auto;padding-inline:clamp(1rem,4vw,2.5rem)}

/* ---- 模式横幅 ---- */
.modebar{background:var(--accent-strong);color:#f3f7f4;font-size:.85rem;text-align:center;padding:.5rem .9rem}
.modebar.preview{background:#6d4d1f}
.modebar strong{font-weight:750}
.modebar a{color:#fff}

/* ---- 顶部导航 ---- */
.sitehead{position:sticky;top:0;z-index:20;background:color-mix(in srgb,var(--bg) 92%,transparent);backdrop-filter:blur(8px);border-bottom:1px solid var(--line)}
.sitehead .wrap{display:flex;align-items:center;gap:1rem;padding-top:.7rem;padding-bottom:.7rem}
.brand{font-size:1.25rem;letter-spacing:.14em;font-weight:800;color:var(--text);text-decoration:none;white-space:nowrap}
.brand small{display:block;letter-spacing:.06em;font-weight:500;font-size:.7rem;color:var(--sub)}
.mainnav{display:flex;gap:.25rem;margin-left:auto;flex-wrap:wrap;justify-content:flex-end}
.mainnav a,.mainnav button{min-height:40px;display:inline-flex;align-items:center;border:0;background:transparent;color:var(--text);text-decoration:none;font-weight:600;font-size:.92rem;padding:.4rem .7rem;border-radius:7px}
.mainnav a:hover,.mainnav button:hover{background:var(--soft)}
.mainnav a[aria-current=page]{color:var(--accent);background:var(--soft)}
.navtoggle{display:none;margin-left:auto}

/* ---- 首页 ---- */
.hero{padding:clamp(2.6rem,6vw,5rem) 0 clamp(2rem,4vw,3.6rem)}
.hero .eyebrow{display:inline-block;font-size:.82rem;font-weight:700;letter-spacing:.12em;color:var(--accent);background:var(--soft);border:1px solid var(--soft-2);padding:.25rem .7rem;border-radius:999px;margin-bottom:1.1rem}
.hero p.lead{font-size:clamp(1rem,.95rem+.4vw,1.2rem);color:var(--sub);max-width:46rem;margin:1rem 0 1.6rem}
.hero .cta{display:flex;gap:.8rem;flex-wrap:wrap}
.hero .cta .primary{font-size:1.02rem;padding:.75rem 1.5rem}
.section{padding:clamp(2rem,4.5vw,3.4rem) 0}
.section:nth-child(even){background:var(--surface)}
.section h2{margin-bottom:.6rem}
.section .sub{color:var(--sub);max-width:48rem;margin-bottom:1.8rem}
.grid{display:grid;gap:1rem}
.grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}
.grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}
.card{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:1.35rem;min-width:0}
.section:nth-child(even) .card{background:var(--bg)}
.card h3{margin-bottom:.5rem}
.card p{margin-bottom:0;color:var(--sub);font-size:.93rem}
.card .icon{font-size:1.5rem;display:block;margin-bottom:.7rem}
.steps{counter-reset:step;display:grid;gap:1rem;grid-template-columns:repeat(3,minmax(0,1fr))}
.step{position:relative;padding-left:3.4rem}
.step::before{counter-increment:step;content:counter(step);position:absolute;left:0;top:1.15rem;width:2.2rem;height:2.2rem;border-radius:50%;background:var(--accent);color:#fff;display:grid;place-items:center;font-weight:800}
.step h3{margin-bottom:.4rem}
.step p{margin:0;color:var(--sub);font-size:.93rem}
.fineprint{border:1px dashed var(--line);border-radius:12px;padding:1.1rem 1.25rem;background:var(--surface-2);color:var(--sub);font-size:.9rem}
.fineprint p:last-child{margin:0}

/* ---- 模型广场 / 卡片 ---- */
.page{padding:clamp(1.6rem,4vw,2.6rem) 0 clamp(3rem,6vw,4.5rem)}
.pagehead{margin-bottom:1.6rem}
.pagehead h1{margin-bottom:.5rem}
.pagehead p{color:var(--sub);max-width:48rem;margin:0}
.toolbar{display:flex;gap:.8rem;flex-wrap:wrap;align-items:center;margin-bottom:1.4rem}
.toolbar .search{flex:1;min-width:min(100%,260px)}
.toolbar .spacer{margin-left:auto}
.models{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,290px),1fr));gap:1.1rem}
.model-card{display:flex;flex-direction:column;gap:.55rem;background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:1.3rem;min-width:0}
.model-card h3{overflow-wrap:anywhere}
.model-card .desc{color:var(--sub);font-size:.9rem;margin:0;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.model-card .price{font-variant-numeric:tabular-nums;font-size:.9rem;margin:0}
.badges{display:flex;gap:.4rem;flex-wrap:wrap}
.badge{display:inline-block;font-size:.74rem;font-weight:700;padding:.14rem .55rem;border-radius:999px;border:1px solid var(--line);color:var(--sub);background:var(--surface-2);white-space:nowrap}
.badge.usage-general{color:var(--accent);border-color:var(--soft-2);background:var(--soft)}
.badge.usage-roleplay{color:#6a4a12;border-color:#e6d6b8;background:#f6eedc}
.badge.usage-writing{color:#3f4f76;border-color:#d7dfee;background:#e9eef8}
.badge.adult{color:var(--adult);border-color:#e3c6cb;background:var(--adult-soft)}
.badge.demo{color:#7a3a00;border-color:#eccfa6;background:#fbeed7}
.model-card .cardfoot{margin-top:auto;padding-top:.7rem;display:flex;gap:.6rem;flex-wrap:wrap;align-items:center}
.empty{padding:2.8rem 1.2rem;border:1px dashed var(--line);border-radius:14px;background:var(--surface);text-align:center}
.empty p{margin:.6rem auto 0;max-width:30rem;color:var(--sub)}

/* ---- 模型详情 ---- */
.detail{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(240px,1fr);gap:1.4rem;align-items:start}
.panel{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:clamp(1.2rem,3vw,1.8rem);min-width:0}
.panel h2{margin-bottom:1rem}
.kv{display:grid;grid-template-columns:auto minmax(0,1fr);gap:.55rem 1rem;font-size:.93rem}
.kv dt{color:var(--sub)}
.kv dd{margin:0;text-align:right;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.notice{padding:.8rem 1.05rem;margin-bottom:1.2rem;border-left:3px solid var(--accent);background:var(--soft);border-radius:0 8px 8px 0;overflow-wrap:anywhere}
.notice.error{border-left-color:var(--danger);color:var(--danger);background:var(--adult-soft)}
.notice.warn{border-left-color:var(--warning)}
.notice:empty{display:none}

/* ---- 表单 / 认证 ---- */
.authwrap{padding:clamp(2rem,5vw,3.6rem) 0;display:grid;place-items:start center}
.authcard{width:min(440px,100%);background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:clamp(1.4rem,4vw,2.1rem)}
.authcard h1{font-size:1.5rem;margin-bottom:.5rem}
.authcard .intro{color:var(--sub);font-size:.94rem;margin-bottom:1.4rem}
.fields{display:flex;flex-direction:column;gap:1rem}
.formerror{color:var(--danger);font-size:.9rem;overflow-wrap:anywhere;margin:.2rem 0 0}
.formactions{display:flex;gap:.7rem;flex-wrap:wrap;margin-top:1.3rem}
.formactions .primary{flex:1}
.formnote{margin:0;color:var(--sub);font-size:.84rem}
.authlinks{display:flex;gap:.6rem;flex-wrap:wrap;justify-content:space-between;margin-top:1.2rem}

/* ---- 个人中心 ---- */
.account{display:grid;grid-template-columns:210px minmax(0,1fr);gap:1.6rem;align-items:start}
.subnav{display:flex;flex-direction:column;gap:.2rem;position:sticky;top:76px}
.subnav a{display:block;padding:.6rem .8rem;border-radius:8px;text-decoration:none;color:var(--text);font-weight:600;font-size:.93rem;min-height:44px;display:flex;align-items:center}
.subnav a:hover{background:var(--soft)}
.subnav a[aria-current=page]{color:var(--accent);background:var(--soft)}
.balance-hero{display:flex;flex-wrap:wrap;gap:1rem 2rem;align-items:center;margin-bottom:1.4rem}
.balance-hero .amount{font-size:2rem;font-weight:800;font-variant-numeric:tabular-nums;letter-spacing:-.02em}
.balance-hero .amount small{font-size:.85rem;font-weight:500;margin-left:.4rem}
.list{border-top:1px solid var(--line)}
.row{display:flex;align-items:center;justify-content:space-between;gap:1.1rem;padding:1.1rem 0;border-bottom:1px solid var(--line);flex-wrap:wrap}
.rowbody{min-width:0;flex:1}
.row h3{overflow-wrap:anywhere;font-size:1rem}
.row .muted,.row .mono{margin-top:.3rem}
.actions{display:flex;flex-wrap:wrap;gap:.45rem;align-items:center}
.statusline{font-size:.82rem;color:var(--sub);margin-top:.4rem}
.state-revoked{color:var(--sub)}
.state-active{color:var(--accent);font-weight:700}
.tablewrap{overflow-x:auto;max-width:100%;border:1px solid var(--line);border-radius:12px;background:var(--surface)}
table{width:100%;border-collapse:collapse;font-size:.87rem;min-width:520px}
th,td{padding:.75rem .9rem;text-align:left;border-bottom:1px solid var(--line);white-space:nowrap}
th{color:var(--sub);font-weight:600;background:var(--surface-2)}
tr:last-child td{border-bottom:0}

/* ---- 弹窗 ---- */
dialog{border:1px solid var(--line);border-radius:16px;background:var(--surface);color:var(--text);width:min(540px,calc(100% - 24px));max-height:86dvh;overflow:auto;padding:1.5rem}
dialog::backdrop{background:#10201899}
dialog h2{margin-bottom:.8rem;font-size:1.25rem}
dialog .fields{margin-top:1rem}

/* ---- 接入指南 ---- */
.codeblock{background:#10201a;color:#dcece2;border-radius:12px;padding:1rem 1.15rem;overflow-x:auto;margin:.6rem 0 1.3rem;font-size:.85rem;line-height:1.55}
.codeblock code{color:inherit;background:none;font-size:inherit}
.guide-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1.1rem}

/* ---- 页脚 ---- */
.sitefoot{border-top:1px solid var(--line);background:var(--surface);padding:2.2rem 0 2.6rem;margin-top:0}
.sitefoot .footgrid{display:flex;gap:1.5rem;flex-wrap:wrap;justify-content:space-between;align-items:flex-start}
.sitefoot nav{display:flex;gap:1.1rem;flex-wrap:wrap}
.sitefoot a{color:var(--sub);font-size:.88rem;text-decoration:none}
.sitefoot a:hover{color:var(--accent)}
.sitefoot .disclaimer{color:var(--sub);font-size:.8rem;margin-top:1.2rem;max-width:56rem}

/* ---- 工具类（避免内联样式） ---- */
.u-mt{margin-top:1rem}.u-mt-s{margin-top:.7rem}.u-mt-l{margin-top:1.2rem}.u-mt-xl{margin-top:1.4rem}
.u-mb{margin-bottom:1rem}.u-mb-l{margin-bottom:1.2rem}.min0{min-width:0}
.apibox{background:var(--surface-2);border-radius:8px;padding:.75rem .9rem;overflow-wrap:anywhere}
.inline-actions{border:0;padding:0;margin-top:1.2rem}
.panel-title{margin-bottom:1rem}
.list-title{margin:1.4rem 0 .8rem}
.foot-meta{font-size:.82rem}

/* ---- 控制台布局（标准中转站风格侧栏） ---- */
:root{--modebar-h:34px}
.cshell{display:grid;grid-template-columns:234px minmax(0,1fr);min-height:calc(100dvh - var(--modebar-h))}
.csidebar{background:var(--surface);border-right:1px solid var(--line);display:flex;flex-direction:column;padding:1.1rem .8rem;gap:.4rem;position:sticky;top:0;height:calc(100dvh - var(--modebar-h));overflow-y:auto}
.csidebar .brand{display:block;text-decoration:none;margin:.2rem .4rem .9rem}
.cnav{display:flex;flex-direction:column;gap:.12rem}
.cnav a{display:flex;align-items:center;min-height:44px;padding:.55rem .8rem;border-radius:8px;text-decoration:none;color:var(--text);font-weight:600;font-size:.93rem}
.cnav a:hover{background:var(--soft)}
.cnav a[aria-current]{color:var(--accent);background:var(--soft)}
.cside-foot{margin-top:auto;display:flex;flex-direction:column;gap:.15rem;padding-top:.8rem;border-top:1px solid var(--line)}
.cside-foot a{display:flex;align-items:center;min-height:40px;padding:.45rem .8rem;text-decoration:none;font-weight:600;font-size:.9rem;border-radius:8px;color:var(--sub)}
.cside-foot a:hover{background:var(--soft)}
.cside-foot button{justify-content:flex-start;font-weight:600;color:var(--danger)}
.cworkspace{min-width:0;display:flex;flex-direction:column}
.ctop{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.8rem clamp(1rem,3vw,1.8rem);border-bottom:1px solid var(--line);background:var(--surface);flex-wrap:wrap}
.cwho{font-weight:700;font-size:.92rem;overflow-wrap:anywhere}
.balance-pill{font-weight:800;color:var(--accent);background:var(--soft);border:1px solid var(--soft-2);border-radius:999px;padding:.3rem .9rem;font-size:.9rem;white-space:nowrap}
.cpage{width:min(1080px,100%);margin:0 auto;padding:clamp(1.4rem,3.5vw,2.4rem) clamp(1rem,3vw,1.8rem) 3rem}
.cworkspace>#global-notice{margin:1rem clamp(1rem,3vw,1.8rem) 0}
.card.stat{display:flex;flex-direction:column;gap:.6rem}
.card.stat .apibox{font-size:.78rem}
.card.stat button{margin-top:auto}

/* ---- 模型价格分组表 ---- */
.price-groups{display:flex;flex-direction:column;gap:1.6rem}
.price-group h2{font-size:1.08rem;margin-bottom:.7rem}
.price-group table{min-width:760px}
.price-group td:first-child{white-space:normal;min-width:280px}
.model-cell{display:flex;flex-direction:column;gap:.32rem;max-width:520px}
.model-cell .model-id{font-size:.78rem;color:var(--sub)}
.model-cell .model-desc{font-size:.82rem;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.price-group td:not(:first-child){font-variant-numeric:tabular-nums}
.price-group th:last-child,.price-group td:last-child{text-align:right}

@media(prefers-color-scheme:dark){
  :root{--bg:#131a16;--surface:#1d2521;--surface-2:#242d28;--text:#e5ece7;--sub:#a6b4aa;--line:#38453d;
    --accent:#3f906b;--accent-strong:#2f7355;--soft:#23352c;--soft-2:#2c4237;--danger:#ffaea0;--warning:#e6c184;
    --focus:#85bb92;--adult:#e09aa4;--adult-soft:#3a262b}
  .badge.usage-roleplay{color:#e3c489;border-color:#57471f;background:#2c2616}
  .badge.usage-writing{color:#a9bce4;border-color:#33405f;background:#1e2638}
  .codeblock{background:#0c1310}
}
@media(max-width:860px){
  .account{grid-template-columns:minmax(0,1fr);gap:1rem}
  .subnav{position:static;flex-direction:row;overflow-x:auto;padding-bottom:.3rem}
  .subnav a{flex-shrink:0}
  .detail,.guide-grid{grid-template-columns:minmax(0,1fr)}
  .grid.three,.steps{grid-template-columns:minmax(0,1fr)}
  .step{padding-left:3.4rem}
  .cshell{grid-template-columns:minmax(0,1fr);min-height:0}
  .csidebar{position:static;height:auto;flex-direction:column;border-right:0;border-bottom:1px solid var(--line);padding:.8rem 1rem}
  .cnav{flex-direction:row;overflow-x:auto;padding-bottom:.2rem}
  .cnav a{flex-shrink:0}
  .cside-foot{flex-direction:row;align-items:center;margin-top:.5rem;padding-top:.4rem}
  .cside-foot a,.cside-foot button{flex-shrink:0}
}
@media(max-width:680px){:root{--modebar-h:56px}}
@media(max-width:680px){
  .sitehead .wrap{flex-wrap:wrap;gap:.5rem 1rem}
  .mainnav{display:flex;flex-direction:row;overflow-x:auto;flex-wrap:nowrap;justify-content:flex-start;width:100%;margin-left:0;padding-bottom:.2rem}
  .mainnav a,.mainnav button{flex-shrink:0;justify-content:flex-start}
  .navtoggle{display:none}
  .grid.two{grid-template-columns:minmax(0,1fr)}
  .hero .cta{flex-direction:column;align-items:stretch}
  .hero .cta .primary{width:100%}
  .row{align-items:flex-start;flex-direction:column;gap:.7rem}
  .actions{width:100%}
}
@media(prefers-reduced-motion:no-preference){button,a{transition:background-color .12s ease,color .12s ease}}

/* 厂商分组 */
.vendor-tag{display:inline-block;font-size:.82rem;font-weight:700;padding:.2rem .7rem;border-radius:99px;background:var(--soft);color:var(--accent);border:1px solid var(--soft-2);margin-right:.4rem}
.price-group h2 .muted{font-size:.82rem;font-weight:400}