/* Literate Chinese: app comparison pages (compare/*.html).
   Loaded AFTER /css/styles.css; reuses its tokens. Generator: generate_compare_pages.py */

.cmp-main { padding-bottom: 8px; }

/* ---------- hero ---------- */
.cmp-hero {
  background: linear-gradient(180deg, var(--primary-tint) 0%, #f7fbf8 70%, #fff 100%);
  border-bottom: 1px solid var(--border);
  padding: 26px 0 18px;
}
.cmp-hero .breadcrumb { margin-bottom: 12px; }
.cmp-hero h1 { font-size: clamp(1.7rem, 4.2vw, 2.5rem); font-weight: 800; margin-bottom: .4em; max-width: 860px; }
.cmp-dek { font-size: 1.1rem; color: #34404d; max-width: 780px; margin-bottom: 14px; }
.cmp-hero .byline { margin: 0; flex-wrap: wrap; }

/* ---------- body ---------- */
.cmp-body { max-width: 980px; padding-top: 24px; }
.cmp-body > section, .cmp-body > aside, .cmp-body > figure { max-width: 860px; }
.cmp-section { margin: 40px 0; }
.cmp-section h2, .cmp-verdict h2 { font-size: 1.6rem; font-weight: 800; }
.cmp-section p { max-width: 780px; }
.cmp-note { color: var(--muted); font-size: .95rem; }

.cmp-disclosure {
  background: var(--bg-soft); border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 18px; font-size: .97rem; color: #34404d; margin: 4px 0 30px;
}

/* ---------- verdict ---------- */
.cmp-verdict { margin: 10px 0 36px; }
.cmp-verdict-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cmp-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px 8px; box-shadow: var(--shadow-sm);
}
.cmp-card h3 { font-size: 1.2rem; font-weight: 800; margin-bottom: .6em; }
.cmp-card ul { padding-left: 1.15em; }
.cmp-card li { margin-bottom: .7em; }
.cmp-card-other { border-top: 4px solid #8a96a3; }
.cmp-card-lc { border-top: 4px solid var(--primary); }
.cmp-both { margin-top: 16px; max-width: 780px; }

/* ---------- comparison table ---------- */
.cmp-table-wrap { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-sm); }
.cmp-table { display: table; width: 100%; border-collapse: collapse; font-size: .96rem; overflow: visible; }
.cmp-table th, .cmp-table td { text-align: left; vertical-align: top; padding: 11px 14px; border-bottom: 1px solid var(--border); }
.cmp-table thead th { background: var(--bg-soft); font-weight: 800; font-size: .95rem; }
.cmp-table thead th:last-child { color: var(--primary-dark); }
.cmp-table tbody th { font-weight: 700; width: 19%; color: var(--ink); background: #fbfcfb; }
.cmp-table td { width: 40.5%; }
.cmp-table tbody tr:last-child th, .cmp-table tbody tr:last-child td { border-bottom: 0; }

/* ---------- figure (floats beside the "Where Literate Chinese…" section) ---------- */
.cmp-section { display: flow-root; }
.cmp-figure { float: right; width: 200px; margin: 4px 0 16px 30px; }
.cmp-figure img { display: block; width: 100%; border-radius: 22px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.cmp-figure figcaption { color: var(--muted); font-size: .88rem; line-height: 1.45; margin-top: 10px; }

/* ---------- in-page nav ---------- */
.cmp-toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.cmp-toc a {
  padding: 5px 12px; border: 1px solid var(--border); border-radius: 999px; background: #fff;
  color: var(--ink); font-weight: 700; font-size: .86rem;
}
.cmp-toc a:hover { border-color: var(--primary); color: var(--primary-dark); }
.cmp-section, .cmp-verdict { scroll-margin-top: 80px; }

/* ---------- who ---------- */
.cmp-who { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cmp-who-card { background: var(--bg-soft); border-radius: var(--radius-sm); padding: 18px 20px 8px; }
.cmp-who-card h3 { font-size: 1.1rem; margin-bottom: .5em; }
.cmp-who-card ul { padding-left: 1.15em; }
.cmp-who-card li { margin-bottom: .45em; }

/* ---------- FAQ (visible) ---------- */
.cmp-body .faq-block h3 { font-size: 1.12rem; }

/* ---------- free resources ---------- */
.cmp-res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.cmp-res {
  display: block; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 16px; color: var(--ink); transition: border-color .15s ease, transform .15s ease;
}
.cmp-res:hover { border-color: var(--primary); transform: translateY(-2px); color: var(--ink); }
.cmp-res strong { display: block; color: var(--primary-dark); margin-bottom: 3px; }
.cmp-res span { display: block; font-size: .92rem; color: var(--muted); line-height: 1.45; }

.cmp-body .cta-box { margin-left: 0; }
.cmp-small { font-size: .95rem; }
.cmp-small h2 { font-size: 1.25rem; }
.cmp-sources { padding-left: 1.15em; }
.cmp-sources li { margin-bottom: .3em; word-break: break-word; }
.cmp-body .related-posts { max-width: 860px; }
.cmp-body .related-posts h2 { font-size: 1.25rem; }

/* ---------- phones ---------- */
@media (max-width: 720px) {
  .cmp-verdict-grid, .cmp-who { grid-template-columns: 1fr; }
  .cmp-figure { float: none; width: 210px; margin: 6px auto 20px; }
  .cmp-figure figcaption { text-align: center; }
  /* table becomes stacked cards: feature name, then each app labelled */
  .cmp-table-wrap { border: 0; box-shadow: none; border-radius: 0; }
  .cmp-table, .cmp-table tbody, .cmp-table tr, .cmp-table th, .cmp-table td { display: block; width: 100%; }
  .cmp-table thead { display: none; }
  .cmp-table tr { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 12px; overflow: hidden; }
  .cmp-table tbody th { width: 100%; background: var(--bg-soft); padding: 9px 14px; }
  .cmp-table td { padding: 9px 14px; }
  .cmp-table td::before { content: attr(data-label); display: block; font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 2px; }
  .cmp-table td:last-child::before { color: var(--primary-dark); }
  .cmp-table tbody tr:last-child td:last-child { border-bottom: 0; }
  .cmp-table td:last-child { border-bottom: 0; }
}
