/* =====================================================
   工具星球 ToolPlanet — 全局样式
   浅色主题 · 渐变强调 · 响应式
   ===================================================== */

:root {
  --bg: #f6f7fb;
  --bg-card: #ffffff;
  --bg-soft: #f1f3f9;
  --text: #1c2033;
  --text-2: #5a6178;
  --text-3: #9aa1b5;
  --brand: #6366f1;
  --brand-2: #8b5cf6;
  --brand-3: #d946ef;
  --grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #d946ef 100%);
  --grad-soft: linear-gradient(135deg, #eef0ff 0%, #f6eeff 100%);
  --border: #e7e9f2;
  --success: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --radius: 16px;
  --shadow-sm: 0 1px 3px rgba(28, 32, 51, .06), 0 1px 2px rgba(28, 32, 51, .04);
  --shadow-md: 0 8px 24px rgba(28, 32, 51, .08);
  --shadow-lg: 0 16px 48px rgba(99, 102, 241, .16);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container { width: min(1180px, 94%); margin: 0 auto; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ============ 顶部导航 ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 64px;
}

.logo { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; }
.logo-icon { font-size: 26px; filter: drop-shadow(0 2px 6px rgba(139, 92, 246, .4)); }
.logo-text em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.main-nav { display: flex; gap: 6px; flex: 1; }
.main-nav a {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 14.5px;
  color: var(--text-2);
  font-weight: 500;
  transition: all .2s;
}
.main-nav a:hover { color: var(--brand); background: var(--bg-soft); }
.main-nav a.active { color: #fff; background: var(--grad); box-shadow: 0 4px 12px rgba(99, 102, 241, .35); }

.privacy-badge {
  font-size: 12.5px;
  color: var(--success);
  background: #ecfdf5;
  border: 1px solid #d1fae5;
  padding: 5px 12px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}

/* ============ Hero（首页） ============ */
.hero {
  padding: 64px 0 36px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto;
  height: 130%;
  background:
    radial-gradient(600px 300px at 20% 30%, rgba(99, 102, 241, .14), transparent 70%),
    radial-gradient(600px 300px at 80% 20%, rgba(217, 70, 239, .12), transparent 70%);
  pointer-events: none;
}
.hero h1 {
  font-size: clamp(30px, 5vw, 46px);
  font-weight: 800;
  letter-spacing: -.02em;
  position: relative;
}
.hero h1 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { color: var(--text-2); font-size: 17px; margin: 14px auto 0; max-width: 640px; position: relative; }
.hero-stats { display: flex; justify-content: center; gap: 40px; margin-top: 28px; position: relative; }
.hero-stats .stat b { font-size: 24px; font-weight: 800; display: block; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero-stats .stat span { font-size: 13px; color: var(--text-3); }

/* 搜索框 */
.search-wrap { position: relative; max-width: 560px; margin: 30px auto 0; }
.search-wrap input {
  width: 100%;
  padding: 15px 52px 15px 48px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  box-shadow: var(--shadow-md);
  transition: border-color .2s, box-shadow .2s;
}
.search-wrap input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(99, 102, 241, .12); }
.search-wrap .search-icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); font-size: 16px; opacity: .5; pointer-events: none; }
.search-wrap .search-clear {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; border: none; border-radius: 50%;
  background: var(--bg-soft); color: var(--text-3);
  font-size: 12px; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
  transition: background .2s, color .2s;
}
.search-wrap .search-clear:hover { background: #e4e7f0; color: var(--text); }
.search-wrap .search-clear[hidden] { display: none; }

/* 搜索联想下拉 */
.search-suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px);
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-lg); overflow: hidden; z-index: 50;
  padding: 6px;
}
.search-suggest[hidden] { display: none; }
.suggest-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 10px; cursor: pointer;
  transition: background .15s;
}
.suggest-item:hover, .suggest-item.active { background: var(--bg-soft); }
.si-icon { font-size: 17px; flex: none; }
.si-name { flex: 1; font-size: 14px; color: var(--text); font-weight: 600; }
.si-cat { font-size: 11.5px; color: var(--text-3); background: var(--bg-soft); padding: 2px 8px; border-radius: 999px; flex: none; }

/* 关键词高亮 */
mark { background: #fef08a; color: inherit; border-radius: 2px; padding: 0 1px; }

/* ============ 工具网格 ============ */
.section { padding: 12px 0 40px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; }
.section-head h2 { font-size: 21px; font-weight: 800; }
.section-head .more { font-size: 13.5px; color: var(--brand); font-weight: 600; }

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 18px;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
  transition: transform .22s, box-shadow .22s, border-color .22s;
}
.tool-card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--grad);
  opacity: 0;
  transition: opacity .22s;
}
.tool-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: transparent; }
.tool-card:hover::after { opacity: 1; }

