/* noticewords.com: one stylesheet for every page. System fonts only; nothing is loaded from
   another site (README「官網」). The homepage's product pictures are drawn here, in HTML and
   inline SVG; every animation and transition is in the `prefers-reduced-motion: no-preference`
   block at the end, so without it each picture stands complete. */

/* The colours (README「顏色」): the primary colour is the icon's black, a filled component's text
   the page's background, its tint a neutral grey. The icon's yellow is only the background of the
   primary action buttons (.button, .buy-button, .upgrade-button), under the icon's black: as text,
   a line or a border it has 1.48:1 on white, and elsewhere yellow is a saved word (--saved). Green
   says that something worked or is included (--success). tests/page-colours.test.ts checks them. */
:root {
  --text: #1f2328;
  --muted: #59636e;
  --line: #d8dee4;
  --accent: #26272B;
  --accent-text: var(--bg);
  --accent-soft: #f0f0f0;
  --action: #FFCF13;
  --action-text: #26272B;
  --success: #1a7f37;
  --amber: #9a6700;
  --bg: #ffffff;
  --bg-soft: #f6f8fa;
  /* NoticeWords in the header: the icon's black (design/icon/*.svg). */
  --brand: #26272B;
  /* The extension's colours (src/ui/styles.ts): a word beyond the vocabulary level on the dark
     subtitle bar, the pressed word, a saved word, and the popup. */
  --level: #8ce99a;
  --pressed: #8ab4f8;
  --saved: #ffd166;
  --popup: rgba(24, 24, 27, 0.97);
  --phonetic: #a5c8ff;
  /* The statistics tab's charts. */
  --chart-learned: #2da44e;
  --chart-manual: #c98a00;
  --chart-reviews: #1f5fd0;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif;
  font-size: 17px;
  line-height: 1.75;
}

/* A link has the text's near-black: only its underline tells it from the words around it (WCAG
   1.4.1), so no link in the text takes it away. */
a {
  color: var(--accent);
  text-decoration: underline;
}

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header and navigation */

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--brand);
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
}

.brand img {
  flex: none;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}

nav a {
  color: var(--muted);
  text-decoration: none;
}

nav a:hover,
nav a[aria-current="page"] {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 6px;
}

/* 登入 at the header's right, on every page: a link to the pricing page's sign-in. There, with the
   checkout switch on, checkout.js opens the sign-in dialog from it and puts 登出 (.sign-out) in its
   place once signed in. Secondary and outlined, as 換一個帳號 is; no rule sets a display, so
   `hidden` keeps either away. On a narrow screen it stays beside NoticeWords and the navigation
   takes the next line (below). */
.site-header nav {
  margin-left: auto;
}

.sign-in,
.sign-out {
  padding: 2px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.sign-in:hover,
.sign-out:hover {
  background: var(--bg-soft);
}

.sign-in:focus-visible,
.sign-out:focus-visible {
  outline: 3px solid var(--text);
  outline-offset: 2px;
}

/* Content */

main {
  padding: 40px 0 56px;
}

h1 {
  margin: 0 0 12px;
  font-size: 32px;
  line-height: 1.35;
}

h2 {
  margin: 44px 0 10px;
  font-size: 23px;
  line-height: 1.4;
}

h3 {
  margin: 28px 0 6px;
  font-size: 19px;
}

p,
ul,
ol {
  margin: 0 0 14px;
}

li {
  margin: 4px 0;
}

.lead {
  color: var(--muted);
  font-size: 19px;
}

.updated {
  color: var(--muted);
  font-size: 15px;
}

code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-soft);
  font-size: 0.9em;
  /* A long scope URL (privacy.html) breaks rather than widening a phone's page. */
  overflow-wrap: anywhere;
}

.hero {
  padding: 16px 0 8px;
}

