/* t2314u product chrome — DESIGN-PACK §1–§5.
   Linked from every template that loads chrome.js. a11y.css also
   @imports this file so a page that misses the link still gets the rules. */

:root {
  --canvas: #050914;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #ffffff;
  --text-2: #c8cce0;
  --text-3: #888fb1;
  --accent: #0066ff;
  --accent-text: #4d94ff;
  --accent-soft: rgba(0, 102, 255, 0.14);
  --ok: #4ade80;
  --warn: #fbbf24;
  --danger: #f87171;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-pill: 999px;
  --brand-dark: #050914;
  --brand-blue: #0066ff;
  --brand-blue-text: #4d94ff;
  --glass: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.08);
  --text-gray: #888fb1;
}

html, body {
  background-color: var(--canvas);
  font-family: "Inter", "PingFang SC", "Hiragino Sans", "Noto Sans KR", "Segoe UI", sans-serif;
}

/* Chinese-only blocks stay on zh pages. Other locales use the English shell. */
html:not([lang|="zh"]) .only-zh { display: none !important; }

body > nav,
nav.site-nav {
  height: 56px;
  min-height: 56px;
  padding: 0 clamp(16px, 4vw, 6%);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  flex-wrap: nowrap;
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(5, 9, 20, 0.92);
  /* A backdrop-filter here becomes the containing block for position:fixed
     descendants, which parks the phone Lang panel above the viewport. */
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom: 1px solid var(--line);
}

body > nav .brand-area,
nav.site-nav .brand-area {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  flex: 0 0 auto;
  min-width: 0;
}

body > nav .brand-name,
nav.site-nav .brand-name,
body > nav .brand-name a {
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0;
  white-space: nowrap;
}

body > nav .brand-logo,
nav.site-nav .brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

body > nav .nav-links,
nav.site-nav .nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: nowrap;
  overflow: visible;
}

body > nav .nav-link,
nav.site-nav .nav-link {
  color: var(--text-3);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  white-space: nowrap;
  line-height: 1.2;
  background: transparent;
  min-height: 0;
  transition: background 140ms ease-out, color 140ms ease-out;
}

body > nav .nav-link:hover,
nav.site-nav .nav-link:hover {
  color: var(--text);
  background: var(--surface-2);
}

body > nav .nav-link[aria-current="page"],
nav.site-nav .nav-link[aria-current="page"] {
  color: var(--text);
  background: var(--accent-soft);
}

body > nav .nav-right,
nav.site-nav .nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex: 0 0 auto;
}

.lang-switch {
  display: none !important;
}

.search-btn,
.lang-current {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: background 140ms ease-out, border-color 140ms ease-out;
}

.lang-current {
  width: auto;
  min-width: 36px;
  padding: 0 12px;
  gap: 6px;
}

.search-btn:hover,
.lang-current:hover,
.lang-current[aria-expanded="true"] {
  background: var(--surface-2);
  color: var(--text);
}

.search-btn:focus-visible,
.lang-current:focus-visible,
.lang-option:focus-visible,
.cc-chip:focus-visible,
.tabbar a:focus-visible,
.tabbar button:focus-visible,
.more-sheet a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.28);
}

.lang-pop { position: relative; }

.lang-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 1200;
  min-width: 220px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: rgba(5, 9, 20, 0.96);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  transform-origin: top right;
  animation: kapps-lang-in 140ms ease-out;
}

.lang-panel[hidden] { display: none !important; }

@keyframes kapps-lang-in {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.lang-option {
  width: 100%;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.lang-option:hover { background: var(--surface-2); color: var(--text); }

.lang-option[aria-selected="true"] {
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 650;
}

.lang-option .lang-check {
  width: 14px;
  flex: 0 0 14px;
  color: var(--accent-text);
  font-weight: 700;
}

/* Tablet: mid links scroll as a chip rail. Search + Lang stay pinned. */
@media (min-width: 720px) and (max-width: 1099px) {
  body > nav .nav-links,
  nav.site-nav .nav-links {
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    gap: 4px;
  }
  body > nav .nav-links::-webkit-scrollbar,
  nav.site-nav .nav-links::-webkit-scrollbar { display: none; }
  body > nav .nav-link,
  nav.site-nav .nav-link {
    scroll-snap-align: start;
    flex: 0 0 auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    padding: 6px 12px;
  }
  body > nav .nav-link[aria-current="page"],
  nav.site-nav .nav-link[aria-current="page"] {
    background: var(--accent-soft);
    border-color: transparent;
  }
}

/* Phone: logo + search + lang. Links move to the bottom tab bar. */
@media (max-width: 719px) {
  body > nav,
  nav.site-nav {
    height: 52px;
    min-height: 52px;
  }
  body > nav .nav-links,
  nav.site-nav .nav-links { display: none !important; }
  /* Same anchor as desktop: under the top-right Lang control, not a bottom sheet.
     Height cap keeps the open list above the tab bar; extra rows scroll inside. */
  .lang-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    bottom: auto;
    min-width: 220px;
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 52px - 58px - 16px);
    max-height: calc(100dvh - 52px - 58px - 16px);
    overflow-y: auto;
    transform-origin: top right;
  }
}

