/* ==========================================================================
   Outdoor Photo Timing — global design system
   Warm paper + sun gold + night navy. Photographic, editorial, mobile-first.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --bg: #faf6ef;
  --surface: #ffffff;
  --ink: #292219;
  --ink-soft: #5c5040;
  --muted: #8c7d6a;
  --line: #eae1d3;
  --gold: #e07b1f;
  --gold-deep: #c25e0a;
  --gold-soft: #fdf0dd;
  --night: #16233c;
  --night-2: #1f3050;
  --night-soft: #2b3f63;
  --sky: #7fa8c9;
  --cream: #fffdf7;
  --ok: #1f8a4c;
  --warn: #b54708;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(41,34,25,.05), 0 6px 18px rgba(41,34,25,.06);
  --shadow-md: 0 2px 6px rgba(41,34,25,.06), 0 16px 40px rgba(41,34,25,.10);
  --font-display: Georgia, 'Iowan Old Style', 'Palatino Linotype', 'Times New Roman', serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --maxw: 1180px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--gold-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.22; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(1.9rem, 4.2vw, 3.1rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.45rem, 3vw, 2.05rem); }
h3 { font-size: 1.22rem; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.25em; }
li { margin-bottom: .4em; }
code { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: .92em; background: #f3ecdf; padding: .1em .35em; border-radius: 6px; }
table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: .95em; }
th, td { text-align: left; padding: .55em .7em; border-bottom: 1px solid var(--line); }
th { font-weight: 600; background: #f8f1e5; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--night); color: #fff; padding: .6em 1em; z-index: 200; }
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 90;
  background: rgba(22,35,60,.97);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.nav-inner { display: flex; align-items: center; gap: 18px; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; height: 62px; }
.nav-logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; color: #fff; text-decoration: none; letter-spacing: .01em; }
.nav-logo:hover { text-decoration: none; }
.nav-logo svg { width: 26px; height: 26px; }
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.nav-links a {
  color: #d9e0ee; font-size: .95rem; padding: 7px 12px; border-radius: 8px; transition: background .15s, color .15s;
}
.nav-links a:hover { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.nav-links a.active { color: #ffd9a8; background: rgba(224,123,31,.18); font-weight: 600; }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.lang-toggle { display: inline-flex; background: rgba(255,255,255,.1); border-radius: 999px; padding: 3px; }
.lang-toggle button {
  border: 0; background: transparent; color: #b9c3d6; font: 600 .82rem var(--font-body);
  padding: 5px 12px; border-radius: 999px; cursor: pointer; transition: background .15s, color .15s;
}
.lang-toggle button.on { background: var(--gold); color: #fff; }
.fav-btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.06); color: #fff; font: 600 .85rem var(--font-body);
  padding: 6px 12px; border-radius: 999px; cursor: pointer; transition: background .15s;
}
.fav-btn:hover { background: rgba(255,255,255,.14); }
.fav-btn .badge { background: var(--gold); color: #fff; border-radius: 999px; font-size: .72rem; padding: 1px 7px; min-width: 20px; text-align: center; }
.hamburger { display: none; border: 0; background: rgba(255,255,255,.08); border-radius: 8px; width: 42px; height: 42px; cursor: pointer; color: #fff; }
.hamburger svg { width: 22px; height: 22px; }
@media (max-width: 920px) {
  .nav-links {
    position: absolute; top: 62px; left: 0; right: 0; flex-direction: column; align-items: stretch;
    background: var(--night); padding: 10px 14px 16px; gap: 2px; display: none;
    border-bottom: 1px solid rgba(255,255,255,.1); box-shadow: var(--shadow-md);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; font-size: 1rem; border-radius: 10px; }
  .hamburger { display: inline-flex; align-items: center; justify-content: center; }
  .nav-actions .fav-btn span.lbl { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 .98rem var(--font-body); padding: 12px 22px; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer; transition: transform .12s, box-shadow .15s, background .15s;
  text-decoration: none; line-height: 1.2;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: linear-gradient(135deg, #f59e0b, #e07b1f); color: #fff; box-shadow: 0 8px 20px rgba(224,123,31,.32); }
.btn-primary:hover { box-shadow: 0 10px 26px rgba(224,123,31,.4); }
.btn-dark { background: var(--night); color: #fff; }
.btn-dark:hover { background: var(--night-2); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-deep); background: var(--gold-soft); }
.btn-light { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.35); backdrop-filter: blur(4px); }
.btn-light:hover { background: rgba(255,255,255,.26); }
.btn-sm { padding: 8px 15px; font-size: .88rem; }
.btn-block { width: 100%; }

/* ---------- Hero ---------- */
.hero {
  position: relative; color: #fff; overflow: hidden;
  background: var(--night);
}
.hero__media { position: absolute; inset: 0; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; }
.hero__scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15,24,44,.55) 0%, rgba(15,24,44,.35) 40%, rgba(15,24,44,.78) 100%); }
.hero__inner { position: relative; z-index: 2; max-width: var(--maxw); margin: 0 auto; padding: 96px 20px 84px; }
.hero__overline { display: inline-block; font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; color: #ffd9a8; font-weight: 600; margin-bottom: 14px; }
.hero h1 { color: #fff; max-width: 15em; margin-bottom: .35em; }
.hero__sub { font-size: 1.12rem; color: #e7ecf6; max-width: 40em; margin-bottom: 28px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero__meta { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 22px; color: #c9d3e4; font-size: .92rem; }
.hero__meta b { color: #fff; font-size: 1.15rem; display: block; line-height: 1.3; }

/* Live countdown card inside hero */
.hero-widget {
  margin-top: 34px; max-width: 560px; background: rgba(13,20,38,.72); border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--radius); padding: 18px 20px; backdrop-filter: blur(10px); box-shadow: var(--shadow-md);
}
.hero-widget__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.hero-widget__head .st { font-weight: 600; font-size: .95rem; color: #ffd9a8; }
.hero-widget__row { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-widget__num { font-family: var(--font-display); font-size: 1.65rem; font-weight: 700; color: #fff; line-height: 1.1; }
.hero-widget__lbl { font-size: .78rem; color: #aeb9cf; }

/* ---------- Sections ---------- */
.section { padding: 64px 0; }
.section--soft { background: var(--cream); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section--night { background: linear-gradient(160deg, var(--night) 0%, var(--night-2) 100%); color: #e7ecf6; }
.section--night h2, .section--night h3 { color: #fff; }
.section-head { max-width: 720px; margin-bottom: 36px; }
.section-head--center { margin-left: auto; margin-right: auto; text-align: center; }
.overline { display: inline-block; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-deep); font-weight: 700; margin-bottom: 10px; }
.section--night .overline { color: #ffb36b; }
.section-head p { color: var(--muted); font-size: 1.02rem; }
.section--night .section-head p { color: #b9c5da; }

/* ---------- Tool cards (photo background) ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.tool-card {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 250px; border-radius: var(--radius); overflow: hidden; color: #fff;
  box-shadow: var(--shadow-sm); text-decoration: none; isolation: isolate;
  transition: transform .18s, box-shadow .18s;
}
.tool-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); text-decoration: none; }
.tool-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.tool-card::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(16,24,44,.05) 30%, rgba(16,24,44,.88) 100%); transition: background .2s; }
.tool-card:hover::after { background: linear-gradient(180deg, rgba(16,24,44,.08) 20%, rgba(16,24,44,.92) 100%); }
.tool-card__body { padding: 20px; }
.tool-card__cat { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: #ffd9a8; font-weight: 700; margin-bottom: 6px; display: block; }
.tool-card h3 { color: #fff; font-size: 1.28rem; margin-bottom: 6px; }
.tool-card p { color: #dbe2ef; font-size: .9rem; margin: 0; }
.tool-card__star { position: absolute; top: 14px; right: 14px; z-index: 3; width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(255,255,255,.35); background: rgba(13,20,38,.5); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1rem; transition: background .15s; }
.tool-card__star:hover { background: rgba(224,123,31,.85); }
.tool-card__star.saved { background: var(--gold); }

/* ---------- Category cards ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.cat-card {
  position: relative; border-radius: var(--radius); overflow: hidden; min-height: 180px; color: #fff;
  display: flex; align-items: flex-end; text-decoration: none; isolation: isolate; box-shadow: var(--shadow-sm);
  transition: transform .18s, box-shadow .18s;
}
.cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); text-decoration: none; }
.cat-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.cat-card::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(16,24,44,.1) 20%, rgba(16,24,44,.85) 100%); }
.cat-card__body { padding: 18px; width: 100%; }
.cat-card h3 { color: #fff; font-size: 1.2rem; margin-bottom: 2px; }
.cat-card span { font-size: .84rem; color: #d5dcea; }

/* ---------- Article cards ---------- */
.article-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.article-card {
  display: block; background: var(--surface); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow-sm); text-decoration: none; color: var(--ink);
  transition: transform .18s, box-shadow .18s;
}
.article-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); text-decoration: none; }
.article-card__media { position: relative; height: 170px; overflow: hidden; }
.article-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.article-card:hover .article-card__media img { transform: scale(1.05); }
.article-card__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(16,24,44,.35)); }
.article-card__cat { position: absolute; left: 14px; top: 12px; z-index: 2; background: rgba(13,20,38,.72); color: #ffd9a8; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }
.article-card__body { padding: 16px 18px 18px; }
.article-card h3 { font-size: 1.06rem; margin-bottom: 6px; color: var(--ink); }
.article-card p { font-size: .9rem; color: var(--muted); margin: 0; }
.article-card time { font-size: .8rem; color: var(--muted); display: block; margin-top: 10px; }

/* ---------- Inner page hero ---------- */
.page-hero {
  position: relative; color: #fff; overflow: hidden; background: var(--night);
}
.page-hero__media { position: absolute; inset: 0; }
.page-hero__media img { width: 100%; height: 100%; object-fit: cover; object-position: center 60%; }
.page-hero__scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15,24,44,.35), rgba(15,24,44,.82)); }
.page-hero__inner { position: relative; z-index: 2; max-width: var(--maxw); margin: 0 auto; padding: 58px 20px 52px; }
.page-hero h1 { color: #fff; margin-bottom: .3em; }
.page-hero p { color: #e2e8f3; max-width: 46em; margin: 0; }
.page-hero .crumb { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: #ffd9a8; font-weight: 700; margin-bottom: 12px; display: block; }
.page-hero--plain { background: var(--night); }
.page-hero--plain .page-hero__inner { padding: 46px 20px 40px; }

/* ---------- Tool page layout ---------- */
.tool-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 26px; align-items: start; }
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow-sm);
}
.panel h2 { font-size: 1.25rem; margin-bottom: 16px; }
.panel h3 { font-size: 1.05rem; margin: 20px 0 10px; }
.field { margin-bottom: 15px; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; color: var(--ink-soft); }
.field .hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.field input[type="text"], .field input[type="number"], .field input[type="date"], .field select {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font: 500 .98rem var(--font-body); color: var(--ink); background: #fff; transition: border .15s, box-shadow .15s;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(224,123,31,.15); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.geo-btn { display: inline-flex; align-items: center; gap: 7px; font: 600 .86rem var(--font-body); color: var(--night); background: #eef2fa; border: 1px solid #d8e0ee; padding: 9px 14px; border-radius: 999px; cursor: pointer; transition: background .15s; }
.geo-btn:hover { background: #e2e9f7; }
.geo-btn svg { width: 16px; height: 16px; }

.results { display: grid; gap: 12px; }
.result-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #fdf9f0; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 13px 16px;
}
.result-row .k { font-size: .9rem; color: var(--ink-soft); font-weight: 600; }
.result-row .v { font-family: var(--font-display); font-size: 1.22rem; font-weight: 700; color: var(--ink); white-space: nowrap; }
.result-row .v small { font-size: .72rem; color: var(--muted); font-weight: 500; margin-left: 4px; }
.result-big { text-align: center; padding: 22px 16px; background: linear-gradient(160deg, var(--night), var(--night-2)); border-radius: var(--radius); color: #fff; }
.result-big .k { color: #ffd9a8; font-size: .84rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.result-big .v { font-family: var(--font-display); font-size: 2.3rem; font-weight: 700; margin: 4px 0 2px; }
.result-big .s { color: #b9c5da; font-size: .88rem; }

/* Day timeline bar */
.timeline { margin: 18px 0 6px; }
.timeline__track { position: relative; height: 44px; border-radius: 12px; background: linear-gradient(90deg, #101b33 0%, #26365c 22%, #7fa8c9 42%, #f5d9a4 50%, #f7c066 58%, #7fa8c9 74%, #26365c 90%, #101b33 100%); overflow: hidden; }
.timeline__band { position: absolute; top: 0; bottom: 0; border-left: 2px solid rgba(255,255,255,.85); border-right: 2px solid rgba(255,255,255,.85); background: rgba(255,255,255,.34); }
.timeline__now { position: absolute; top: -4px; bottom: -4px; width: 3px; background: #fff; box-shadow: 0 0 8px rgba(255,255,255,.9); }
.timeline__now::after { content: "●"; position: absolute; top: -7px; left: -6px; color: #fff; font-size: 13px; }
.timeline__axis { display: flex; justify-content: space-between; font-size: .76rem; color: var(--muted); margin-top: 5px; }

/* Sun path canvas */
.canvas-wrap { background: #fdf9f0; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; }
.canvas-wrap canvas { width: 100%; height: auto; display: block; }

/* Tables for tool output */
.tool-table { font-size: .9rem; }
.tool-table th { position: sticky; top: 0; }

/* Tip / note boxes */
.tip-box { background: var(--gold-soft); border: 1px solid #f3d9b0; border-radius: var(--radius-sm); padding: 15px 17px; margin: 18px 0; font-size: .94rem; }
.tip-box strong { color: var(--gold-deep); }
.note { background: #eef3fb; border: 1px solid #d8e2f2; border-radius: var(--radius-sm); padding: 14px 16px; margin: 16px 0; font-size: .9rem; color: var(--ink-soft); }
.note a { color: #2b5cb8; text-decoration: underline; }
.note .disc-link { margin-left: 6px; white-space: nowrap; }
.warn-box { background: #fdf1ec; border: 1px solid #f2cdbc; border-radius: var(--radius-sm); padding: 14px 16px; margin: 16px 0; font-size: .9rem; color: #7c3a12; }

/* How-to steps */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 16px 0; }
.steps li { counter-increment: step; position: relative; padding: 0 0 18px 46px; font-size: .96rem; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 32px; height: 32px;
  background: linear-gradient(135deg, #f59e0b, #e07b1f); color: #fff; font-weight: 700;
  border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--font-display);
}
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 15px; top: 38px; bottom: 4px; width: 2px; background: var(--line); }

/* Related tools */
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.related-grid .tool-card { min-height: 160px; }
.related-grid .tool-card h3 { font-size: 1.05rem; }

/* ---------- Article page ---------- */
.article-layout { max-width: 820px; margin: 0 auto; padding: 44px 20px 70px; }
.article-body { font-size: 1.02rem; }
.article-body h2 { margin-top: 1.8em; }
.article-body h3 { margin-top: 1.4em; }
.article-body figure { margin: 1.6em 0; }
.article-body figure img { border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.article-body figcaption { font-size: .82rem; color: var(--muted); text-align: center; margin-top: 8px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 16px; color: var(--muted); font-size: .88rem; margin: 14px 0 26px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.article-toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; margin: 0 0 30px; }
.article-toc ol { margin: 0; }
.article-toc a { color: var(--ink-soft); }
.author-box { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-top: 40px; }
.author-box .avatar { width: 48px; height: 48px; border-radius: 50%; background: linear-gradient(135deg, #f59e0b, #e07b1f); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; flex-shrink: 0; }

/* ---------- FAQ ---------- */
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 18px; margin-bottom: 12px; }
.faq summary { cursor: pointer; font-weight: 600; font-size: .98rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq details[open] summary { color: var(--gold-deep); }

/* ---------- Footer ---------- */
.site-footer { background: var(--night); color: #b9c5da; font-size: .92rem; }
.footer-top { max-width: var(--maxw); margin: 0 auto; padding: 52px 20px 30px; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; }
.footer-top h4 { color: #fff; font-family: var(--font-body); font-size: .92rem; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 14px; }
.footer-top a { color: #b9c5da; display: block; margin-bottom: 8px; }
.footer-top a:hover { color: #ffd9a8; }
.footer-brand p { color: #8f9cb5; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); }
.footer-bottom__inner { max-width: var(--maxw); margin: 0 auto; padding: 18px 20px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; color: #8f9cb5; font-size: .84rem; }
.footer-bottom__inner a { color: #b9c5da; text-decoration: underline; }
.footer-bottom__inner a:hover { color: #fff; }
@media (max-width: 900px) { .footer-top { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-top { grid-template-columns: 1fr; gap: 22px; } }

/* ---------- Favorites drawer ---------- */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 92vw); z-index: 120;
  background: var(--surface); box-shadow: -12px 0 40px rgba(13,20,38,.25); transform: translateX(105%);
  transition: transform .25s ease; display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.drawer__head h3 { margin: 0; font-size: 1.15rem; }
.drawer__close { border: 0; background: #f3ecdf; border-radius: 8px; width: 36px; height: 36px; cursor: pointer; font-size: 1.1rem; color: var(--ink); }
.drawer__list { overflow-y: auto; padding: 12px 16px 24px; }
.drawer__item { display: flex; align-items: center; gap: 12px; padding: 12px 10px; border-radius: 12px; }
.drawer__item:hover { background: #faf4e9; }
.drawer__item img { width: 62px; height: 46px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.drawer__item .t { font-weight: 600; font-size: .95rem; color: var(--ink); }
.drawer__item .c { font-size: .78rem; color: var(--muted); }
.drawer__del { margin-left: auto; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 1rem; padding: 6px; }
.drawer__del:hover { color: var(--warn); }
.drawer__empty { text-align: center; color: var(--muted); padding: 50px 20px; }
.scrim { position: fixed; inset: 0; background: rgba(13,20,38,.4); z-index: 110; opacity: 0; pointer-events: none; transition: opacity .2s; }
.scrim.show { opacity: 1; pointer-events: auto; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); z-index: 150;
  background: var(--night); color: #fff; padding: 12px 22px; border-radius: 999px; font-size: .92rem;
  box-shadow: var(--shadow-md); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Scroll to top ---------- */
.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 95; width: 46px; height: 46px; border-radius: 50%;
  background: var(--night); color: #fff; border: 1px solid rgba(255,255,255,.2); cursor: pointer;
  display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; box-shadow: var(--shadow-md);
}
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top:hover { transform: translateY(-3px); }

/* ---------- Bilingual blocks ---------- */
html[lang="zh"] .lang-en { display: none !important; }
html:not([lang="zh"]) .lang-zh { display: none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .tool-grid, .cat-grid, .article-grid { grid-template-columns: repeat(2, 1fr); }
  .tool-layout { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .section { padding: 46px 0; }
  .hero__inner { padding: 68px 18px 60px; }
  .tool-grid, .cat-grid, .article-grid { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .tool-card { min-height: 220px; }
  .result-row { flex-direction: column; align-items: flex-start; gap: 4px; }
  .article-body { font-size: 1rem; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- Ad slots (AdSense) ---------- */
.ad-slot { margin: 34px 0; min-height: 90px; display: flex; align-items: center; justify-content: center; }
.ad-slot ins { display: block; }