.tool-card .card-top { display: flex; align-items: center; gap: 12px; }
.tool-card .tool-icon {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  font-size: 23px;
  border-radius: 13px;
  background: var(--grad-soft);
  flex-shrink: 0;
}
.tool-card h3 { font-size: 16.5px; font-weight: 700; }
.tool-card .tool-desc { font-size: 13.5px; color: var(--text-2); min-height: 42px; }
.tool-card .card-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.tool-card .tool-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tool-card .tag { font-size: 11.5px; color: var(--text-3); background: var(--bg-soft); padding: 2px 9px; border-radius: 999px; }
.tool-card .usage { font-size: 12px; color: var(--text-3); }
.hot-badge {
  position: absolute;
  top: 14px; right: -30px;
  transform: rotate(38deg);
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 36px;
  box-shadow: 0 2px 8px rgba(239, 68, 68, .4);
}

/* ============ 工具详情页 ============ */
.tool-page { padding: 32px 0 60px; }
.breadcrumb { font-size: 13.5px; color: var(--text-3); margin-bottom: 18px; }
.breadcrumb a:hover { color: var(--brand); }
.tool-hero { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; }
.tool-hero .tool-icon { width: 58px; height: 58px; font-size: 30px; border-radius: 16px; background: var(--grad-soft); display: grid; place-items: center; }
.tool-hero h1 { font-size: 26px; font-weight: 800; }
.tool-hero p { color: var(--text-2); font-size: 14.5px; }

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}
.panel + .panel { margin-top: 18px; }
.panel h2 { font-size: 16px; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.panel h2 .num {
  width: 22px; height: 22px;
  background: var(--grad);
  color: #fff;
  font-size: 12.5px;
  border-radius: 7px;
  display: grid; place-items: center;
}

/* 上传区 */
.dropzone {
  border: 2px dashed #cfd3e6;
  border-radius: 14px;
  padding: 44px 24px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: #fafbff;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--brand); background: #f3f4ff; }
.dropzone .dz-icon { font-size: 40px; }
.dropzone .dz-title { font-size: 15.5px; font-weight: 700; margin-top: 8px; }
.dropzone .dz-sub { font-size: 13px; color: var(--text-3); margin-top: 4px; }

/* 表单控件 */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13.5px; font-weight: 600; color: var(--text-2); margin-bottom: 7px; }
.field .hint { font-size: 12px; color: var(--text-3); margin-top: 5px; }

select, input[type="text"], input[type="number"], textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color .2s;
}
select:focus, input:focus, textarea:focus { border-color: var(--brand); }