.tabbar {
  display: none;
}

@media (max-width: 719px) {
  .tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 58px;
    padding: 4px 2px calc(4px + env(safe-area-inset-bottom));
    background: rgba(5, 9, 20, 0.96);
    border-top: 1px solid var(--line);
    justify-content: stretch;
    align-items: stretch;
    gap: 0;
    overflow: hidden;
  }
  .tabbar a,
  .tabbar button {
    flex: 1 1 0;
    width: 0;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    border: 0;
    background: transparent;
    color: var(--text-3);
    font: inherit;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-decoration: none;
    border-radius: 8px;
    cursor: pointer;
    padding: 0 1px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .tabbar a[aria-current="page"],
  .tabbar button[aria-expanded="true"] {
    color: var(--text);
    background: var(--accent-soft);
  }
  body:has(.tabbar) { padding-bottom: 72px !important; }
}

@media (max-width: 719px) and (orientation: landscape) {
  .tabbar { height: 48px; }
  body:has(.tabbar) { padding-bottom: 56px !important; }
}

.more-sheet {
  display: none;
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 70px;
  z-index: 1110;
  padding: 8px;
  background: rgba(5, 9, 20, 0.96);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.more-sheet.is-open { display: flex; flex-direction: column; }

.more-sheet a {
  height: 44px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--text-2);
  text-decoration: none;
  font-weight: 600;
}

.more-sheet a:hover,
.more-sheet a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--text);
}

.wave-b-note {
  max-width: 960px;
  margin: 12px auto 0;
  padding: 10px 16px;
  color: var(--text-3);
  font-size: 13px;
  line-height: 1.45;
}

/* Search overlay — shared so every page can open it, radius from §1. */
.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(5, 9, 20, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  flex-direction: column;
  align-items: center;
  padding: 12vh 5% 5%;
}
.search-overlay.open { display: flex; }
.search-overlay .close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
}
.search-overlay .search-input-wrap { width: 100%; max-width: 640px; position: relative; }
.search-overlay .search-input-wrap input {
  width: 100%;
  padding: 14px 16px 14px 44px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  outline: none;
}
.search-overlay .search-input-wrap input:focus {
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.28);
  border-color: var(--accent);
}
.search-overlay .search-icon-input {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}
.search-overlay .results-count { color: var(--text-3); font-size: 13px; margin-top: 10px; }
.search-overlay .results-list { width: 100%; max-width: 640px; margin-top: 12px; max-height: 55vh; overflow: auto; }
.search-overlay .result-item {
  display: block;
  padding: 12px 14px;
  margin-bottom: 6px;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  text-decoration: none;
}
.search-overlay .result-item:hover { background: var(--surface-2); }
.search-overlay .r-title { color: var(--text); font-weight: 650; font-size: 14px; }
.search-overlay .r-title em { color: var(--accent-text); font-style: normal; }
.search-overlay .r-desc { color: var(--text-3); font-size: 13px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-overlay .r-meta { display: flex; gap: 6px; margin-top: 6px; }
.search-overlay .r-meta span { font-size: 11px; color: var(--text-3); }

/* Knowledge list: no update timestamps. Detail pages keep their Updated line. */
.faq-listing .faq-date,
#faq-list .faq-date,
#home-faq-list .home-post-meta,
.faq-listing .faq-cta,
.faq-cta,
.blog-cta {
  display: none !important;
}

.faq-tag,
.home-post-tag {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.04em;
  color: var(--accent-text);
}

.faq-listing h1,
article.faq-listing h1 {
  font-size: clamp(1.75rem, 3.2vw, 2.4rem);
  font-weight: 750;
  letter-spacing: -0.02em;
}

.faq-listing h1 .hl {
  -webkit-text-fill-color: currentColor;
  background: none;
  color: inherit;
}

/* Calendar hub */
.cc-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px clamp(16px, 4vw, 6%) 48px;
  color: var(--text);
}

.cc-page h1 {
  font-size: clamp(1.75rem, 3.2vw, 2.4rem);
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 8px;
}

.cc-lede {
  margin: 0;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.45;
  max-width: 68ch;
}