.hero h1 {
  font-size: 36px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.card {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}

.card h2,
.card h3 {
  margin-top: 0;
}

.card ul {
  padding-left: 20px;
}

.card.pro {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.note {
  padding: 14px 18px;
  border-left: 4px solid var(--accent);
  background: var(--bg-soft);
}

.quote {
  padding: 14px 18px;
  border-left: 4px solid var(--line);
  background: var(--bg-soft);
  font-style: italic;
}

table {
  width: 100%;
  margin: 12px 0 14px;
  border-collapse: collapse;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--bg-soft);
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 15px;
}

.site-footer .wrap {
  padding-top: 20px;
  padding-bottom: 28px;
}

.site-footer p {
  margin: 4px 0;
}

.site-footer .legal {
  font-size: 13px;
}

.footer-links {
  margin-bottom: 8px;
}

.footer-links a {
  color: var(--muted);
}

/* The legal pages: the privacy policy's summary and its contents */

.privacy-summary caption {
  margin-bottom: 4px;
  font-weight: 700;
  text-align: left;
}

.privacy-summary th,
.privacy-summary td {
  font-size: 15px;
}

.toc {
  display: block;
  margin: 18px 0 8px;
  padding: 12px 18px;
  border-left: 4px solid var(--line);
  background: var(--bg-soft);
}

.toc-title {
  margin: 0 0 4px;
  font-weight: 700;
}

.toc ol {
  margin: 0;
  padding-left: 22px;
}

/* The help page: its sections, a screenshot in each (as wide as the text, never wider than the
   window), and the keys it names. */

.help-section {
  scroll-margin-top: 12px;
}

.help-shot {
  margin: 18px 0 8px;
}

.help-shot img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

kbd {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--bg-soft);
  font-family: inherit;
  font-size: 0.85em;
  white-space: nowrap;
}

/* The pricing page: the two plans, row for row. Stacked on a narrow screen; side by side from
   700px, where each plan is a subgrid of the same rows, so that a feature's row lines up across
   the two. The spans are the rows of pricing.html: a plan is its title, its head and its list,
   the list is its 22 rows (site/test/pages.test.ts checks the counts). */

/* 月繳, 年繳 and 終身 above the plans, on one line at any width. The HTML has them `hidden` until
   pricing.js runs, and `display: flex` would undo that without the second rule. */
.plan-tabs {
  display: flex;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  margin: 16px auto 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
}

.plan-tabs[hidden] {
  display: none;
}