textarea { resize: vertical; min-height: 120px; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 13px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

input[type="range"] { width: 100%; accent-color: var(--brand); }

.radio-cards { display: flex; gap: 10px; flex-wrap: wrap; }
.radio-cards label {
  flex: 1;
  min-width: 96px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  transition: all .18s;
}
.radio-cards label:hover { border-color: var(--brand-2); }
.radio-cards input { display: none; }
.radio-cards input:checked + span { color: var(--brand); }
.radio-cards label:has(input:checked) { border-color: var(--brand); background: #f3f4ff; color: var(--brand); box-shadow: 0 0 0 3px rgba(99, 102, 241, .12); }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 12px;
  padding: 13px 26px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
}
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 6px 18px rgba(99, 102, 241, .35); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(99, 102, 241, .45); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-ghost { background: var(--bg-soft); color: var(--text-2); }
.btn-ghost:hover { background: #e8eaf5; }
.btn-danger { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }

/* 进度条 */
.progress-wrap { margin-top: 16px; }
.progress-bar { height: 10px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; }
.progress-bar .fill { height: 100%; width: 0; background: var(--grad); border-radius: 999px; transition: width .25s; }
.progress-label { font-size: 12.5px; color: var(--text-2); margin-top: 7px; display: flex; justify-content: space-between; }

/* 结果区 */
.result-box { margin-top: 18px; border-top: 1px dashed var(--border); padding-top: 20px; }
.result-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.result-stats { display: flex; gap: 22px; flex-wrap: wrap; }
.result-stats .rs b { font-size: 17px; display: block; }
.result-stats .rs span { font-size: 12px; color: var(--text-3); }
.result-stats .rs.good b { color: var(--success); }

.preview-area {
  background: repeating-conic-gradient(#f1f3f9 0% 25%, #fff 0% 50%) 50% / 20px 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  margin-bottom: 14px;
}
.preview-area img, .preview-area video { max-width: 100%; max-height: 380px; border-radius: 8px; }

/* 区域标注（视频去水印） */
.annotator-wrap { position: relative; display: inline-block; max-width: 100%; border-radius: 12px; overflow: hidden; background: #000; }
.annotator-wrap video { display: block; max-width: 100%; max-height: 420px; }
.annotator-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }
.region-list { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.region-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-soft);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
}
.region-item code { font-family: ui-monospace, Consolas, monospace; color: var(--brand); }

/* 键值表格 */
.kv-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.kv-table td { padding: 8px 6px; border-bottom: 1px solid var(--bg-soft); }
.kv-table td:first-child { color: var(--text-3); width: 120px; }

/* 轮播提示 */
.tips { background: #fffbeb; border: 1px solid #fde68a; border-radius: 12px; padding: 12px 16px; font-size: 13px; color: #92400e; margin-top: 14px; }
.tips b { font-weight: 700; }

/* 二维码 */
.qr-preview { display: grid; place-items: center; padding: 22px; }
.qr-preview img, .qr-preview svg { border: 1px solid var(--border); border-radius: 10px; background: #fff; }

/* 空状态 */
.empty { text-align: center; color: var(--text-3); padding: 40px 0; font-size: 14px; }
.empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty p { margin-bottom: 6px; }
.empty-tip { font-size: 13px; }
.empty-tags { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.chip {
  border: 1px solid var(--border); background: #fff; color: var(--text-2);
  padding: 6px 14px; border-radius: 999px; font-size: 13px; cursor: pointer;
  transition: border-color .2s, color .2s, background .2s;
}
.chip:hover { border-color: var(--brand); color: var(--brand); background: var(--grad-soft); }

/* ============ Toast ============ */
.toast-container { position: fixed; top: 78px; right: 20px; z-index: 999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: #1c2033;
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 13.5px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 9px;
  animation: toastIn .3s ease;
  max-width: 340px;
}
.toast.success { background: #065f46; }
.toast.error { background: #991b1b; }
.toast.info { background: #1e3a8a; }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }

/* ============ 页脚 ============ */
.site-footer { margin-top: auto; background: #15182a; color: #9aa1b5; padding: 48px 0 26px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; }
.footer-logo { font-size: 18px; font-weight: 800; color: #fff; margin-bottom: 10px; }
.footer-desc { font-size: 13.5px; line-height: 1.7; }
.footer-col h4 { color: #fff; font-size: 14px; margin-bottom: 12px; }
.footer-col a { display: block; font-size: 13.5px; padding: 4px 0; color: #9aa1b5; transition: color .2s; }
.footer-col a:hover { color: #a5b4fc; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .08);
  margin-top: 34px;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  flex-wrap: wrap;
  gap: 8px;
}
.footer-bottom a { color: #9aa1b5; text-decoration: none; transition: color .2s; }
.footer-bottom a:hover { color: #a5b4fc; }

/* ============ 响应式 ============ */
@media (max-width: 860px) {
  .header-inner { gap: 14px; }
  .main-nav { display: none; }
  .privacy-badge { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .hero { padding: 44px 0 24px; }
  .hero-stats { gap: 22px; }
  .api-grid { grid-template-columns: 1fr; }
}

/* ============ 服务架构（apex-rpc 接口映射） ============ */
.api-intro {
  font-size: 14px;
  color: var(--text-2);
  margin: -6px 0 18px;
  max-width: 780px;
}
.api-intro p { margin-bottom: 7px; line-height: 1.75; }
.api-intro p:last-child { margin-bottom: 0; }
.api-intro b { color: var(--text); font-weight: 700; }
.api-intro code {
  background: var(--bg-soft);
  border-radius: 6px;
  padding: 1px 7px;
  font-size: 12.5px;
  color: var(--brand);
}
.api-tag {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  margin-right: 4px;
  vertical-align: 1px;
  letter-spacing: .3px;
}
.tag-safe  { background: #dcfce7; color: #166534; }
.tag-useful { background: #fef3c7; color: #92400e; }
.tag-easy  { background: #e0e7ff; color: #3730a3; }

.api-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.api-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform .25s, box-shadow .25s;
  display: flex;
  flex-direction: column;
}
.api-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.api-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.api-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--grad-soft);
  display: grid;
  place-items: center;
  font-size: 21px;
  flex: none;
}
.api-card-head h3 { font-size: 15.5px; font-weight: 800; margin: 0; }
.api-pkg {
  font-size: 11.5px;
  color: var(--text-3);
  background: var(--bg-soft);
  border-radius: 5px;
  padding: 0 6px;
}
.api-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .4px;
  color: var(--brand);
  background: var(--grad-soft);
  border: 1px solid #e3e2ff;
  border-radius: 999px;
  padding: 3px 10px;
  flex: none;
}
.api-desc { font-size: 13px; color: var(--text-2); margin-bottom: 12px; }

.api-rpcs { list-style: none; margin-top: auto; }
.api-rpcs li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px dashed var(--border);
  font-size: 12.5px;
  color: var(--text-2);
}
.api-rpcs code {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand);
  background: var(--grad-soft);
  border-radius: 6px;
  padding: 1px 8px;
  white-space: nowrap;
}
