/* iOS 风格设计语言：分组背景、大圆角、SF 字体栈 */
:root {
  --ios-bg: #F5F5F7;
  --ios-card: #FFFFFF;
  --ios-blue: #0071E3;
  --ios-blue-dark: #0058B9;
  --ios-blue-light: #2997FF;
  --ios-green: #34C759;
  --ios-red: #FF3B30;
  --ios-orange: #FF9500;
  --ios-gray: #8E8E93;
  --ios-gray2: #AEAEB2;
  --ios-gray5: #E5E5EA;
  --ios-gray6: #F2F2F7;
  --ios-text: #1D1D1F;
  --ios-text2: #6E6E73;
  --radius: 32px;
  --radius-s: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06), 0 28px 72px rgba(0,0,0,.05);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--ios-bg);
  color: var(--ios-text);
  font-size: 16px;
  line-height: 1.5;
}
.wrap { max-width: 640px; margin: 0 auto; padding: 0 16px 64px; }

/* 大标题（参考 Apple 风格：居中、渐变字、胶囊徽章） */
.hero { padding: 30px 4px 14px; text-align: center; }
.hero h1 { font-size: clamp(30px, 6vw, 46px); font-weight: 800; letter-spacing: -.5px; margin: 0 0 8px; }
.hero h1 .grad {
  background: linear-gradient(100deg, #0894FF, #C959DD 45%, #FF2E54 75%, #FF9004);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--ios-text2); margin: 0; font-size: 15px; }
.hero .badges { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 14px 0 2px; }
.hero .badges span {
  display: inline-flex; align-items: center; gap: 5px; background: #fff; color: var(--ios-text);
  font-size: 13px; padding: 7px 13px; border-radius: 999px;
  box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 12px rgba(0,0,0,.05);
}
.hero .badges i { color: var(--ios-blue); font-style: normal; }

/* 分组标题（iOS 设置风） */
.sec-title {
  font-size: 13px; font-weight: 600; color: var(--ios-gray);
  text-transform: uppercase; letter-spacing: .4px;
  margin: 26px 4px 8px;
}

/* 卡片 */
.card {
  background: var(--ios-card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px; margin-bottom: 12px;
}
.card.tight { padding: 0; overflow: hidden; }
@media (max-width: 560px) {
  .card { border-radius: 26px; padding: 18px; }
  .btn { width: 100%; }
  .toolbar { flex-direction: column; }
  input, textarea, select { font-size: 16px !important; } /* 防 iOS 聚焦自动缩放 */
}

/* 表单行（iOS 分组列表风） */
.row { display: flex; align-items: center; padding: 13px 18px; gap: 12px; }
.row + .row { border-top: 1px solid var(--ios-gray5); }
.row label { flex: 0 0 auto; font-size: 16px; }
.row .grow { flex: 1; min-width: 0; }
.row input[type=text], .row input[type=password], .row select, .row textarea {
  width: 100%; border: 0; outline: 0; font-size: 16px; font-family: inherit;
  background: transparent; color: var(--ios-text); padding: 2px 0;
}
.row textarea { resize: vertical; min-height: 88px; }
.row input::placeholder, .row textarea::placeholder { color: var(--ios-gray2); }

.field-label { display: block; font-size: 14px; font-weight: 600; margin: 0 0 8px; }
.field-label .req { color: var(--ios-red); }
textarea.box, input.box, select.box {
  width: 100%; border: 1px solid var(--ios-gray5); border-radius: var(--radius-s);
  padding: 12px 14px; font-size: 16px; font-family: inherit; outline: 0;
  background: #fff; color: var(--ios-text);
}
textarea.box:focus, input.box:focus, select.box:focus { border-color: var(--ios-blue); }
textarea.box { min-height: 110px; resize: vertical; }

/* 按钮（蓝色渐变胶囊） */
.btn {
  display: block; width: 100%; border: 0; border-radius: 999px;
  background: linear-gradient(135deg, var(--ios-blue-light), var(--ios-blue) 60%, var(--ios-blue-dark));
  color: #fff;
  font-size: 17px; font-weight: 600; font-family: inherit;
  padding: 15px; cursor: pointer; transition: filter .15s, transform .06s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { filter: brightness(.94); transform: scale(.97); }
.btn:disabled { opacity: .38; cursor: default; transform: none; filter: none; }
.btn.secondary { background: var(--ios-gray5); color: var(--ios-blue); }
.btn.secondary:active { background: var(--ios-gray6); }
.btn.danger { background: var(--ios-red); }
.btn.ghost { background: transparent; color: var(--ios-blue); padding: 10px; }
.btn.small { width: auto; display: inline-block; padding: 9px 18px; font-size: 15px; }

/* 分段选择器（iOS SegmentedControl） */
.segmented {
  display: flex; background: var(--ios-gray5); border-radius: 12px; padding: 3px; margin-bottom: 16px;
}
.segmented button {
  flex: 1; border: 0; background: transparent; border-radius: 9px;
  font-size: 15px; font-weight: 600; font-family: inherit; color: var(--ios-text);
  padding: 9px 4px; cursor: pointer;
}
.segmented button.on { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.12); }

/* 步骤条 */
.steps { display: flex; margin: 4px 0 18px; }
.step { flex: 1; text-align: center; position: relative; font-size: 12px; color: var(--ios-gray); }
.step .dot {
  width: 32px; height: 32px; border-radius: 50%; margin: 0 auto 6px;
  background: var(--ios-gray5); color: var(--ios-gray);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
.step.done .dot { background: var(--ios-green); color: #fff; }
.step.now .dot {
  background: var(--ios-blue); color: #fff;
  box-shadow: 0 0 0 6px rgba(0,113,227,.15);
}
.step.now { color: var(--ios-text); font-weight: 600; }
.step::before {
  content: ""; position: absolute; top: 15px; left: -50%; width: 100%; height: 2px;
  background: var(--ios-gray5); z-index: -1;
}
.step:first-child::before { display: none; }
.step.done::before { background: var(--ios-green); }

/* 状态徽标 */
.badge {
  display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px;
  border-radius: 20px; white-space: nowrap;
}
.badge.ok { background: #E5F9EC; color: #1E7E34; }
.badge.wait { background: #FFF4E0; color: #B26A00; }
.badge.err { background: #FDECEA; color: #C0271B; }
.badge.info { background: #E5F0FF; color: #0A5FD7; }
.badge.gray { background: var(--ios-gray6); color: var(--ios-text2); }

/* 提示 / 结果 */
.hint { font-size: 13px; color: var(--ios-text2); margin: 8px 4px 0; }
.result { margin-top: 14px; }
.alert { border-radius: var(--radius-s); padding: 13px 15px; font-size: 15px; margin-bottom: 10px; }
.alert.ok { background: #E5F9EC; color: #14532D; }
.alert.err { background: #FDECEA; color: #8F1D14; }
.alert.info { background: #E5F0FF; color: #0A3D91; }

/* 卡密展示 */
.codebox {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--ios-gray6); border-radius: var(--radius-s);
  padding: 14px; font-size: 17px; font-weight: 700; letter-spacing: 1px;
  text-align: center; user-select: all; word-break: break-all;
}

/* 时间线 */
.timeline { list-style: none; margin: 6px 0 0; padding: 0; }
.timeline li {
  position: relative; padding: 0 0 16px 26px; font-size: 14px; color: var(--ios-text2);
}
.timeline li::before {
  content: ""; position: absolute; left: 7px; top: 6px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--ios-gray2);
}
.timeline li::after {
  content: ""; position: absolute; left: 11px; top: 20px; bottom: -2px; width: 1px;
  background: var(--ios-gray5);
}
.timeline li:last-child::after { display: none; }
.timeline li:last-child::before { background: var(--ios-blue); }
.timeline .ts { display: block; font-size: 12px; color: var(--ios-gray2); }

/* 手风琴 */
.acc { border-top: 1px solid var(--ios-gray5); }
.acc-item + .acc-item { border-top: 1px solid var(--ios-gray5); }
.acc-head {
  width: 100%; background: none; border: 0; text-align: left; cursor: pointer;
  font-size: 16px; font-family: inherit; color: var(--ios-text);
  padding: 14px 18px; display: flex; justify-content: space-between; align-items: center;
}
.acc-head .chev { color: var(--ios-gray2); transition: transform .2s; }
.acc-item.open .acc-head .chev { transform: rotate(90deg); }
.acc-body { display: none; padding: 0 18px 16px; font-size: 14px; color: var(--ios-text2); }
.acc-item.open .acc-body { display: block; }
.acc-body ol { margin: 6px 0; padding-left: 20px; }
.acc-body li { margin-bottom: 6px; }

/* 底部导航 */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: rgba(255,255,255,.92); backdrop-filter: blur(20px);
  border-top: 1px solid var(--ios-gray5);
  display: flex; padding: 6px 0 calc(8px + env(safe-area-inset-bottom));
}
.tabbar a {
  flex: 1; text-align: center; text-decoration: none; color: var(--ios-gray);
  font-size: 11px; font-weight: 500; padding: 2px 0;
}
.tabbar a .ico { font-size: 22px; display: block; line-height: 1.3; }
.tabbar a.on { color: var(--ios-blue); }

/* 表格（后台） */
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th, table.grid td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--ios-gray5); }
table.grid th { color: var(--ios-gray); font-weight: 600; font-size: 12px; text-transform: uppercase; }
table.grid tr:last-child td { border-bottom: 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar input.box, .toolbar select.box { width: auto; flex: 1; min-width: 120px; padding: 9px 12px; font-size: 14px; }

.hidden { display: none !important; }
.mt { margin-top: 14px; }
.center { text-align: center; }
.linklike { color: var(--ios-blue); text-decoration: none; }
@media (prefers-color-scheme: dark) { /* 保持浅色，保证可读与品牌一致 */ }

/* ================= 桌面端（≥1024px）：独立布局 ================= */
.topnav{display:none}

@media (min-width:1024px){
  /* 顶部导航（毛玻璃），替代移动端底部 tabbar */
  .topnav{
    display:block;position:sticky;top:0;z-index:50;
    background:rgba(255,255,255,.82);
    -webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);
    border-bottom:1px solid rgba(0,0,0,.06);
  }
  .topnav-in{max-width:1060px;margin:0 auto;padding:0 24px;height:60px;
    display:flex;align-items:center;justify-content:space-between}
  .topnav .brand{font-weight:700;font-size:17px;color:var(--ios-text);text-decoration:none}
  .topnav .links{display:flex;gap:6px}
  .topnav .links a{padding:8px 16px;border-radius:999px;font-size:14px;
    color:var(--ios-text2);text-decoration:none;transition:background .15s}
  .topnav .links a.on{background:var(--ios-blue);color:#fff;font-weight:600}
  .topnav .links a:not(.on):hover{background:rgba(0,0,0,.05)}
  .tabbar{display:none}

  /* 更宽的版心 */
  .wrap{max-width:1060px;padding:40px 24px 64px}

  /* hero 更大气 */
  .hero{padding:40px 0 30px}
  .hero h1{font-size:44px;letter-spacing:-.5px}
  .hero p{font-size:16px}
  .badges{font-size:14px}

  /* 步骤条居中收窄 */
  .steps{max-width:780px;margin:0 auto 28px}
  .step{font-size:14px}
  .step .dot{width:34px;height:34px;font-size:16px}

  /* 卡片更宽大 */
  .card{padding:28px;border-radius:28px}

  /* 工具入口已收进顶栏；工具卡片纵向排列 */
  .topnav .links a{padding:8px 12px;font-size:13px}

  /* 按钮 hover 反馈（桌面专属） */
  .btn:hover{filter:brightness(1.06)}
  .btn:active{transform:scale(.99)}
}

/* 工具快捷入口（移动端 hero 下方横滑；桌面端用顶栏） */
.toolchips{display:flex;gap:8px;overflow-x:auto;padding:2px 2px 14px;
  -webkit-overflow-scrolling:touch;scrollbar-width:none}
.toolchips::-webkit-scrollbar{display:none}
.toolchips a{flex:0 0 auto;padding:9px 16px;border-radius:999px;
  background:rgba(255,255,255,.75);border:1px solid rgba(0,0,0,.06);
  font-size:13.5px;font-weight:600;color:var(--ios-text);text-decoration:none;
  box-shadow:0 2px 10px rgba(0,0,0,.05)}
.toolchips a:active{transform:scale(.96)}
.toolchips a.on{background:var(--ios-blue);color:#fff;border-color:transparent}
.toolcard{scroll-margin-top:76px}

/* 桌面端用顶栏导航，隐藏下方重复的快捷入口 */
@media (min-width:1024px){
  .toolchips{display:none}
}
