/* TagPeek — site styles
   Accent: #EE6116 · clean white · warm gray
   Offline-first static site */

:root {
  --bg: #ffffff;
  --bg-soft: #f7f5f3;
  --bg-warm: #fff4ec;
  --fg: #1c1917;
  --muted: #6b6560;
  --line: #e8e4df;
  --accent: #ee6116;
  --accent-hover: #d4540f;
  --accent-soft: #fff0e8;
  --ok: #1a7a4c;
  --ok-bg: #e8f6ee;
  --warn: #a65c00;
  --warn-bg: #fff3e0;
  --bad: #b42318;
  --bad-bg: #fef0ee;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(28, 25, 23, 0.04), 0 8px 24px rgba(28, 25, 23, 0.06);
  --font-display: "Avenir Next Condensed", "Futura", "Gill Sans", "Trebuchet MS", "PingFang SC", sans-serif;
  --font-body: "Avenir Next", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --max: 1080px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(ellipse 80% 50% at 100% -10%, #fff0e8 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at -5% 30%, #f7f5f3 0%, transparent 50%),
    var(--bg);
  color: var(--fg);
  font: 16px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ——— Nav ——— */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--fg);
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover {
  text-decoration: none;
  color: var(--accent);
}
.brand span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 4px 16px;
  flex: 1;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--fg);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg);
}
.lang-toggle button {
  border: 0;
  background: transparent;
  padding: 5px 12px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.lang-toggle button[aria-pressed="true"] {
  background: var(--fg);
  color: #fff;
}

/* ——— Buttons ——— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.12s;
}
.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
}
.btn-ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--line);
}
.btn-ghost:hover {
  border-color: var(--fg);
  color: var(--fg);
}
.btn-lg {
  padding: 14px 28px;
  font-size: 1.02rem;
}

/* ——— Layout ——— */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

.hero {
  padding: 72px 0 48px;
  text-align: left;
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5.5vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 18px;
  color: var(--fg);
}
.hero-brand .dot {
  color: var(--accent);
}

.hero h1,
.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3.2vw, 2.1rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 12px;
  max-width: 22ch;
}

.lead {
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 42ch;
  margin: 0 0 28px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
}

.trust-note {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 14px;
}

/* ——— Sections ——— */
.section {
  padding: 56px 0;
}
.section-head {
  margin-bottom: 28px;
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: 1.65rem;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
.section-head p {
  color: var(--muted);
  margin: 0;
  max-width: 52ch;
}

.divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
}

/* ——— Detector ——— */
.detector {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.dropzone {
  position: relative;
  padding: 48px 28px;
  text-align: center;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.15s;
}
.dropzone:hover,
.dropzone.is-drag {
  background: var(--accent-soft);
}
.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.dropzone-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  font-weight: 700;
}
.dropzone strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 4px;
}
.dropzone span {
  color: var(--muted);
  font-size: 0.9rem;
}

.detector-body {
  display: none;
  padding: 28px;
}
.detector-body.is-open {
  display: block;
}

.detector-top {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr;
  gap: 24px;
  margin-bottom: 28px;
}
@media (max-width: 700px) {
  .detector-top {
    grid-template-columns: 1fr;
  }
}

.preview-thumb {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #111;
  aspect-ratio: 1;
}
.preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.checks {
  display: grid;
  gap: 10px;
}
.check {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px 12px;
  align-items: start;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--bg-soft);
  border: 1px solid transparent;
}
.check.ok {
  background: var(--ok-bg);
  border-color: #c6e8d4;
}
.check.warn {
  background: var(--warn-bg);
  border-color: #ffe0a8;
}
.check.bad {
  background: var(--bad-bg);
  border-color: #f5c8c2;
}
.check-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--fg);
  white-space: nowrap;
}
.check.ok .check-badge {
  background: var(--ok);
  color: #fff;
}
.check.warn .check-badge {
  background: var(--warn);
  color: #fff;
}
.check.bad .check-badge {
  background: var(--bad);
  color: #fff;
}
.check-label {
  font-weight: 600;
  font-size: 0.95rem;
}
.check-detail {
  grid-column: 2 / -1;
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0;
}
.check-value {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--fg);
  white-space: nowrap;
}

