/* Tea website. Colours follow the app's Sepia (light) and Monokai-dimmed (dark) themes. */
:root {
  --bg: #e5d9c5;
  --bg-deep: #d8ccb8;
  --card: #f0e5d0;
  --card-2: #ebdfca;
  --row: #e2d6c1;
  --text: #302217;
  --ink: #4b3d30;
  --muted: #5d4f41;
  --accent: #84725a;
  --accent-ink: #f0e5d0;
  --link: #8a4f12;
  --tip: #dfe3cf;
  --warn: #efd9c7;
  --code: #e2d5bf;
  --focus: #c9ae88;
  --shadow: 0 4px 5.5px rgba(0, 0, 0, 0.33);
  --shadow-soft: 0 2px 6px rgba(48, 34, 23, 0.14);
  --hero: #2b1d14;
  --topbar: rgba(229, 217, 197, 0.7);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1e1e1e; --bg-deep: #181818; --card: #2a2a2a; --card-2: #303030; --row: #262626;
    --text: #d4d6d3; --ink: #c5c8c6; --muted: #9a9d9b; --accent: #c8633f; --accent-ink: #f0f0ea;
    --link: #e08a62; --tip: #2b3022; --warn: #3a2a24; --code: #333; --focus: #f0f0ea;
    --shadow-soft: 0 2px 6px rgba(0, 0, 0, 0.4); --topbar: rgba(30, 30, 30, 0.7); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1e1e1e; --bg-deep: #181818; --card: #2a2a2a; --card-2: #303030; --row: #262626;
  --text: #d4d6d3; --ink: #c5c8c6; --muted: #9a9d9b; --accent: #c8633f; --accent-ink: #f0f0ea;
  --link: #e08a62; --tip: #2b3022; --warn: #3a2a24; --code: #333; --focus: #f0f0ea;
  --shadow-soft: 0 2px 6px rgba(0, 0, 0, 0.4); --topbar: rgba(30, 30, 30, 0.7); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.75 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", "Segoe UI", sans-serif;
  overflow-x: hidden;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; }
.doc-search input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
img { max-width: 100%; }

/* ---- top bar ---- */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--topbar); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.topbar-inner { max-width: 1120px; margin: 0 auto; padding: 0 16px; height: 56px; display: flex; align-items: center; gap: 16px; }
.topbar-inner.wide { max-width: 1360px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 19px; letter-spacing: .02em; }
.brand:hover { text-decoration: none; }
.brand-tile { width: 34px; height: 34px; border-radius: 9px; background: #9b886e radial-gradient(rgba(240, 229, 208, .45) 1px, transparent 1.3px) 0 0 / 6px 6px; display: grid; place-items: center; }
.brand-tile img { width: 26px; height: 26px; }
.mainnav { display: flex; gap: 4px; margin-left: auto; }
.mainnav a { color: var(--ink); padding: 0 12px; height: 34px; display: flex; align-items: center; border-radius: 17px; font-size: 15px; white-space: nowrap; }
.mainnav a:hover { background: var(--bg-deep); text-decoration: none; }
.mainnav a.active { background: var(--accent); color: var(--accent-ink); }
.lang-switch { height: 34px; min-width: 34px; padding: 0 10px; border-radius: 17px; display: grid; place-items: center; color: var(--ink); font-size: 14px; font-weight: 600; }
.lang-switch:hover { background: var(--bg-deep); text-decoration: none; }
.theme-toggle { height: 34px; width: 34px; border: 0; border-radius: 17px; background: transparent; color: var(--ink); font-size: 17px; cursor: pointer; display: grid; place-items: center; padding: 0; }
.theme-toggle:hover { background: var(--bg-deep); }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: inline; }
}
@media (max-width: 560px) {
  .brand span:last-child { display: none; }
  .topbar-inner { gap: 6px; }
  .mainnav { gap: 0; }
  .mainnav a { padding: 0 10px; font-size: 14.5px; }
  .lang-switch { padding: 0 6px; }
}
@media (max-width: 420px) {
  .mainnav a { padding: 0 7px; font-size: 14px; }
  .theme-toggle { width: 28px; }
}

