:root {
  --green: #4a7a01;
  --green-light: #85b82e;
  --green-wash: #f2f7e9;
  --ink: #171914;
  --muted: #65695f;
  --line: #dfe3da;
  --paper: #fffefa;
  --white: #ffffff;
  --shadow: 0 18px 48px rgba(31, 46, 10, 0.08);
  --radius: 20px;
  --page: min(1120px, calc(100% - 40px));
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body {
  margin: 0;
  min-width: 0;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  line-height: 1.65;
}
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
:focus-visible { outline: 3px solid rgba(133, 184, 46, 0.65); outline-offset: 3px; }
.skip-link { position: fixed; left: 12px; top: 10px; z-index: 20; transform: translateY(-150%); background: var(--ink); color: white; padding: 10px 14px; border-radius: 10px; }
.skip-link:focus { transform: none; }
.page-shell { width: var(--page); margin-inline: auto; }

.site-header {
  width: var(--page);
  min-height: 74px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 700; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--green); color: white; font-family: Georgia, serif; }
.top-nav { display: flex; align-items: center; gap: 22px; font-size: 14px; }
.top-nav a { min-height: 44px; display: inline-flex; align-items: center; color: var(--muted); text-decoration: none; }
.top-nav a:hover { color: var(--green); }

.hero { padding-block: clamp(70px, 12vw, 138px) clamp(64px, 9vw, 110px); }
.eyebrow { margin: 0 0 18px; color: var(--green); font-size: 12px; font-weight: 800; letter-spacing: 0.16em; }
.hero h1 { max-width: 760px; margin: 0; font-size: clamp(54px, 9vw, 112px); line-height: 0.95; letter-spacing: -0.065em; }
.hero h1 span { color: var(--green); }
.hero-copy { max-width: 650px; margin: 32px 0 0; color: var(--muted); font-size: clamp(17px, 2.2vw, 22px); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 999px; padding: 10px 20px; cursor: pointer; text-decoration: none; font-weight: 700; }
.button-primary { background: var(--green); color: white; }
.button-primary:hover { background: #3c6500; }
.button-quiet { border-color: var(--line); background: var(--white); color: var(--ink); }

.featured-wrap { padding-bottom: clamp(72px, 10vw, 120px); }
.featured-card { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; align-items: center; gap: 28px; min-height: 190px; padding: clamp(28px, 5vw, 56px); border: 1px solid rgba(74, 122, 1, 0.3); border-radius: 28px; background: linear-gradient(125deg, #f0f6e6, #fbfcf5); box-shadow: var(--shadow); text-decoration: none; }
.featured-kicker { align-self: start; color: var(--green); font-size: 13px; font-weight: 800; }
.featured-content { display: grid; gap: 10px; min-width: 0; }
.featured-content strong { font-size: clamp(27px, 4vw, 46px); line-height: 1.15; letter-spacing: -0.035em; }
.featured-content > span { max-width: 700px; color: var(--muted); }
.featured-arrow { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: var(--green); color: white; font-size: 26px; transition: transform 180ms ease; }
.featured-card:hover .featured-arrow { transform: translateX(5px); }

.catalog { padding-bottom: 96px; }
.section-intro { max-width: 680px; }
.section-intro h2 { margin: 0; font-size: clamp(36px, 6vw, 68px); line-height: 1; letter-spacing: -0.05em; }
.section-intro > p:last-child { color: var(--muted); font-size: 17px; }
.jump-nav { display: flex; gap: 10px; overflow-x: auto; margin: 34px 0 58px; padding: 2px 2px 10px; scrollbar-width: thin; }
.jump-nav a { flex: 0 0 auto; min-height: 44px; display: inline-flex; align-items: center; padding: 8px 15px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: var(--muted); text-decoration: none; font-size: 14px; }
.jump-nav a:hover { border-color: var(--green-light); color: var(--green); }
.catalog-section { scroll-margin-top: 24px; padding: 56px 0; border-top: 1px solid var(--line); }
.category-head { display: grid; grid-template-columns: minmax(220px, 0.85fr) minmax(260px, 1.15fr); gap: 40px; margin-bottom: 28px; }
.category-index { color: var(--green-light); font: 700 13px/1 system-ui, sans-serif; letter-spacing: 0.12em; }
.category-head h3 { margin: 11px 0 0; font-size: clamp(30px, 4.5vw, 48px); line-height: 1.1; letter-spacing: -0.035em; }
.category-head p { align-self: end; margin: 0; color: var(--muted); }
.tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tool-card { min-width: 0; min-height: 230px; display: flex; flex-direction: column; padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: 0 8px 24px rgba(37, 45, 28, 0.03); }
.tool-card:hover { border-color: rgba(74, 122, 1, 0.42); }
.tool-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.tool-card h4 { margin: 0; font-size: 21px; line-height: 1.32; letter-spacing: -0.018em; }
.tool-card p { margin: 15px 0 24px; color: var(--muted); font-size: 15px; }
.badge { flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 28px; padding: 4px 9px; border-radius: 999px; background: var(--green-wash); color: var(--green); font-size: 11px; font-weight: 800; }
.badge.protected { background: #f3f1ec; color: #655e50; }
.tool-footer { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-top: auto; }
.tool-meta { color: #858a80; font-size: 12px; line-height: 1.45; }
.tool-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.text-link, .protected-trigger, .copy-command { min-height: 44px; display: inline-flex; align-items: center; gap: 4px; border: 0; padding: 6px 0 6px 12px; background: none; color: var(--green); cursor: pointer; font: inherit; font-weight: 800; text-decoration: none; }
.copy-command:focus-visible { outline: 3px solid rgba(133, 184, 46, 0.28); outline-offset: 3px; }
.detail-list { display: flex; flex-wrap: wrap; gap: 6px; margin: -8px 0 22px; padding: 0; list-style: none; }
.detail-list li { padding: 5px 9px; border-radius: 999px; background: #f6f7f3; color: var(--muted); font-size: 12px; }
.load-error { padding: 24px; border: 1px solid #d6a54d; border-radius: 16px; background: #fff9ec; }

.site-footer { display: flex; justify-content: space-between; gap: 30px; padding-block: 36px 60px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.site-footer p { margin: 0; }
.site-footer a { min-height: 44px; display: inline-flex; align-items: center; color: var(--green); font-weight: 700; text-decoration: none; }

.protected-dialog { width: min(480px, calc(100% - 32px)); border: 1px solid var(--line); border-radius: 24px; padding: 34px; box-shadow: var(--shadow); }
.protected-dialog::backdrop { background: rgba(19, 22, 17, 0.46); backdrop-filter: blur(3px); }
.protected-dialog h2 { margin: 0; font-size: 28px; }
.protected-dialog p:not(.eyebrow) { color: var(--muted); }
.dialog-close { position: absolute; right: 14px; top: 12px; width: 44px; height: 44px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 28px; }

.pw-overlay { position: fixed; inset: 0; z-index: 1000; display: none; place-items: center; padding: 24px; background: rgba(17, 19, 15, 0.56); }
.pw-overlay.show { display: grid; }
.pw-box { position: relative; width: min(100%, 430px); padding: 32px; border: 1px solid var(--line); background: var(--surface); box-shadow: 0 24px 70px rgba(18, 22, 14, 0.2); }
.pw-box h2 { margin: 0; font-size: 28px; }
.pw-sub { margin: 10px 0 22px; color: var(--muted); }
.pw-label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 13px; font-weight: 700; }
.pw-input { width: 100%; min-height: 50px; border: 1px solid var(--line); padding: 10px 13px; background: white; color: var(--ink); font: inherit; }
.pw-input:focus { border-color: var(--green); outline: 3px solid rgba(133, 184, 46, 0.25); }
.pw-input.error { border-color: #b42318; animation: pw-shake 180ms ease-in-out 2; }
.pw-error { display: none; margin-top: 8px; color: #9b2319; font-size: 13px; }
.pw-error.show { display: block; }
.pw-btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.pw-close { position: absolute; right: 10px; top: 8px; width: 44px; height: 44px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 27px; }
@keyframes pw-shake { 0%,100% { transform: translateX(0); } 50% { transform: translateX(4px); } }

@media (max-width: 760px) {
  :root { --page: min(100% - 28px, 680px); }
  .site-header { min-height: 66px; }
  .top-nav a:first-child, .top-nav a:last-child { display: none; }
  .top-nav { text-align: right; }
  .hero { padding-top: 62px; }
  .featured-card { grid-template-columns: 1fr auto; gap: 18px; }
  .featured-kicker { grid-column: 1 / -1; }
  .category-head { grid-template-columns: 1fr; gap: 14px; }
  .tool-grid { grid-template-columns: 1fr; }
  .tool-card { min-height: 0; }
}

@media (max-width: 420px) {
  :root { --page: calc(100% - 24px); }
  .brand > span:last-child { font-size: 14px; }
  .top-nav { font-size: 12px; }
  .hero h1 { font-size: clamp(50px, 17vw, 70px); }
  .hero-actions .button { width: 100%; }
  .featured-card { padding: 24px; }
  .featured-arrow { width: 46px; height: 46px; }
  .tool-card { padding: 22px; }
  .tool-footer { align-items: flex-start; flex-direction: column; }
  .tool-actions { justify-content: flex-start; }
  .text-link, .protected-trigger { padding-left: 0; padding-right: 14px; }
  .site-footer { flex-direction: column; gap: 8px; }
}

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

/* 2026-08 UI refinement: content-first, mobile-first */
:root {
  --surface: #ffffff;
  --surface-soft: #f0f0ed;
  --paper: #f5f5f3;
  --ink: #151713;
  --muted: #62675d;
  --line: #dde1d7;
  --shadow: 0 12px 36px rgba(31, 45, 12, 0.06);
  --page: min(100% - 48px, 1160px);
}

body { overflow-wrap: anywhere; }
a, button { touch-action: manipulation; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.nav-short { display: inline; }
.nav-full { display: none; }

.site-header {
  min-height: 64px;
  gap: 12px;
}
.brand { gap: 8px; font-size: 14px; }
.brand-mark { width: 28px; height: 28px; }
.top-nav { gap: 8px; font-size: 13px; }
.top-nav a { min-height: 48px; color: var(--ink); font-weight: 700; }
.top-nav a:last-child { display: none; }

.hero { padding-block: 56px 44px; }
.eyebrow { margin-bottom: 14px; font-size: 11px; letter-spacing: 0.14em; }
.hero h1 { max-width: 680px; font-size: clamp(48px, 15vw, 72px); line-height: 0.96; letter-spacing: -0.06em; }
.hero-copy { max-width: 560px; margin-top: 24px; font-size: 16px; line-height: 1.75; }
.main-site-entry {
  width: fit-content;
  max-width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  color: var(--green);
  font-size: clamp(12px, 3.6vw, 14px);
  font-weight: 700;
  line-height: 1.55;
  text-decoration: none;
  white-space: nowrap;
}
.main-site-entry svg { flex: 0 0 auto; transition: transform 180ms ease; }
.main-site-entry:hover svg, .main-site-entry:focus-visible svg { transform: translateX(4px); }

.featured-wrap { padding-bottom: 56px; }
.featured-card {
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 16px;
  padding: 24px;
  border-radius: 0;
  background: var(--green);
  border-color: var(--green);
  box-shadow: none;
  color: white;
}
.featured-kicker { grid-column: 1 / -1; color: rgba(255,255,255,0.74); font-size: 11px; letter-spacing: 0.12em; }
.featured-content { gap: 8px; }
.featured-content strong { font-size: clamp(24px, 7vw, 34px); line-height: 1.2; letter-spacing: -0.035em; }
.featured-content > span { color: rgba(255,255,255,0.78); font-size: 15px; line-height: 1.65; }
.featured-arrow { width: 44px; height: 44px; align-self: center; background: white; color: var(--green); }
.featured-card:active { background: #3f6900; }

.catalog { padding-bottom: 72px; }
.catalog-section {
  padding: 48px 0;
  border-top: 1px solid var(--line);
}
.category-head {
  display: block;
  margin-bottom: 24px;
}
.category-index { display: block; margin-bottom: 10px; font-size: 12px; }
.category-head h3 { margin: 0; font-size: clamp(28px, 8vw, 38px); line-height: 1.15; }
.category-description { margin-top: 12px !important; font-size: 16px; line-height: 1.7; }
.tool-grid { grid-template-columns: 1fr; gap: 12px; }
.tool-card {
  min-height: 0;
  padding: 22px 20px 18px;
  border-radius: 0;
  background: var(--surface);
  box-shadow: 0 5px 18px rgba(22, 28, 17, 0.055);
  transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}
.tool-card:has(a:hover), .tool-card:has(button:hover) { border-color: rgba(74, 122, 1, 0.5); box-shadow: var(--shadow); }
.tool-card h4 { max-width: 78%; font-size: 20px; line-height: 1.4; }
.tool-card p { margin: 12px 0 20px; font-size: 16px; line-height: 1.7; }
.badge { min-height: 26px; padding: 3px 8px; font-size: 11px; }
.tool-footer { align-items: center; }
.tool-meta { max-width: 60%; font-size: 12px; }
.tool-actions { gap: 10px; }
.text-link, .protected-trigger, .copy-command {
  min-width: 48px;
  min-height: 48px;
  gap: 6px;
  padding: 8px 0 8px 12px;
  transition: color 180ms ease, opacity 180ms ease;
}
.text-link:active, .protected-trigger:active, .copy-command:active { opacity: 0.62; }
.detail-list { margin-bottom: 18px; gap: 8px; }
.detail-list li { font-size: 12px; }
.site-footer { justify-content: flex-end; align-items: flex-end; padding-block: 28px 48px; font-size: 14px; }
.footer-main-link { min-height: 48px; display: inline-flex; align-items: center; gap: 8px; color: var(--green); font-weight: 800; text-decoration: none; }
.footer-main-link svg { transition: transform 180ms ease; }
.footer-main-link:hover svg, .footer-main-link:focus-visible svg { transform: translateX(4px); }

@media (min-width: 620px) {
  :root { --page: min(100% - 56px, 1160px); }
  .nav-short { display: none; }
  .nav-full { display: inline; }
  .top-nav a:last-child { display: inline-flex; }
  .hero { padding-block: 80px 64px; }
  .hero h1 { font-size: clamp(68px, 10vw, 104px); }
  .hero-copy { font-size: 18px; }
  .featured-card { grid-template-columns: 112px minmax(0, 1fr) 52px; padding: 34px; gap: 24px; }
  .featured-kicker { grid-column: auto; }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 960px) {
  .site-header { min-height: 72px; }
  .hero { padding-block: 104px 80px; }
  .featured-wrap { padding-bottom: 96px; }
  .featured-card { padding: 42px 44px; border-radius: 0; }
  .featured-content strong { font-size: 38px; }
  .catalog-section { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 64px; padding: 64px 0; }
  .category-head { position: sticky; top: 24px; align-self: start; margin-bottom: 0; }
  .category-head h3 { font-size: 36px; }
  .category-description { max-width: 250px; }
  .tool-card { padding: 24px; }
  .site-footer { flex-direction: row; }
}

@media (min-width: 960px) {
  .catalog-section { display: block; }
  .category-head,
  .tool-grid { width: 100%; margin-inline: auto; }
  .category-head { position: static; margin-bottom: 28px; }
  .category-description { max-width: 620px; }
}

/* Alignment correction: explicit optical centering on phones, full-width grid on desktop */
.catalog-section { width: 100%; }
.category-head,
.tool-grid {
  width: calc(100% - 8px);
  margin-left: auto;
  margin-right: auto;
}
.tool-grid { justify-items: stretch; }
.tool-card { width: 100%; }

@media (min-width: 620px) {
  .category-head,
  .tool-grid { width: 100%; }
}

@media (min-width: 960px) {
  .category-head,
  .tool-grid { width: 100%; }
}

@media (max-width: 359px) {
  :root { --page: calc(100% - 40px); }
  .brand > span:last-child { display: none; }
  .hero h1 { font-size: 46px; }
  .featured-card { padding: 20px; }
  .tool-card { padding-inline: 18px; }
}

/* Compact mobile directory: quieter type, tighter rhythm, unchanged 44px touch targets */
@media (max-width: 619px) {
  :root { --page: calc(100% - 36px); }
  .site-header { min-height: 58px; }
  .brand { font-size: 13px; }
  .top-nav { font-size: 12px; }
  .top-nav a { min-height: 44px; }

  .hero { padding-block: 36px 30px; }
  .eyebrow { margin-bottom: 10px; font-size: 10px; }
  .hero h1 { max-width: 300px; font-size: clamp(40px, 12.5vw, 50px); line-height: 1; letter-spacing: -0.055em; }
  .hero-copy { max-width: 330px; margin-top: 16px; font-size: 14px; line-height: 1.6; }
  .main-site-entry { min-height: 44px; margin-top: 12px; font-size: 12px; }

  .featured-wrap { padding-bottom: 38px; }
  .featured-card { grid-template-columns: minmax(0, 1fr) 40px; gap: 12px; padding: 18px; }
  .featured-kicker { font-size: 10px; }
  .featured-content { gap: 5px; }
  .featured-content strong { font-size: 20px; line-height: 1.25; }
  .featured-content > span { font-size: 13px; line-height: 1.5; }
  .featured-arrow { width: 40px; height: 40px; }

  .catalog { padding-bottom: 50px; }
  .catalog-section { padding: 34px 0; }
  .category-head { width: 100%; margin-bottom: 16px; }
  .category-index { margin-bottom: 7px; font-size: 10px; }
  .category-head h3 { font-size: 23px; line-height: 1.2; }
  .category-description { margin-top: 7px !important; font-size: 13px; line-height: 1.55; }
  .tool-grid { width: 100%; gap: 9px; }
  .tool-card { padding: 16px 16px 12px; box-shadow: 0 4px 14px rgba(22, 28, 17, 0.045); }
  .tool-card-top { gap: 10px; }
  .tool-card h4 { max-width: 76%; font-size: 16px; line-height: 1.35; }
  .tool-card p { margin: 8px 0 12px; font-size: 13px; line-height: 1.55; }
  .badge { min-height: 23px; padding: 2px 7px; font-size: 10px; }
  .detail-list { gap: 5px; margin: -2px 0 10px; }
  .detail-list li { padding: 4px 7px; font-size: 10px; }
  .tool-footer { align-items: flex-end; gap: 8px; }
  .tool-meta { max-width: 48%; font-size: 10px; line-height: 1.4; }
  .tool-actions { gap: 8px; }
  .text-link, .protected-trigger, .copy-command { min-width: 44px; min-height: 44px; gap: 4px; padding: 5px 0 5px 8px; font-size: 12px; }
  .site-footer { padding-block: 20px 34px; font-size: 12px; }
  .footer-main-link { min-height: 44px; }
}

@media (max-width: 359px) {
  :root { --page: calc(100% - 32px); }
  .hero h1 { font-size: 38px; }
  .featured-card { padding: 16px; }
  .tool-card { padding-inline: 14px; }
}