/* Three-crop previews */
.crops {
  margin: 28px 0;
}
.crops h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0 0 6px;
}
.crops > p {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 18px;
}
.crop-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-end;
}
.crop-card {
  text-align: center;
}
.crop-frame {
  position: relative;
  overflow: hidden;
  background: #1a1a1a;
  border: 1px solid var(--line);
  margin: 0 auto 8px;
}
.crop-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.crop-safe {
  position: absolute;
  inset: 10%;
  border: 1.5px dashed rgba(238, 97, 22, 0.95);
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}
.crop-label {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
}
.crop-1x1 {
  width: 200px;
  height: 200px;
}
.crop-4x5 {
  width: 160px;
  height: 200px;
}
.crop-4x3 {
  width: 266px;
  height: 200px;
}
.crop-5x4 {
  width: 250px;
  height: 200px;
}

.self-checks {
  margin-top: 16px;
  padding: 14px 18px;
  border: 1px dashed #d4c4b0;
  border-radius: var(--radius);
  background: rgba(255, 252, 247, 0.8);
}
.self-checks h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0 0 8px;
}
.self-checks ul {
  margin: 0;
  padding-left: 1.2em;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}
.self-checks li + li {
  margin-top: 6px;
}

.recipe {
  background: var(--bg-warm);
  border: 1px solid #ffd9bf;
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-top: 8px;
}
.recipe h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0 0 8px;
}
.recipe code,
.recipe-text {
  display: block;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--fg);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 10px 0;
  white-space: pre-wrap;
  word-break: break-word;
}
.recipe-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.privacy-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 16px;
}
.privacy-chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
}

/* ——— Feature strip ——— */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 800px) {
  .features {
    grid-template-columns: 1fr;
  }
}
.feature {
  padding: 8px 0;
}
.feature h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin: 0 0 6px;
}
.feature p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ——— Rules page ——— */
.page-hero {
  padding: 48px 0 28px;
}
.page-hero .lead {
  margin-bottom: 0;
}

.rule-list {
  display: grid;
  gap: 16px;
  padding-bottom: 64px;
}
.rule {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  background: var(--bg);
}
.rule-num {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.rule h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.rule p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.95rem;
}
.rule-source {
  font-size: 0.82rem;
  color: var(--fg);
  background: var(--bg-soft);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 0;
}
.rule-source a {
  font-weight: 600;
}

/* ——— Pricing ——— */
.pricing-grid {
  display: grid;
  /* 3 档定价（Free / Pro 月付 / Pro 年付）：宽屏 3 列，中屏 2 列，窄屏 1 列 */
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  padding-bottom: 40px;
}
@media (max-width: 860px) {
  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
  }
}
.plan {
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  padding: 28px 24px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
}
.plan.featured {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.plan-badge {
  position: absolute;
  top: -11px;
  left: 24px;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}
.plan h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0 0 4px;
}
.plan-price {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 8px 0 4px;
  line-height: 1;
}
.plan-price small {
  font-size: 1rem;
  font-weight: 500;
  color: var(--muted);
}
.plan-desc {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 18px;
}
.plan ul {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  flex: 1;
}
.plan li {
  padding: 7px 0 7px 22px;
  position: relative;
  font-size: 0.92rem;
  border-top: 1px solid var(--line);
}
.plan li:first-child {
  border-top: 0;
}
.plan li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}
.plan .btn {
  width: 100%;
}

.guarantees {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: center;
  padding: 8px 0 56px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
}
.guarantees span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.guarantees span::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.creem-note {
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  padding-bottom: 48px;
}

/* ——— Privacy prose ——— */
.prose {
  max-width: 720px;
  padding-bottom: 72px;
}
.prose h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 36px 0 10px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.prose h2:first-of-type {
  border-top: 0;
  padding-top: 0;
}
.prose p,
.prose li {
  color: var(--muted);
}
.prose ul {
  padding-left: 22px;
}
.prose li {
  margin: 6px 0;
}
.prose strong {
  color: var(--fg);
}
.prose code {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.9em;
}
.note-box {
  background: var(--bg-warm);
  border: 1px solid #ffd9bf;
  border-radius: 10px;
  padding: 14px 16px;
  margin: 18px 0;
  color: var(--fg);
}

/* ——— Footer ——— */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 24px 40px;
  color: var(--muted);
  font-size: 0.88rem;
}
.site-footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: space-between;
  align-items: center;
}
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.site-footer a {
  color: var(--muted);
}
.site-footer a:hover {
  color: var(--fg);
}
/* 第三方出处免责声明（rules 页）—— 独占一行，排在标题与导航之后 */
.footer-note {
  order: 3;
  flex-basis: 100%;
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.5;
  opacity: 0.85;
}

/* ——— i18n helpers ——— */
[data-lang-hide] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