.plan-tabs button {
  padding: 6px 24px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.plan-tabs button[aria-selected="true"] {
  background: var(--accent);
  color: var(--accent-text);
}

.plan-tabs button:focus-visible {
  outline: 3px solid var(--text);
  outline-offset: 2px;
}

.plans {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin: 20px 0 14px;
}

.plan {
  min-width: 0;
  padding: 18px 20px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}

.plan-pro {
  border: 2px solid var(--accent);
}

.plan-title {
  margin: 0 0 6px;
  font-size: 22px;
}

.plan-head {
  margin-bottom: 10px;
}

.plan-price {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

.plan-sub {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.price-row {
  margin: 0 0 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.price-row p {
  margin: 0;
}

.price-row.is-recommended {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* 月繳, 年繳 and 終身 stay on one line, at any width. */
.price-name {
  font-weight: 700;
  white-space: nowrap;
}

.badge {
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 600;
}

.price-main {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.4;
}

.price-sub,
.price-note {
  font-size: 15px;
}

/* The monthly figure a year works out to: never larger than what a year costs. */
.price-calc {
  color: var(--muted);
  font-size: 14px;
}

/* The checkout (checkout.js, only when the pricing page's checkout switch is on): the account,
   購買 in each price row, 取消訂閱 under a subscription that renews, and the sign-in dialog. No rule
   here sets a display, so `hidden` keeps them away. */
.checkout {
  margin: 0 0 8px;
  font-size: 15px;
}

.checkout p {
  margin: 0 0 6px;
}

/* The sign-in dialog 購買 opens when signed out (checkout.js): over the whole page, which is inert
   behind it. As above, no rule sets a display: `hidden` keeps it away. */
.checkout-dialog {
  position: fixed;
  inset: 0;
  z-index: 10;
  overflow-y: auto;
  padding: 16px;
  background: rgba(31, 35, 40, 0.5);
}

.checkout-dialog-box {
  width: min(420px, 100%);
  margin: 12vh auto 0;
  padding: 20px 24px 24px;
  border-radius: 12px;
  background: var(--bg);
  font-size: 15px;
}

.checkout-dialog-box:focus {
  outline: none;
}

.checkout-dialog-box p {
  margin: 0 0 14px;
}

.checkout-dialog-close {
  float: right;
  margin: -8px -12px 4px 8px;
}

.checkout-dialog-box .checkout-dialog-message {
  margin: 14px 0 0;
}

.checkout-dialog-box .checkout-dialog-message:empty {
  margin: 0;
}

.checkout-hint {
  clear: both;
}

.checkout-google {
  min-height: 44px;
}

.checkout-cancel {
  margin: 0 0 6px;
}

.buy,
.upgrade {
  margin-top: 10px;
}

.upgrade-price {
  margin: 0 0 4px;
  font-weight: 600;
}

.upgrade-note {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 14px;
}

.buy-button,
.upgrade-button,
.checkout-switch,
.cancel-button,
.checkout-dialog-close {
  padding: 9px 22px;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* 購買 and 升級: primary action buttons, the icon's yellow with its black. */
.buy-button,
.upgrade-button {
  background: var(--action);
  color: var(--action-text);
}

/* 換一個帳號, 取消訂閱 and the sign-in dialog's 關閉: secondary, outlined. */
.checkout-switch,
.cancel-button,
.checkout-dialog-close {
  padding: 4px 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font-weight: 400;
}

.buy-button:disabled,
.upgrade-button:disabled,
.cancel-button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.buy-button:focus-visible,
.upgrade-button:focus-visible,
.checkout-switch:focus-visible,
.cancel-button:focus-visible,
.checkout-dialog-close:focus-visible {
  outline: 3px solid var(--text);
  outline-offset: 2px;
}

.plan-rows {
  margin: 0;
  padding: 0;
  list-style: none;
}

.plan-rows li {
  position: relative;
  margin: 0;
  padding: 7px 0 7px 26px;
  border-top: 1px solid var(--line);
  font-size: 15px;
  line-height: 1.6;
}

.plan-rows li::before {
  position: absolute;
  left: 2px;
  font-weight: 700;
}

.plan-rows li.plan-group {
  padding-left: 0;
  border-top: 0;
}

.plan-rows li.plan-group h4 {
  margin: 10px 0 0;
  font-size: 16px;
}

.plan-free li.is-on::before,
.plan-pro li:not(.plan-group)::before {
  content: "✓";
  content: "✓" / "";
  color: var(--success);
}

.plan-free li.is-off {
  color: var(--muted);
}

.plan-free li.is-off::before {
  content: "–";
  content: "–" / "";
}

/* 加到 Chrome（免費）: the free plan's button, in the space its head leaves beside Pro's prices. */
.plan-cta {
  margin: 14px 0 0;
}

/* A free row that is Pro's (問題 138 = a): its feature's name (.row-name), 是 Pro (.row-pro) and,
   for 我的單字, what the free version has of it (.row-free). 是 Pro is not seen: one plan above the
   other, the row shows its name and the –; side by side (below), where each row stands beside the
   same feature's row of Pro, the name goes too and only the – is seen. A screen reader still reads
   the whole sentence: the parts not seen are hidden by their size, never by display: none, and no
   part is aria-hidden (site/test/pages.test.ts). */
.plan-free li.is-off .row-pro {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* 我的單字：免費版列出你標過和收藏的字。, one above the other; the colon is only seen, not read. */
.plan-free li.is-off .row-free::before {
  content: "：";
  content: "：" / "";
}

@media (min-width: 700px) {
  .plans {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .plan {
    display: grid;
    grid-row: span 24;
    grid-template-rows: subgrid;
    row-gap: 0;
  }

  .plan-rows {
    display: grid;
    grid-row: span 22;
    grid-template-rows: subgrid;
  }

  .plan-free li.is-off .row-name {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }

  .plan-free li.is-off .row-free::before {
    content: none;
  }
}

.plan-notes {
  color: var(--muted);
  font-size: 15px;
}

/* The pricing page's FAQ */

.faq h3 {
  margin-top: 22px;
}

/* ---------------------------------------------------------------------------------------------
   The homepage
   --------------------------------------------------------------------------------------------- */

.home .wrap {
  max-width: 1120px;
}

/* 加到 Chrome（免費）: the primary action button, the icon's yellow with its black. */
.button {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 8px;
  background: var(--action);
  color: var(--action-text);
  font-weight: 600;
  text-decoration: none;
}

.button:hover {
  background: color-mix(in srgb, var(--action) 92%, #000);
}

/* The focus ring: on the white page the text colour (15.8:1 on white), in the dark demo frame
   the extension's pressed blue (site/test/home.test.ts checks both are 3:1 or more). */
.button:focus-visible {
  outline: 3px solid var(--text);
  outline-offset: 2px;
}

.frame button:focus-visible,
.frame .wordcard:focus-visible {
  outline: 3px solid var(--pressed);
  outline-offset: 2px;
}

/* The uninstall survey (bye.html): the seven reasons one under another, the box for a sentence as
   wide as the column allows, and 送出, the primary action button, grey while it is off. */
.bye-reasons {
  display: grid;
  gap: 4px;
  margin: 20px 0 24px;
}

.bye-reasons label {
  display: flex;
  align-items: baseline;
  gap: 10px;
  cursor: pointer;
}

.bye-comment-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

.bye-form textarea {
  display: block;
  width: 100%;
  max-width: 560px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.bye-form textarea:focus-visible {
  outline: 3px solid var(--text);
  outline-offset: 2px;
}

.bye-actions {
  margin: 18px 0 0;
}

.bye-form .button {
  border: 0;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.bye-form .button:disabled {
  background: var(--bg-soft);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--muted);
  cursor: not-allowed;
}

.bye-status {
  margin-top: 18px;
  font-weight: 600;
}

/* The first screen: the words on the left, the demo frame on the right. */

.home .hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  align-items: center;
  gap: 32px 44px;
  padding: 8px 0 12px;
}

.hero-text {
  min-width: 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 20px 0 8px;
}

.hero-trial {
  display: flex;
  flex-direction: column;
  line-height: 1.5;
}

.hero-note {
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}

.hero-req {
  color: var(--muted);
  font-size: 15px;
}

.hero-demo {
  min-width: 0;
}

.demo-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
}

/* A neutral video frame with a drawn picture: no player of any site. */
.frame {
  position: relative;
  /* A grid item with an aspect ratio is not stretched by default: without the width its
     min-height would set its width (16:10 of it), wider than a phone. */
  width: 100%;
  min-width: 0;
  min-height: 330px;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 14px;
  background: #101d33;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
}

.scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.frame-level {
  position: absolute;
  top: 12px;
  left: 12px;
  margin: 0;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(8, 8, 8, 0.6);
  color: #fff;
  font-size: 13px;
  line-height: 1.7;
}

/* 畫面示意，數字是範例: top right of the demo frame, and once at the start of the features. */
.frame-note {
  position: absolute;
  top: 12px;
  right: 12px;
  margin: 0;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(8, 8, 8, 0.6);
  color: #fff;
  font-size: 12px;
  line-height: 1.7;
}

.features-note {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

/* Pro, beside each Pro feature of the homepage; a feature without it is the free version's too. */
.plan-tag {
  display: inline-block;
  margin-right: 4px;
  padding: 0 7px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.7;
  vertical-align: 1px;
  white-space: nowrap;
}

.plan-tag.is-pro {
  background: var(--accent);
  color: var(--accent-text);
}

.price-list li {
  margin: 2px 0;
}

.swatch {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--level);
}

/* The extension's subtitle bar, at the bottom of the frame; the open card sits on top of it. */
.subbar {
  position: absolute;
  right: 0;
  bottom: 12px;
  left: 0;
  padding: 0 12px;
  text-align: center;
}

.sub {
  display: inline-block;
  max-width: 100%;
  margin: 0;
  padding: 4px 12px;
  border-radius: 6px;
  background: rgba(8, 8, 8, 0.8);
  color: #fff;
  font-size: 19px;
  line-height: 1.5;
}

/* A button is an atomic inline, which a line may break after: keep the last word with its period. */
.nobreak {
  white-space: nowrap;
}

.sub .lv {
  margin: 0;
  padding: 0 1px;
  border: 0;
  border-radius: 3px;
  background: none;
  color: var(--level);
  font: inherit;
  cursor: default;
}

.js .sub .lv {
  cursor: pointer;
}

.js .sub .lv:hover {
  background: rgba(138, 180, 248, 0.35);
}

.sub .lv.is-saved {
  color: var(--saved);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.16em;
}

.sub .lv[aria-expanded="true"] {
  background: var(--pressed);
  color: #0b0b0b;
}

.subctl {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
  line-height: 1.5;
}

.subctl span {
  padding: 0 5px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 3px;
  background: rgba(8, 8, 8, 0.55);
}

/* The lookup popup, as the extension draws it. */
.wordcard {
  --card-width: min(310px, calc(100% - 16px));
  position: absolute;
  bottom: calc(100% + 8px);
  left: calc((100% - var(--card-width)) / 2);
  width: var(--card-width);
  padding: 10px 12px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: var(--popup);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55);
  color: #e8eaed;
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
}

.wordcard[hidden] {
  display: none;
}

.wordcard p,
.mw-popup p {
  margin: 0;
}

.wc-close {
  position: absolute;
  top: 4px;
  right: 6px;
  padding: 0 6px;
  border: 0;
  background: none;
  color: #fff;
  font: inherit;
  font-size: 18px;
  line-height: 1.2;
  opacity: 0.7;
  cursor: pointer;
}

.wc-close:hover {
  opacity: 1;
}

.wc-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  margin-right: 24px !important;
}

.wc-word {
  color: #fff;
  font-size: 18px;
  font-weight: 600;
}

.wc-phonetic {
  color: var(--phonetic);
}

.wc-pos,
.wc-sense-pos {
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
}

.wordcard .wc-sense,
.mw-popup .wc-sense {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 6px;
  margin-top: 8px;
}

.wordcard .wc-sense-pos,
.mw-popup .wc-sense-pos {
  min-width: 2.4em;
}

.wordcard .wc-gloss,
.mw-popup .wc-gloss {
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
}

.wc-def {
  margin-top: 8px !important;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
}

.wc-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px !important;
}

.wc-save {
  padding: 3px 14px;
  border: 0;
  border-radius: 6px;
  background: var(--pressed);
  color: #0b0b0b;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.wc-saved {
  color: var(--level);
  font-size: 13px;
}

/* 為什麼這樣學: the comparison after the first screen; 研究怎麼說: the studies, after the features. */

.why {
  margin-top: 28px;
}

.compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 18px 0 8px;
}

.compare-col {
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
}

.compare-col.is-ours {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.compare-col h3 {
  margin: 0 0 6px;
}

.mark-list {
  padding: 0;
  list-style: none;
}

.mark-list li {
  position: relative;
  padding-left: 26px;
}

.mark-list li::before {
  position: absolute;
  left: 0;
  font-weight: 700;
}

.mark-list.is-cross li::before {
  content: "✕";
  color: var(--muted);
}

.mark-list.is-check li::before {
  content: "✓";
  color: var(--success);
}

.reasons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: reason;
}

.reason {
  margin: 0;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  counter-increment: reason;
}

.reason h3 {
  margin: 0 0 8px;
}

.reason h3::before {
  content: counter(reason) "．";
  color: var(--accent);
}

.reason p {
  margin-bottom: 0;
}

/* The feature sections: the words beside a drawn picture of the extension. */

.features {
  margin-top: 8px;
}

.feature {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: 24px 44px;
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
}

.feature:nth-of-type(even) .feature-text {
  order: 2;
}

.feature-text {
  min-width: 0;
}

.feature-text h3 {
  margin-top: 0;
  font-size: 21px;
}

.feature-text ul {
  padding-left: 20px;
}

.mock {
  min-width: 0;
  padding: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-soft);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  font-size: 14px;
  line-height: 1.55;
}

.mock p {
  margin: 0;
}

/* 1. The subtitle coloured by level, and 本片認識率 in the 字幕全文 panel */

.ml-player {
  position: relative;
  padding: 44px 12px 14px;
  border-radius: 8px;
  background: linear-gradient(180deg, #2a3355, #101d33);
  text-align: center;
}

.ml-chip {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(8, 8, 8, 0.6);
  color: #fff;
  font-size: 12px;
}

.mock-sub {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 5px;
  background: rgba(8, 8, 8, 0.8);
  color: #fff;
  font-size: 16px;
}

.mock-sub .lv {
  color: var(--level);
}

.ml-panel {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #1f1f23;
  color: #e8eaed;
}

.ml-head {
  font-weight: 600;
}

.ml-meter {
  height: 8px;
  margin: 8px 0 !important;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.15);
}

.ml-fill {
  display: block;
  width: 92%;
  height: 100%;
  border-radius: 4px;
  background: var(--level);
  transform-origin: left center;
}

.ml-guess {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
}

.ml-guess strong {
  color: #fff;
}

.ml-label {
  margin-top: 8px !important;
  font-weight: 600;
}

.ml-words {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.ml-words li {
  margin: 2px 0;
}

.ml-words [lang="en"] {
  color: var(--level);
}

/* 2. A saved card, with the picture and the sound of that moment */

.mc-card {
  max-width: 420px;
  margin: 0 auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.mc-media {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.mc-shot {
  display: block;
  width: 200px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  border-radius: 6px;
}

.mc-sound {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mc-play {
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.mc-wave {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 26px;
}

.mc-wave i {
  display: block;
  width: 3px;
  height: 60%;
  border-radius: 2px;
  background: var(--accent);
  transform-origin: center;
}

.mc-wave i:nth-child(3n + 1) {
  height: 35%;
}

.mc-wave i:nth-child(4n) {
  height: 90%;
}

.mc-head {
  margin-top: 12px !important;
  font-size: 18px;
}

.mc-head .wc-phonetic,
.mr-word .wc-phonetic {
  color: var(--muted);
  font-size: 15px;
}

.mc-head .wc-pos {
  color: var(--muted);
}

.mock .wc-sense {
  margin-top: 2px;
}

.mock .wc-sense-pos {
  margin-right: 4px;
  color: var(--muted);
}

.mc-sentence,
.mr-sentence {
  margin-top: 8px !important;
  color: var(--text);
}

.mock mark {
  padding: 0 2px;
  border-radius: 3px;
  background: #ffe8a3;
  color: inherit;
}

/* 3. The review page, and 送到 Anki */

.mr-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.mr-tab,
.mr-anki {
  padding: 2px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

/* The review page's chosen tab, as it draws it: filled with its primary colour. */
.mr-tab.is-on {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-text);
}

.mr-due {
  color: var(--muted);
}

.mr-anki {
  margin-left: auto;
}

/* 送到 Anki worked: in green, as the review page says it. */
.mr-status {
  margin-top: 10px !important;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--success);
}

.mr-card {
  margin-top: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  text-align: center;
}

.mr-sentence {
  font-size: 16px;
}

.mr-answer {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.mr-word {
  font-size: 18px;
}

.mr-grades {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 12px !important;
}

.mr-grades span {
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  white-space: nowrap;
}

.mr-grades b {
  margin-right: 4px;
  padding: 0 4px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.mr-grades small {
  color: var(--muted);
}

/* 4. The statistics tab's charts */

.mock-stats {
  background: #fff;
}

.ms-title {
  font-weight: 600;
}

.ms-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  margin: 6px 0 4px;
}

.ms-velocity {
  --unit: 13px;
}

.ms-week {
  --unit: 4px;
}

.ms-col {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.ms-col b {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.ms-bar {
  display: flex;
  flex-direction: column;
  width: 70%;
  max-width: 34px;
  border-bottom: 1px solid var(--line);
  transform-origin: bottom center;
}

.ms-bar i {
  display: block;
  height: calc(var(--v) * var(--unit));
}

.ms-a {
  background: var(--chart-learned);
}

.ms-b {
  background: var(--chart-manual);
}

.ms-c {
  background: var(--chart-reviews);
}

.ms-col small {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.ms-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-bottom: 12px !important;
  color: var(--muted);
  font-size: 12px;
}

.ms-legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 5px;
  border-radius: 2px;
}

/* 5. Double-click a word on a web page */

.mock-web {
  padding: 0;
  background: #fff;
}

.mw-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}

.mw-bar i {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line);
}

.mw-address {
  flex: 1;
  height: 16px;
  margin-left: 8px;
  border-radius: 8px;
  background: #fff;
}

.mw-page {
  position: relative;
  padding: 16px 18px 18px;
}

.mw-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 700;
}

.mock-article {
  margin-top: 6px !important;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  line-height: 1.7;
}

.mock-article .lv {
  border-radius: 2px;
  background: rgba(140, 233, 154, 0.42);
}

.mock-article .mw-picked {
  background: #b3d4ff;
}

.mw-popup {
  width: min(280px, 100%);
  margin: 10px 0 0 auto;
  padding: 10px 12px 12px;
  border-radius: 8px;
  background: var(--popup);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  color: #e8eaed;
}

.mw-popup .wc-sense-pos {
  color: rgba(255, 255, 255, 0.62);
}

.mw-popup .wc-save {
  cursor: default;
}

.mw-lines {
  margin-top: 12px !important;
}

.mw-lines i {
  display: block;
  height: 8px;
  margin: 8px 0;
  border-radius: 4px;
  background: var(--bg-soft);
}

.mw-lines i:last-child {
  width: 60%;
}

/* 6. Google Drive sync */

.sy-diagram {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  margin: 0 auto 8px;
}

.sy-panel {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.sy-title {
  font-size: 16px;
  font-weight: 700;
}

.sy-muted {
  color: var(--muted);
}

.sy-snap {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  margin-top: 8px !important;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.sy-snap small {
  color: var(--muted);
}

.sy-ok {
  margin-top: 8px !important;
  color: var(--success);
}

/* The sections kept from the first version */

.kept {
  max-width: 880px;
}

/* The Chrome Web Store's badge, the last of the page in Chinese: at half its PNG's size, smaller and
   quieter than the first screen's 加到 Chrome（免費）. */
.store-badge {
  margin: 44px 0 0;
}

.store-badge a {
  display: inline-block;
}

.store-badge img {
  display: block;
  width: 170px;
  height: auto;
}

/* Narrow screens */

@media (max-width: 900px) {
  .home .hero,
  .feature {
    grid-template-columns: minmax(0, 1fr);
  }

  .feature:nth-of-type(even) .feature-text {
    order: 0;
  }
}

@media (max-width: 680px) {
  .compare,
  .reasons {
    grid-template-columns: minmax(0, 1fr);
  }

  /* The header on two lines: NoticeWords and 登入 (or 登出) on the first, the navigation below. */
  .site-header .sign-in,
  .site-header .sign-out {
    order: 1;
    margin-left: auto;
  }

  .site-header nav {
    order: 2;
    flex-basis: 100%;
    margin-left: 0;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }

  h1,
  .hero h1 {
    font-size: 27px;
  }

  main {
    padding-top: 28px;
  }

  .home main {
    padding-top: 16px;
  }

  .home .hero {
    gap: 16px;
  }

  .home .lead {
    font-size: 16px;
    line-height: 1.65;
  }

  .hero-actions {
    margin-top: 14px;
  }

  .frame {
    min-height: 340px;
  }

  .sub {
    font-size: 16px;
  }

  .ms-velocity .ms-col:nth-child(even) small {
    visibility: hidden;
  }
}

/* ---------------------------------------------------------------------------------------------
   Motion. Only when the visitor has not asked for reduced motion. The pictures' animations run
   once a picture is in view: demo.js adds `motion` to <html> (it does so only with no preference)
   and `is-playing` to each picture as it comes into view. Without the script, or with reduced
   motion, nothing here applies and every picture stands complete.
   --------------------------------------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  .button {
    transition: background-color 0.15s ease;
  }

  /* The first screen: the green words light up, the card opens, the lighthouse beam sweeps. */
  .sub .lv {
    animation: level-in 0.7s ease-out backwards;
  }

  .sub .lv:nth-of-type(1) {
    animation-delay: 0.4s;
  }

  .sub .lv:nth-of-type(2) {
    animation-delay: 0.7s;
  }

  .sub .nobreak .lv {
    animation-delay: 1s;
  }

  .wordcard.is-open {
    animation: card-in 0.3s ease-out backwards;
  }

  /* The card open in the HTML opens after the words light up; a card opened later, at once. */
  #card-lighthouse.is-open:not(.is-reopened) {
    animation-delay: 1.4s;
  }

  /* One sweep, over by 4.8 s (site/test/home.test.ts: under 5 s, WCAG 2.2.2). */
  .frame .beam {
    animation: beam 3.6s ease-in-out 1.2s 1;
    transform-origin: 170px 124px;
  }

  /* The pictures: held at their first frame until they come into view. */
  .motion .mock:not(.is-playing) *,
  .motion .mock:not(.is-playing) *::before {
    animation-play-state: paused !important;
  }

  .motion .mock-levels .mock-sub .lv {
    animation: level-in 0.6s ease-out backwards;
  }

  .motion .mock-levels .mock-sub .lv:nth-of-type(2) {
    animation-delay: 0.25s;
  }

  .motion .mock-levels .mock-sub .lv:nth-of-type(3) {
    animation-delay: 0.5s;
  }

  .motion .mock-levels .mock-sub .lv:nth-of-type(4) {
    animation-delay: 0.75s;
  }

  .motion .mock-levels .ml-fill {
    animation: grow-x 1.1s ease-out 0.9s backwards;
  }

  .motion .mock-levels .ml-words li {
    animation: rise-in 0.4s ease-out backwards;
  }

  .motion .mock-levels .ml-words li:nth-child(1) {
    animation-delay: 1.4s;
  }

  .motion .mock-levels .ml-words li:nth-child(2) {
    animation-delay: 1.55s;
  }

  .motion .mock-levels .ml-words li:nth-child(3) {
    animation-delay: 1.7s;
  }

  .motion .mock-levels .ml-words li:nth-child(4) {
    animation-delay: 1.85s;
  }

  .motion .mock-card .mc-card {
    animation: rise-in 0.6s ease-out 0.2s backwards;
  }

  .motion .mock-card .mc-wave i {
    animation: wave 0.9s ease-in-out 0.9s 4;
  }

  .motion .mock-card .mc-wave i:nth-child(2n) {
    animation-delay: 1.05s;
  }

  .motion .mock-card .mc-wave i:nth-child(3n) {
    animation-delay: 1.2s;
  }

  .motion .mock-review .mr-good {
    animation: press 0.6s ease-out 0.8s;
  }

  .motion .mock-review .mr-status {
    animation: rise-in 0.5s ease-out 1.5s backwards;
  }

  .motion .mock-stats .ms-bar {
    animation: grow-y 0.8s ease-out backwards;
  }

  .motion .mock-stats .ms-col:nth-child(2) .ms-bar { animation-delay: 0.05s; }
  .motion .mock-stats .ms-col:nth-child(3) .ms-bar { animation-delay: 0.1s; }
  .motion .mock-stats .ms-col:nth-child(4) .ms-bar { animation-delay: 0.15s; }
  .motion .mock-stats .ms-col:nth-child(5) .ms-bar { animation-delay: 0.2s; }
  .motion .mock-stats .ms-col:nth-child(6) .ms-bar { animation-delay: 0.25s; }
  .motion .mock-stats .ms-col:nth-child(7) .ms-bar { animation-delay: 0.3s; }
  .motion .mock-stats .ms-col:nth-child(8) .ms-bar { animation-delay: 0.35s; }
  .motion .mock-stats .ms-col:nth-child(9) .ms-bar { animation-delay: 0.4s; }
  .motion .mock-stats .ms-col:nth-child(10) .ms-bar { animation-delay: 0.45s; }
  .motion .mock-stats .ms-col:nth-child(11) .ms-bar { animation-delay: 0.5s; }
  .motion .mock-stats .ms-col:nth-child(12) .ms-bar { animation-delay: 0.55s; }

  .motion .mock-web .mw-picked {
    animation: pick 1.2s ease-out 0.4s backwards;
  }

  .motion .mock-web .mw-popup {
    animation: rise-in 0.4s ease-out 1.6s backwards;
  }

  .motion .mock-sync .sy-flow path {
    animation: flow 1.2s linear 4;
  }

  .motion .mock-sync .sy-ok {
    animation: rise-in 0.5s ease-out 1.2s backwards;
  }

  @keyframes level-in {
    from {
      color: #fff;
    }
  }

  @keyframes card-in {
    from {
      opacity: 0;
      transform: translateY(8px);
    }
  }

  @keyframes beam {
    0%,
    100% {
      opacity: 1;
      transform: rotate(0deg);
    }
    50% {
      opacity: 0.55;
      transform: rotate(-5deg);
    }
  }

  @keyframes rise-in {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
  }

  @keyframes grow-x {
    from {
      transform: scaleX(0);
    }
  }

  @keyframes grow-y {
    from {
      transform: scaleY(0);
    }
  }

  @keyframes wave {
    50% {
      transform: scaleY(0.35);
    }
  }

  @keyframes press {
    40% {
      border-color: var(--accent);
      background: var(--accent-soft);
      transform: scale(0.95);
    }
  }

  @keyframes pick {
    0%,
    45% {
      background: rgba(140, 233, 154, 0.42);
    }
  }

  @keyframes flow {
    to {
      stroke-dashoffset: -26;
    }
  }
}
