:root {
  color-scheme: light;
  --canvas: #e9e4db;
  --paper: #f5f0e6;
  --card: #fffaf1;
  --ink: #292b2c;
  --muted: #706c66;
  --line: #c9c0b4;
  --buy: #d7583d;
  --query: #277d75;
  --guide: #bd8c20;
  --plugin: #566e9f;
  --extract: #8c5e9b;
  --shadow: 0 24px 70px rgba(73, 64, 55, 0.13);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  text-rendering: optimizeLegibility;
}
button, input, textarea { font: inherit; }
a { color: inherit; }
img, video { display: block; max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
button, .button, .entry-card, .bookmarklet { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid rgba(39, 125, 117, .42); outline-offset: 4px; }

.home-body { min-height: 100vh; padding: 28px; }
.home-shell, .page {
  position: relative;
  width: min(1180px, 100%);
  margin: 0 auto;
  overflow: hidden;
  border-radius: 28px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.home-shell { min-height: calc(100vh - 56px); padding: 38px 40px 26px; }
.home-shell::before, .home-shell::after {
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  content: "";
  pointer-events: none;
}
.home-shell::before { width: 440px; height: 440px; right: -205px; top: -105px; border: 1px solid rgba(215, 88, 61, .38); }
.home-shell::after { width: 280px; height: 280px; left: -160px; bottom: -175px; background: rgba(39, 125, 117, .09); }
.home-topbar, .site-header, .wordmark, .home-greeting, .home-hero, .entry-grid, .site-note { position: relative; z-index: 1; }
.home-topbar, .site-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.wordmark { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); font-weight: 900; letter-spacing: -.035em; text-decoration: none; }
.wordmark img { width: 34px; height: 34px; }
.home-greeting { color: var(--muted); font-size: 12px; }
.home-hero { margin: clamp(62px, 10vh, 110px) 0 42px; }
.eyebrow { margin-bottom: 11px; color: var(--buy); font-size: 12px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
.home-hero h1, .page-hero h1, .tool-intro h1 {
  margin-bottom: 16px;
  font-family: Georgia, "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(46px, 6vw, 78px);
  font-weight: 600;
  line-height: 1.03;
  letter-spacing: -.055em;
}
.home-hero > p:last-child, .lead, .tool-intro > p:last-child { color: var(--muted); line-height: 1.75; }
.entry-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 13px; }
.entry-card {
  --accent: var(--buy);
  min-width: 0;
  min-height: 168px;
  padding: 19px;
  border: 1px solid #a8a197;
  border-top: 6px solid var(--accent);
  border-radius: 16px;
  background: var(--card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--ink);
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.entry-card:hover { transform: translateY(-5px); border-color: var(--accent); box-shadow: 0 15px 30px rgba(91, 78, 61, .12); }
.entry-card b { display: block; margin-bottom: 7px; font-size: 20px; }
.entry-card small { display: block; color: var(--muted); font-size: 12px; line-height: 1.55; }
.entry-card i { align-self: flex-end; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--accent); font-size: 19px; font-style: normal; }
.entry-query { --accent: var(--query); }
.entry-guide { --accent: var(--guide); }
.entry-plugin { --accent: var(--plugin); }
.entry-extract { --accent: var(--extract); }
.site-note { margin: 26px 0 0; color: var(--muted); font-size: 12px; text-align: center; }

.page { padding: 28px 40px 40px; }
.site-header { margin-bottom: 74px; }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a { border-radius: 999px; padding: 9px 12px; color: var(--muted); font-size: 12px; font-weight: 700; text-decoration: none; }
.site-nav a:hover, .site-nav a.is-active { color: var(--ink); background: rgba(255, 255, 255, .65); }
.page-hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(260px, .7fr); gap: 56px; align-items: center; margin-bottom: 80px; }
.page-hero h1, .tool-intro h1 { font-size: clamp(42px, 5vw, 68px); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.button, button {
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
}
.button.primary, button:not(.secondary) { color: #fff; background: var(--query); }
.hero-buy .button.primary { background: var(--buy); }
.button.secondary, button.secondary { border-color: var(--line); color: var(--ink); background: rgba(255,255,255,.65); }
button:disabled { cursor: wait; opacity: .58; }
.metric-card { min-height: 285px; padding: 28px; border: 1px solid #db8a76; border-radius: 22px; display: flex; flex-direction: column; justify-content: center; background: #fff7ec; }
.metric-card span, .metric-card small { color: var(--muted); }
.metric-card strong { margin: 8px 0 -4px; color: var(--buy); font-family: Georgia, serif; font-size: clamp(80px, 10vw, 124px); font-weight: 500; line-height: 1; }
.metric-card b { margin-bottom: 18px; font-size: 17px; }
.content-section { margin-top: 18px; padding: 42px 0; border-top: 1px solid var(--line); }
.section-heading { max-width: 650px; margin-bottom: 26px; }
.section-heading h2 { margin-bottom: 10px; font-family: Georgia, "Noto Serif SC", serif; font-size: clamp(30px, 4vw, 44px); font-weight: 600; letter-spacing: -.035em; }
.section-heading > p:last-child { color: var(--muted); line-height: 1.7; }
.card-grid { display: grid; gap: 13px; }
.card-grid.three { grid-template-columns: repeat(3, 1fr); }
.info-card, .notice-list article { border: 1px solid var(--line); border-radius: 16px; padding: 22px; background: rgba(255, 250, 241, .85); }
.info-card h3 { margin-bottom: 8px; }
.info-card p, .notice-list span { margin-bottom: 0; color: var(--muted); line-height: 1.7; }
.split-section { display: grid; grid-template-columns: .9fr 1.1fr; gap: 60px; }
.notice-list { display: grid; gap: 10px; }
.notice-list article { display: grid; grid-template-columns: 120px 1fr; gap: 20px; }
.faq-list { display: grid; gap: 10px; }
.faq-list details { border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; background: rgba(255,255,255,.35); }
.faq-list summary { cursor: pointer; font-weight: 800; }
.faq-list details p { margin: 12px 0 0; color: var(--muted); line-height: 1.7; }

.tool-intro { max-width: 730px; margin-bottom: 34px; }
.tool-intro .eyebrow { color: var(--query); }
.tool-layout { display: grid; grid-template-columns: minmax(300px, .75fr) minmax(0, 1.25fr); gap: 14px; }
.tool-panel, .result-panel, .extract-panel { border: 1px solid var(--line); border-radius: 19px; padding: 24px; background: rgba(255, 250, 241, .88); }
.field { display: grid; gap: 9px; }
label { font-size: 13px; font-weight: 900; }
textarea { width: 100%; min-height: 176px; border: 1px solid var(--line); border-radius: 13px; padding: 14px; color: var(--ink); background: #fffdf8; outline: 0; resize: vertical; font-family: Consolas, "Microsoft YaHei", monospace; line-height: 1.55; }
textarea:focus { border-color: var(--query); box-shadow: 0 0 0 4px rgba(39, 125, 117, .1); }
.query-actions, .actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 13px; }
.progress-wrap { height: 5px; margin-top: 20px; overflow: hidden; border-radius: 99px; background: #dcd5ca; opacity: 0; }
.progress-wrap.is-visible { opacity: 1; }
.progress-bar { width: 0; height: 100%; background: var(--query); transition: width .2s ease; }
.progress-meta { display: flex; justify-content: space-between; margin-top: 9px; color: var(--muted); font-size: 11px; }
.result-panel { min-width: 0; padding: 0; overflow: hidden; }
.result-head, .result-row { display: grid; grid-template-columns: minmax(190px, 1.2fr) 70px 90px minmax(130px, 1fr); gap: 10px; align-items: center; }
.result-head { padding: 14px 17px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 800; }
.result-list { min-height: 278px; }
.empty-state { min-height: 278px; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.result-row { padding: 13px 17px; border-bottom: 1px solid rgba(201, 192, 180, .65); font-size: 12px; }
.result-row:last-child { border-bottom: 0; }
.token-wrap { display: flex; align-items: center; min-width: 0; gap: 8px; }
.token-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: Consolas, monospace; }
.copy-token { min-height: 30px; padding: 0 10px; color: var(--query); background: transparent; border-color: var(--line); font-size: 10px; }
.status { width: fit-content; border-radius: 999px; padding: 4px 7px; background: #eee8de; }
.status.success { color: #176a55; background: #dceee7; }
.status.fail { color: #a24436; background: #f5dfda; }
.inline-note { margin-top: 14px; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; display: flex; gap: 12px; background: rgba(255,255,255,.35); color: var(--muted); font-size: 13px; }
.inline-note b { color: var(--ink); }

.hero-guide { grid-template-columns: 1fr 1fr; }
.hero-guide .eyebrow { color: var(--guide); }
.bookmark-stage { min-height: 280px; border: 1px dashed #a38332; border-radius: 22px; padding: 28px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: rgba(255, 248, 221, .65); text-align: center; }
.bookmark-stage > span { font-weight: 800; }
.bookmark-stage small { color: var(--muted); }
.bookmarklet { min-height: 52px; border-radius: 999px; padding: 0 25px; display: inline-flex; align-items: center; color: #fff; background: var(--query); font-weight: 900; text-decoration: none; box-shadow: 0 10px 25px rgba(39,125,117,.2); }
.steps { margin: 0 0 28px; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.steps li { min-height: 145px; border: 1px solid var(--line); border-radius: 16px; padding: 19px; background: var(--card); }
.steps li > span { display: block; margin-bottom: 25px; color: var(--guide); font: 700 12px/1 Consolas, monospace; }
.steps b { display: block; margin-bottom: 7px; }
.steps p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.bookmark-guide { position: relative; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #fff; user-select: none; }
.bookmark-guide::after { position: absolute; inset: auto 12px 12px; border-radius: 10px; padding: 8px; color: #fff; background: rgba(41,43,44,.82); content: "演示图不能拖动；请先确认书签栏已显示，再拖上方绿色按钮"; font-size: 11px; text-align: center; pointer-events: none; }
.bookmark-guide img { width: 100%; pointer-events: none; }
.media-section { display: grid; grid-template-columns: .7fr 1.3fr; gap: 55px; align-items: start; }
.tutorial-video { overflow: hidden; border-radius: 18px; background: #141414; box-shadow: 0 18px 40px rgba(43,38,32,.16); }
.tutorial-video video { width: 100%; aspect-ratio: 16/9; }

.download-panel { border: 1px solid var(--line); border-radius: 19px; padding: 24px; display: flex; justify-content: space-between; gap: 24px; align-items: center; background: var(--card); }
.download-panel p { margin: 0; color: var(--muted); line-height: 1.7; }
.hero-plugin .eyebrow { color: var(--plugin); }
.hero-plugin .button.primary { background: var(--plugin); }
.extract-page .eyebrow { color: var(--extract); }
.extract-page .button.primary, .extract-page button:not(.secondary) { background: var(--extract); }
.extract-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 14px; align-items: start; }
.extract-copy { padding: 18px 16px 0 0; }
.extract-copy h1 { margin-bottom: 16px; font-family: Georgia, "Noto Serif SC", serif; font-size: clamp(42px, 5vw, 66px); line-height: 1.04; letter-spacing: -.05em; }
.extract-copy p { color: var(--muted); line-height: 1.75; }
.result { display: none; margin-top: 18px; border-top: 1px solid var(--line); padding-top: 18px; }
.result.is-visible { display: block; }
.result-summary { margin-bottom: 14px; font-weight: 900; }
.jwt-result-toolbar { margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.jwt-select-all { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.jwt-select-all input, .jwt-row-checkbox { width: 17px; height: 17px; margin: 0; accent-color: var(--extract); }
.jwt-select-all span { color: var(--muted); font-size: 11px; font-weight: 700; }
.jwt-result-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.jwt-result-actions button { min-height: 38px; padding: 0 14px; font-size: 11px; }
#copy-selected-button:disabled { cursor: not-allowed; }
.jwt-result-table-wrap { max-height: 360px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: #fffdf8; }
.jwt-result-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.jwt-result-table th { position: sticky; z-index: 1; top: 0; padding: 10px 9px; color: var(--muted); background: #f3ede3; font-size: 10px; text-align: left; }
.jwt-result-table th:first-child { width: 56px; text-align: center; }
.jwt-result-table th:nth-child(2) { width: 178px; }
.jwt-result-table th:last-child { width: 64px; text-align: center; }
.jwt-result-table td { min-width: 0; padding: 11px 9px; border-top: 1px solid rgba(201, 192, 180, .62); vertical-align: middle; }
.jwt-select-cell, .jwt-copy-cell { text-align: center; }
.jwt-card-cell code, .jwt-result-token { display: block; overflow: hidden; color: var(--ink); font: 12px/1.45 Consolas, "Microsoft YaHei", monospace; text-overflow: ellipsis; white-space: nowrap; }
.jwt-result-token { color: var(--muted); }
.jwt-row-copy { width: auto; min-height: 30px; padding: 0 10px; border-color: var(--line); color: var(--extract); background: transparent; font-size: 10px; }
.failed-list { display: none; margin-top: 12px; border-radius: 12px; padding: 12px; color: #963b31; background: #f7e3df; font-size: 12px; line-height: 1.65; }
.failed-list.is-visible { display: block; }
.tips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.tip { border: 1px solid var(--line); border-radius: 15px; padding: 20px; background: rgba(255,255,255,.35); }
.tip p { margin: 8px 0 0; color: var(--muted); line-height: 1.7; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: 24px; transform: translate(-50%, 20px); border-radius: 999px; padding: 12px 18px; color: #fff; background: rgba(41,43,44,.94); opacity: 0; pointer-events: none; transition: .2s; }
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 1020px) {
  .entry-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .entry-card { min-height: 150px; }
  .site-header { align-items: flex-start; }
  .site-nav { max-width: 600px; justify-content: flex-end; flex-wrap: wrap; }
  .page-hero, .tool-layout, .extract-grid { grid-template-columns: 1fr; }
  .page-hero { gap: 28px; }
  .metric-card { min-height: 220px; }
}

@media (max-width: 720px) {
  .home-body { padding: 0; }
  .home-shell, .page { width: 100%; min-height: 100vh; border-radius: 0; box-shadow: none; }
  .home-shell { padding: 22px 18px 20px; }
  .home-shell::before { width: 270px; height: 270px; right: -155px; top: -80px; }
  .home-hero { margin: 48px 0 26px; }
  .home-hero h1 { margin-bottom: 10px; font-size: clamp(42px, 13vw, 58px); }
  .home-hero > p:last-child { margin-bottom: 0; font-size: 13px; }
  .entry-grid { grid-template-columns: 1fr; gap: 9px; }
  .entry-card { min-height: 92px; padding: 14px 15px; border-top-width: 1px; border-left: 6px solid var(--accent); flex-direction: row; align-items: center; }
  .entry-card b { margin-bottom: 4px; font-size: 18px; }
  .entry-card small { font-size: 11px; }
  .entry-card i { flex: 0 0 32px; width: 32px; height: 32px; }
  .site-note { margin-top: 18px; }
  .page { padding: 20px 18px 28px; }
  .site-header { margin-bottom: 54px; }
  .site-nav { display: none; }
  .page-hero { margin-bottom: 48px; }
  .page-hero h1, .tool-intro h1, .extract-copy h1 { font-size: 44px; }
  .hero-actions, .query-actions, .actions { display: grid; grid-template-columns: 1fr; }
  .button, button { width: 100%; }
  .card-grid.three, .split-section, .steps, .media-section, .tips { grid-template-columns: 1fr; }
  .split-section, .media-section { gap: 20px; }
  .notice-list article { grid-template-columns: 1fr; gap: 7px; }
  .content-section { padding: 32px 0; }
  .tool-layout { gap: 10px; }
  .tool-panel, .extract-panel { padding: 17px; }
  textarea { min-height: 150px; }
  .result-panel { overflow-x: auto; }
  .result-head, .result-row { min-width: 650px; }
  .inline-note { flex-direction: column; gap: 5px; }
  .bookmark-stage { min-height: 230px; padding: 20px; }
  .steps { gap: 9px; }
  .steps li { min-height: auto; display: grid; grid-template-columns: 42px 1fr; gap: 8px; }
  .steps li > span { margin: 4px 0 0; }
  .download-panel { align-items: stretch; flex-direction: column; }
  .download-actions .button { width: 100%; }
  .jwt-result-toolbar { align-items: stretch; flex-direction: column; }
  .jwt-result-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .jwt-result-table-wrap { max-height: 430px; overflow-x: hidden; }
  .jwt-result-table, .jwt-result-table tbody { display: block; }
  .jwt-result-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .jwt-result-row { padding: 11px; display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 8px; border-top: 1px solid var(--line); }
  .jwt-result-row:first-child { border-top: 0; }
  .jwt-result-table td { padding: 0; border: 0; }
  .jwt-select-cell { grid-column: 1; align-self: center; }
  .jwt-card-cell { grid-column: 2; align-self: center; }
  .jwt-copy-cell { grid-column: 3; }
  .jwt-token-cell { min-width: 0; grid-column: 1 / -1; border-radius: 8px !important; padding: 8px 10px !important; background: #f3ede3; }
  .jwt-card-cell code { font-size: 11px; }
  .jwt-result-token { font-size: 10px; }
  .jwt-row-copy { width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
