/* 公网前台：站点 header/footer 以及首页、我的 IP、API 文档布局 */
.site { min-height: 100vh; display: flex; flex-direction: column; }
.site-header { height: 56px; border-bottom: 1px solid var(--line); background: #fff; display: flex; align-items: center; padding: 0 32px; font-size: 13px; }
.site-header .logo { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.site-header .logo .logo-info, .brand .logo-info { color: var(--brand); }
.site-header nav { display: flex; gap: 22px; margin-left: 40px; }
.site-header nav a { color: var(--ink-3); font-weight: 500; height: 56px; display: inline-flex; align-items: center; border-bottom: 2px solid transparent; }
.site-header nav a:hover { color: var(--ink-1); }
.site-header nav a.active { color: var(--ink-1); border-bottom-color: var(--brand); }
.site-header .spacer { flex: 1; }
.site-header .actions { display: flex; gap: 10px; align-items: center; }
.site-main { flex: 1; }
.site-footer { border-top: 1px solid var(--line); padding: 22px 32px; color: var(--ink-4); font-size: 12px; display: flex; justify-content: center; align-items: center; background: #fff; text-align: center; }
.site-footer .beian { color: var(--ink-3); margin-left: 10px; }
.site-footer .beian:hover { color: var(--brand); }

/* 首页 V2：大字 + 同页结果 */
.home { display: flex; flex-direction: column; align-items: center; padding: 100px 20px 60px; background: radial-gradient(ellipse 800px 400px at 50% -20%, rgba(11,110,253,.06), transparent 60%); }
.home h1 { font-size: 44px; font-weight: 600; letter-spacing: -.025em; margin: 0 0 10px; text-align: center; }
.home h1 em { color: var(--brand); font-style: normal; }
.home .sub { color: var(--ink-3); font-size: 15px; margin: 0 0 40px; text-align: center; }
.home-search { width: min(680px, 94vw); position: relative; }
.home-search .home-search-input { display: block; width: 100%; height: 56px; padding: 0 130px 0 142px; font-size: 15px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-2); color: var(--ink-1); outline: 0; transition: border-color .15s, box-shadow .15s; }
.home-search .home-search-input:hover { border-color: var(--line-strong); }
.home-search .home-search-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(11,110,253,.12), var(--shadow-2); }
.home-search .home-search-input::placeholder { color: var(--ink-5); }
.home-search .home-search-select { position: absolute; left: 1px; top: 1px; bottom: 1px; width: 128px; padding: 0 32px 0 22px; border: 0; border-right: 1px solid var(--line-soft); border-radius: var(--r-lg) 0 0 var(--r-lg); background-color: transparent; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%239aa3b2' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>"); background-repeat: no-repeat; background-position: right 14px center; font-size: 15px; color: var(--ink-1); cursor: pointer; outline: 0; appearance: none; -webkit-appearance: none; -moz-appearance: none; z-index: 2; transition: background-color .15s; }
.home-search .home-search-select:hover { background-color: rgba(15, 23, 42, .03); }
.home-search .home-search-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); height: 44px; padding: 0 22px; background: var(--brand); color: #fff; border: 0; border-radius: var(--r-md); font-size: 14px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; z-index: 2; transition: background .15s; }
.home-search .home-search-btn:hover { background: var(--brand-600); }
.home .quick { width: min(680px, 94vw); margin-top: 18px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.home .chip { font-size: 12px; padding: 6px 10px; background: #fff; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2); font-family: var(--font-mono); display: inline-flex; align-items: center; justify-content: center; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-result { width: min(680px, 94vw); margin-top: 36px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.home-result .head { padding: 16px 20px; background: var(--bg-2); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.home-result .head .ip { font-family: var(--font-mono); font-size: 16px; font-weight: 600; }
.home-result dl { margin: 0; padding: 8px 20px 16px; }
.home-result .row { display: grid; grid-template-columns: 120px 1fr; padding: 10px 0; border-bottom: 1px dashed var(--line-soft); }
.home-result .row:last-child { border-bottom: 0; }
.home-result dt { color: var(--ink-3); font-size: 13px; }
.home-result dd { margin: 0; font-size: 13px; }

/* 我的 IP · A1 */
.myip { padding: 80px 20px; display: flex; flex-direction: column; align-items: center; }
.myip .label { color: var(--ink-3); font-size: 13px; text-transform: uppercase; margin-bottom: 10px; letter-spacing: .04em; }
.myip .big-ip { font-family: var(--font-mono); font-size: 56px; font-weight: 600; margin: 0 0 14px; letter-spacing: -.02em; }
.myip .loc { font-size: 16px; color: var(--ink-2); margin-bottom: 28px; }
.myip .detail { width: min(640px, 94vw); border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; margin-top: 20px; }
.myip .detail .row { display: grid; grid-template-columns: 140px 1fr; padding: 14px 20px; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.myip .detail .row:last-child { border-bottom: 0; }
.myip .detail .k { color: var(--ink-3); }
.myip .detail .v { font-family: var(--font-mono); }
.myip .detail .v.plain { font-family: var(--font-sans); }

/* API 文档 */
.docs { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.docs-nav { background: #fff; border-right: 1px solid var(--line); padding: 24px 18px; font-size: 13px; position: sticky; top: 0; align-self: start; max-height: 100vh; overflow-y: auto; }
.docs-nav .brand { font-size: 15px; font-weight: 600; margin-bottom: 20px; }
.docs-nav .sec { margin-bottom: 16px; }
.docs-nav .sec-title { font-size: 11px; color: var(--ink-4); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.docs-nav a { display: block; padding: 5px 8px; color: var(--ink-2); border-radius: var(--r-sm); }
.docs-nav a:hover { background: var(--bg-2); }
.docs-nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 500; }
.docs-body { padding: 32px 40px; max-width: 820px; overflow-x: hidden; }
.docs-body h1 { font-size: 26px; font-weight: 600; margin: 0 0 8px; }
.docs-body .meta { color: var(--ink-3); margin-bottom: 28px; display: flex; gap: 10px; align-items: center; }
.docs-body .method { display: inline-block; padding: 2px 8px; border-radius: 4px; font-family: var(--font-mono); font-size: 11px; font-weight: 600; background: var(--success); color: #fff; }
.docs-body h2 { font-size: 18px; font-weight: 600; margin: 28px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.docs-body p { color: var(--ink-2); }
.docs-body .endpoint { background: var(--bg-2); padding: 10px 14px; border-radius: var(--r-md); font-family: var(--font-mono); font-size: 13px; display: inline-block; }
.docs-body pre { margin: 12px 0; background: var(--bg-2); border: 1px solid var(--line-soft); padding: 14px 16px; border-radius: var(--r-md); font-family: var(--font-mono); font-size: 12.5px; overflow: auto; }
.docs-body .param-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 12px 0; }
.docs-body .param-table th, .docs-body .param-table td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); text-align: left; }
.docs-body .param-table th { background: var(--bg-2); font-weight: 500; color: var(--ink-3); }
.docs-body .param-table td.name { font-family: var(--font-mono); font-weight: 500; }
.docs-body .param-table td.type { font-family: var(--font-mono); color: var(--ink-3); font-size: 12px; }
.docs-demo { margin: 18px 0 28px; padding: 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; }
.docs-demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.docs-demo-field { display: grid; gap: 8px; }
.docs-demo-label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.docs-demo-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.docs-demo-status { min-height: 20px; margin-bottom: 14px; font-size: 13px; color: var(--ink-2); }
.docs-demo-block { margin-top: 14px; border: 1px solid var(--line-soft); border-radius: var(--r-md); overflow: hidden; background: var(--bg-2); }
.docs-demo-hd { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); background: #fff; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.docs-demo-pre { margin: 0; padding: 14px 16px; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; overflow: auto; }
.tok-com { color: var(--ink-4); } .tok-str { color: var(--success); } .tok-key { color: var(--brand); } .tok-num { color: var(--warn); }

@media (max-width: 980px) {
  .home .quick { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .docs-demo-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .site-header { padding: 0 14px; }
  .site-header nav { gap: 14px; margin-left: 18px; }
  .site-header .actions { gap: 6px; }
  .site-footer { padding: 18px 14px; }
  .home .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ==== API 文档：接口概览卡（页首） ==== */
.docs-overview { margin: 12px 0 32px; padding: 18px 20px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg); }
.docs-overview dl { display: grid; grid-template-columns: 110px 1fr; row-gap: 10px; column-gap: 18px; margin: 0; font-size: 13px; }
.docs-overview dt { color: var(--ink-3); }
.docs-overview dd { margin: 0; color: var(--ink-1); font-family: var(--font-mono); word-break: break-all; }
.docs-overview dd.plain { font-family: var(--font-sans); }

/* ==== 接口标题横条（method + url + badge） ==== */
.endpoint-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 8px 0 14px; }
.endpoint-head .method { padding: 3px 10px; border-radius: 4px; font-family: var(--font-mono); font-size: 11px; font-weight: 600; color: #fff; }
.endpoint-head .method.get  { background: var(--success); }
.endpoint-head .method.post { background: var(--brand); }
.endpoint-head .url { flex: 1; min-width: 240px; padding: 8px 12px; background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: var(--r-md); font-family: var(--font-mono); font-size: 13px; word-break: break-all; }

/* ==== 语言 Tab 切换 ==== */
.code-tabs { display: flex; flex-wrap: wrap; gap: 2px; margin: 14px 0 0; padding: 0 4px; border-bottom: 1px solid var(--line); background: #fff; }
.code-tab { appearance: none; background: transparent; border: 0; padding: 8px 14px; font-size: 13px; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; transition: color .15s, border-color .15s, background .15s; }
.code-tab:hover { color: var(--ink-1); background: var(--bg-2); }
.code-tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 500; }

.code-panels { position: relative; }
.code-panel { display: none; margin: 0; padding: 14px 16px; background: var(--bg-2); border: 1px solid var(--line-soft); border-top: 0; border-radius: 0 0 var(--r-md) var(--r-md); font-family: var(--font-mono); font-size: 12.5px; line-height: 1.7; white-space: pre; overflow: auto; }
.code-panel.active { display: block; }

/* 响应示例用同一视觉，但无 tab */
.docs-body .response-block { margin: 12px 0; }
.docs-body .response-block pre { border-radius: var(--r-md); }

/* 响应参数表：字段列稍宽 */
.docs-body .resp-table td.name { min-width: 140px; }

@media (max-width: 980px) {
  .docs-overview dl { grid-template-columns: 100px 1fr; }
  .code-tab { padding: 7px 10px; font-size: 12px; }
}
@media (max-width: 640px) {
  .docs { grid-template-columns: 1fr; }
  .docs-nav { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--line); padding: 14px 16px; }
  .docs-body { padding: 20px 16px; }
  .docs-overview dl { grid-template-columns: 1fr; row-gap: 4px; }
  .docs-overview dt { margin-top: 6px; }
}