.cc-lede a { color: var(--accent-text); font-weight: 650; text-decoration: none; }
.cc-lede a:hover { text-decoration: underline; }

.cc-chips {
  display: flex;
  gap: 8px;
  margin: 18px 0 14px;
}

.cc-chip {
  flex: 1 1 0;
  max-width: 220px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: none;
  cursor: pointer;
  transition: background 140ms ease-out, border-color 140ms ease-out, color 140ms ease-out;
}

.cc-chip:hover { background: var(--surface-2); color: var(--text); }

.cc-chip[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--text);
  border-color: transparent;
  box-shadow: inset 2px 0 0 var(--accent);
}

.cc-count {
  color: var(--text-3);
  font-size: 12px;
  margin: 0 0 8px;
}

.cc-pager {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 0;
}

.cc-pager[hidden] { display: none; }

.cc-pager button {
  appearance: none;
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.cc-pager button:disabled {
  opacity: 0.4;
  cursor: default;
}

.cc-pager span {
  color: var(--text-3);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.cc-row.is-past .cc-date { color: var(--text-3); }

.cc-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: transparent;
}

.cc-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  min-width: 720px;
}

.cc-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: left;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.04em;
  color: var(--text-3);
  background: #070d1c;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.cc-table td {
  padding: 12px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
  color: var(--text-2);
  background: transparent;
}

.cc-table tbody tr:nth-child(even) td { background: rgba(255, 255, 255, 0.03); }

.cc-table th:first-child,
.cc-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #070d1c;
}

.cc-table tbody tr:nth-child(even) td:first-child { background: #0b1224; }

.cc-table th:first-child { z-index: 3; }

.cc-table th:last-child,
.cc-table td:last-child {
  position: sticky;
  right: 0;
  background: #070d1c;
}

.cc-table th:last-child { z-index: 3; }
.cc-table td:last-child { z-index: 1; }

.cc-table tbody tr:nth-child(even) td:last-child { background: #0b1224; }

.cc-table a.cc-title {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.cc-table a.cc-title:hover { color: var(--accent-text); }

.cc-date { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--text); }

.cc-urg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.04em;
}
.cc-urg-P0 { background: rgba(248, 113, 113, 0.16); color: var(--danger); }
.cc-urg-P1 { background: rgba(251, 191, 36, 0.16); color: var(--warn); }
.cc-urg-P2 { background: var(--surface-2); color: var(--text-3); }

.cc-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  /* t2542u #1：平台名一律写全称（Google Play / App Store），标签按内容撑开、绝不换行折成两截 */
  white-space: nowrap;
  max-width: 100%;
}

.cc-src {
  color: var(--accent-text);
  font-weight: 650;
  font-size: 13px;
  text-decoration: none;
}
.cc-src:hover { text-decoration: underline; }

.cc-empty { color: var(--text-3); padding: 28px 8px; }

.cc-badge-card { display: none; }
.cc-due-word { display: none; }

@media (max-width: 899px) {
  .cc-table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }
  .cc-table { min-width: 0; }
  .cc-table thead { display: none; }
  .cc-table,
  .cc-table tbody { display: block; }
  .cc-table tr {
    display: flex;
    flex-flow: row wrap;
    align-items: center;
    gap: 8px;
    min-height: 72px;
    margin: 0 0 10px;
    padding: 14px 14px 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
  }
  .cc-table td,
  .cc-table tbody tr:nth-child(even) td,
  .cc-table td:first-child,
  .cc-table td:last-child,
  .cc-table tbody tr:nth-child(even) td:first-child,
  .cc-table tbody tr:nth-child(even) td:last-child {
    display: block;
    position: static;
    width: auto;
    padding: 0;
    border: 0;
    background: transparent;
  }
  .cc-table td[data-col="top"] { order: 1; width: auto; }
  .cc-table td[data-col="title"] { order: 2; flex: 1 0 100%; }
  .cc-table td.cc-date { order: 3; width: auto; }
  .cc-table td[data-col="play"] { order: 4; width: auto; }
  .cc-table td[data-col="meta"]:not(.cc-date) { order: 5; width: auto; }
  .cc-badge-table { display: none; }
  .cc-badge-card { display: inline-flex; }
  .cc-due-word { display: none; }
  .cc-table a.cc-title { font-size: 15px; line-height: 1.35; }
}

@media (max-width: 719px) {
  .cc-chips {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    margin-right: -4px;
  }
  .cc-chips::-webkit-scrollbar { display: none; }
  .cc-chip {
    flex: 0 0 42%;
    max-width: none;
    scroll-snap-align: start;
  }
}

@media (min-width: 900px) {
  .cc-table th { top: 0; }
}

.footer-addr + .footer-addr { margin-top: 2px; }