/* ---- buttons ---- */
.button { display: inline-flex; align-items: center; justify-content: center; height: 42px; padding: 0 20px; border-radius: 21px; background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 15px; }
.button:hover { text-decoration: none; filter: brightness(1.06); }
.button.quiet { background: rgba(240, 229, 208, .16); color: #f0e5d0; }
.button.quiet-light { background: var(--card); color: var(--text); box-shadow: var(--shadow-soft); }

/* ---- home ---- */
.hero { background: var(--hero) url(/img/hero.webp) right center / cover no-repeat; color: #f0e5d0; }
.hero-inner { max-width: 1120px; margin: 0 auto; padding: 96px 16px 104px; }
.hero h1 { font-size: 52px; line-height: 1.15; margin: 0 0 6px; letter-spacing: .02em; }
.hero .edition { display: inline-block; font-size: 14px; color: #d8ccb8; margin-bottom: 18px; }
.hero p.lead { font-size: 20px; max-width: 24em; margin: 0 0 28px; color: #e5d9c5; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; }
@media (max-width: 760px) {
  .hero { background-position: 70% center; }
  .hero-inner { padding: 56px 16px 64px; background: rgba(43, 29, 20, .7); }
  .hero h1 { font-size: 40px; }
  .hero p.lead { font-size: 17px; }
}
.section { max-width: 1120px; margin: 0 auto; padding: 72px 16px 0; }
.section:last-of-type { padding-bottom: 80px; }
.section > h2 { font-size: 30px; margin: 0 0 8px; }
.section > p.sub { color: var(--muted); margin: 0 0 28px; max-width: 46em; }
.feature { display: grid; grid-template-columns: 1fr 1.35fr; gap: 40px; align-items: center; padding: 28px 0; }
.feature.flip { grid-template-columns: 1.35fr 1fr; }
.feature.flip .feature-text { order: 2; }
.feature h3 { font-size: 23px; margin: 0 0 10px; }
.feature p { margin: 0 0 12px; color: var(--ink); }
.feature ul { margin: 0; padding-left: 1.2em; color: var(--ink); }
.feature li { margin: 4px 0; }
.feature .more { font-weight: 600; }
.shot { margin: 0; }
.shot img { display: block; width: 100%; border-radius: 9px; box-shadow: var(--shadow); background: #111; }
.shot-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 860px) {
  .feature, .feature.flip { grid-template-columns: 1fr; gap: 18px; }
  .feature.flip .feature-text { order: 0; }
}
.devices { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.tile { background: var(--card); border-radius: 12px; padding: 18px 20px; box-shadow: var(--shadow-soft); }
.tile strong { display: block; font-size: 17px; margin-bottom: 4px; }
.tile span { color: var(--muted); font-size: 15px; }
.compare { max-width: 860px; margin: 0 auto; }
.compare img { display: block; width: 100%; border-radius: 12px; box-shadow: var(--shadow-soft); }

/* ---- narrow pages (download, thanks) ---- */
.narrow { max-width: 980px; margin: 0 auto; padding: 48px 16px 80px; }
.narrow > h1 { font-size: 36px; margin: 0 0 8px; }
.narrow > p.sub { color: var(--muted); margin: 0 0 32px; font-size: 17px; }
.cards-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 760px) { .cards-2 { grid-template-columns: 1fr; } }
.edition-card { background: var(--card); border-radius: 14px; padding: 26px 26px 24px; box-shadow: var(--shadow-soft); display: flex; flex-direction: column; }
.edition-card h2 { margin: 0 0 2px; font-size: 25px; display: flex; align-items: center; gap: 12px; }
.edition-card .tag { font-size: 14px; color: var(--muted); font-weight: 400; }
.edition-card .how { margin: 14px 0 16px; padding: 14px 16px; border-radius: 10px; background: var(--card-2); }
.edition-card .how ol { margin: 6px 0 0; padding-left: 1.3em; }
.edition-card ul.features { margin: 0 0 18px; padding-left: 1.2em; }
.edition-card ul.features li { margin: 5px 0; }
.edition-card .actions { margin-top: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.mug { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.mug img { width: 30px; height: 30px; }
.mug.tea { background: #9b886e radial-gradient(rgba(240, 229, 208, .45) 1px, transparent 1.3px) 0 0 / 6px 6px; }
.mug.coffee { background: #b9ad99 radial-gradient(rgba(255, 255, 255, .45) 1px, transparent 1.3px) 0 0 / 6px 6px; color: #3a2a1d; font-size: 22px; }
.note { color: var(--muted); font-size: 15px; }
.subhead { font-size: 22px; margin: 48px 0 14px; }
.sponsor { display: grid; grid-template-columns: 150px 1fr; gap: 20px; align-items: center; }
.sponsor img.qr { width: 150px; height: 150px; border-radius: 10px; background: #fff; display: block; }
.sponsor h2 { margin: 0 0 6px; font-size: 22px; }
.sponsor p { margin: 0 0 12px; color: var(--ink); }
@media (max-width: 420px) { .sponsor { grid-template-columns: 1fr; } }
.plain-list { padding-left: 1.2em; }
.plain-list li { margin: 6px 0; }

/* ---- docs ---- */
.doc-layout { max-width: 1360px; margin: 0 auto; padding: 24px 16px 80px; display: grid; grid-template-columns: 232px minmax(0, 1fr) 208px; gap: 40px; align-items: start; }
/* The sidebar itself doesn't clip (the search results reach over the page); its page list scrolls. */
.doc-side { position: sticky; top: 72px; max-height: calc(100vh - 88px); display: flex; flex-direction: column; padding-bottom: 16px; z-index: 5; }
.doc-side .doc-nav { overflow-y: auto; min-height: 0; }
.doc-search { position: relative; margin-bottom: 12px; }
.doc-search input { width: 100%; height: 38px; border: 0; border-radius: 19px; padding: 0 16px; background: var(--card); color: var(--text); font: inherit; font-size: 15px; box-shadow: var(--shadow-soft); }
.search-results { position: absolute; left: 0; top: 44px; width: min(440px, calc(100vw - 32px)); max-height: 60vh; overflow: auto; background: var(--card); border-radius: 12px; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); z-index: 30; padding: 6px; }
.search-results a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--text); }
.search-results a:hover, .search-results a.sel { background: var(--row); text-decoration: none; }
.search-results small { display: block; color: var(--muted); font-size: 13px; line-height: 1.5; }
.search-results mark { background: rgba(200, 99, 63, .28); color: inherit; border-radius: 3px; }
.search-results .empty { padding: 10px; color: var(--muted); font-size: 14px; }
.doc-nav { display: flex; flex-direction: column; gap: 2px; }
.doc-nav a { color: var(--ink); padding: 6px 14px; border-radius: 17px; font-size: 15px; }
.doc-nav a:hover { background: var(--bg-deep); text-decoration: none; }
.doc-nav a.active { background: var(--accent); color: var(--accent-ink); }
.doc-toc { position: sticky; top: 72px; max-height: calc(100vh - 88px); overflow: auto; font-size: 14px; display: flex; flex-direction: column; gap: 2px; }
.doc-toc .toc-title { font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.doc-toc a { color: var(--muted); padding: 2px 0; line-height: 1.5; }
.doc-toc a.d3 { padding-left: 12px; font-size: 13.5px; }
.doc-toc a.current { color: var(--text); font-weight: 600; }
@media (max-width: 1180px) { .doc-layout { grid-template-columns: 220px minmax(0, 1fr); } .doc-toc { display: none; } }
@media (max-width: 820px) {
  .doc-layout { grid-template-columns: 1fr; gap: 12px; padding-top: 16px; }
  .doc-side { position: relative; top: 0; max-height: none; }
  .doc-side .doc-nav { flex-direction: row; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; padding-bottom: 4px; }
  .doc-nav::-webkit-scrollbar { display: none; }
  .doc-nav a { white-space: nowrap; background: var(--card); }
}
.doc { min-width: 0; max-width: 800px; }
.doc h1 { font-size: 34px; line-height: 1.25; margin: 8px 0 6px; }
.doc-summary { color: var(--muted); font-size: 17px; margin: 0 0 24px; }
.doc h2 { font-size: 24px; margin: 44px 0 10px; line-height: 1.35; }
.doc h3 { font-size: 19px; margin: 28px 0 6px; }
.doc h4 { font-size: 16px; margin: 20px 0 4px; }
.doc h2 .anchor, .doc h3 .anchor, .doc h4 .anchor { color: var(--muted); opacity: 0; margin-left: -0.9em; width: .9em; display: inline-block; font-weight: 400; }
.doc h2:hover .anchor, .doc h3:hover .anchor, .doc h4:hover .anchor { opacity: .6; text-decoration: none; }
.doc p, .doc li { color: var(--ink); }
.doc ul, .doc ol { padding-left: 1.4em; }
.doc li { margin: 3px 0; }
.doc li > ul, .doc li > ol { margin: 2px 0; }
.doc code { background: var(--code); padding: 1px 6px; border-radius: 5px; font-size: .9em; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.doc pre { background: var(--card); padding: 14px 16px; border-radius: 10px; overflow: auto; box-shadow: var(--shadow-soft); }
.doc pre code { background: none; padding: 0; overflow-wrap: normal; }
.doc strong { color: var(--text); }
.doc hr { border: 0; height: 1px; background: var(--bg-deep); margin: 32px 0; }
.table-wrap { overflow-x: auto; margin: 14px 0; border-radius: 10px; box-shadow: var(--shadow-soft); }
.doc table { border-collapse: collapse; width: 100%; font-size: 15px; background: var(--card); }
.doc th { text-align: left; background: var(--card-2); padding: 9px 12px; font-weight: 600; white-space: nowrap; }
.doc td { padding: 8px 12px; vertical-align: top; color: var(--ink); }
.doc tbody tr:nth-child(even) td { background: var(--row); }
.doc figure { margin: 18px 0; }
.doc figure img { display: block; width: 100%; border-radius: 9px; box-shadow: var(--shadow); }
.doc figcaption { color: var(--muted); font-size: 14px; margin-top: 8px; text-align: center; }
.doc blockquote { margin: 16px 0; padding: 10px 16px; border-radius: 10px; background: var(--card); }
.doc blockquote p { margin: 6px 0; }
.doc blockquote.tip { background: var(--tip); }
.doc blockquote.warn { background: var(--warn); }
.doc blockquote strong:first-child { margin-right: 6px; }
.doc-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 56px; }
.doc-pager a { background: var(--card); border-radius: 12px; padding: 12px 16px; color: var(--text); font-weight: 600; box-shadow: var(--shadow-soft); }
.doc-pager a:hover { text-decoration: none; background: var(--card-2); }
.doc-pager a small { display: block; color: var(--muted); font-weight: 400; font-size: 13px; }
.doc-pager .next { text-align: right; grid-column: 2; }
.doc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.doc-card { background: var(--card); border-radius: 12px; padding: 16px 18px; color: var(--text); box-shadow: var(--shadow-soft); }
.doc-card:hover { text-decoration: none; background: var(--card-2); }
.doc-card strong { display: block; font-size: 17px; margin-bottom: 4px; }
.doc-card span { color: var(--muted); font-size: 14.5px; line-height: 1.6; display: block; }

/* Controller buttons in the shape of the real button. */
kbd { font-family: inherit; font-size: 12.5px; font-weight: 700; line-height: 1; display: inline-flex; align-items: center; justify-content: center; vertical-align: 1px; background: var(--ink); color: var(--bg); height: 20px; margin: 0 1px; }
kbd.btn-face { width: 20px; border-radius: 50%; }
kbd.btn-shoulder { min-width: 30px; padding: 0 6px; }
kbd.btn-shoulder.left { border-radius: 10px 4px 4px 4px; }
kbd.btn-shoulder.right { border-radius: 4px 10px 4px 4px; }
kbd.btn-key { padding: 0 7px; border-radius: 10px; font-size: 12px; }

/* ---- footer ---- */
.footer { background: var(--bg-deep); color: var(--muted); font-size: 14px; }
.footer-inner { max-width: 1120px; margin: 0 auto; padding: 22px 16px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.footer a { color: var(--muted); }

/* Grid children may shrink below their content (the docs' scrolling chip row). */
.doc-layout > *, .feature > *, .cards-2 > * { min-width: 0; }

/* English comparison table (the Chinese pages use the picture). */
.compare-table { max-width: 860px; margin: 0 auto; overflow-x: auto; border-radius: 12px; box-shadow: var(--shadow-soft); }
.compare-table table { width: 100%; border-collapse: collapse; background: var(--card); font-size: 15px; }
.compare-table th { background: #84725a; color: #f0e5d0; text-align: left; padding: 10px 14px; }
.compare-table td { padding: 9px 14px; color: var(--ink); }
.compare-table td:not(:first-child), .compare-table th:not(:first-child) { text-align: center; }
.compare-table tbody tr:nth-child(even) td { background: var(--row); }
