/* =========================================================
   appios.me — 苹果资源分享站
   全站设计系统 · 现代扁平化 · 固定亮色主题
   换肤只需修改 :root 中的变量，全站生效
   ========================================================= */

:root {
  /* 颜色 */
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f5f5f7;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #a1a1a6;
  --border: #e5e5ea;
  --border-strong: #d2d2d7;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-soft: rgba(0, 113, 227, 0.09);
  --ok: #1d8a4e;
  --ok-soft: rgba(52, 199, 89, 0.15);
  --warn: #c93400;
  --warn-soft: rgba(255, 149, 0, 0.16);
  --info: #0071e3;
  --info-soft: rgba(0, 113, 227, 0.09);
  --danger: #d70015;
  --danger-soft: rgba(255, 59, 48, 0.1);
  --header-bg: rgba(255, 255, 255, 0.82);
  --shadow-hover: 0 10px 28px rgba(0, 0, 0, 0.07);

  /* 动效 */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  /* 尺寸 */
  --radius-lg: 18px;
  --radius-md: 12px;
  --header-h: 64px;
  --container: 1080px;

  /* 固定亮色主题：不跟随系统深色模式 */
  color-scheme: light;
}

/* ---------- 基础 ---------- */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro SC",
    "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; }

a {
  color: inherit;
  text-decoration: none;
}

ul, ol { list-style: none; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

code {
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

svg.icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.14em;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

[hidden] { display: none !important; }

::selection { background: var(--accent-soft); }

:where(a, button):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- 通用小组件 ---------- */

.eyebrow {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.12em;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 980px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  transition: background-color 0.18s ease, color 0.18s ease,
    box-shadow 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px var(--accent-soft);
}

.btn-secondary {
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

.btn-secondary:hover {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
  transform: translateY(-1px);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 11px;
  border-radius: 980px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-free  { background: var(--ok-soft);   color: var(--ok); }
.badge-deal  { background: var(--warn-soft); color: var(--warn); }
.badge-event { background: var(--info-soft); color: var(--info); }
.badge-pin   { background: var(--accent-soft); color: var(--accent); }
.badge-ok    { background: var(--ok-soft);   color: var(--ok); }
.badge-busy  { background: var(--warn-soft); color: var(--warn); }
.badge-neutral { background: var(--surface-2); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--border-strong); }

/* ---------- 顶部导航 ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo .tld {
  color: var(--accent);
  font-weight: 600;
}

.main-nav ul {
  display: flex;
  gap: 6px;
}

.main-nav a {
  display: block;
  padding: 8px 16px;
  border-radius: 980px;
  font-size: 14px;
  color: var(--text-2);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.main-nav a:hover {
  color: var(--text);
  background: var(--surface-2);
}

.main-nav a[aria-current="page"] {
  color: var(--accent);
  font-weight: 600;
  background: var(--accent-soft);
}

/* ---------- 按钮组（404 / 文章页返回等场景） ---------- */

.hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
}

/* ---------- 通用 Section ---------- */

.section { padding: 40px 0 72px; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.section-head h2 {
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.section-head .sub {
  margin-top: 6px;
  font-size: 15px;
  color: var(--text-2);
}

.more-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  white-space: nowrap;
  padding-bottom: 4px;
}

.more-link:hover { opacity: 0.8; }

.more-link .icon {
  transition: transform 0.25s var(--ease-out);
}

.more-link:hover .icon { transform: translateX(3px); }

/* ---------- 首页双栏内容区 ---------- */

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
  padding-top: 20px;
  padding-bottom: 84px;
}

.home-main { min-width: 0; }

.home-side {
  min-width: 0;
  padding: 0 20px;
}

.side-block { margin-bottom: 40px; }
.side-block:last-child { margin-bottom: 0; }

.side-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.side-head h2 {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.latest-list.compact .latest-item { padding: 13px 18px; gap: 12px; }
.latest-list.compact .latest-item:hover { padding-left: 22px; }
.latest-list.compact .latest-item .title { font-size: 14px; }

/* 锚点定位时避开吸顶导航 */
section[id] { scroll-margin-top: calc(var(--header-h) + 16px); }

@media (max-width: 1020px) {
  .home-grid { grid-template-columns: 1fr; gap: 52px; padding-bottom: 64px; }
  .home-side { padding: 0; }
}

@media (max-width: 640px) {
  .header-inner {
    height: auto;
    min-height: var(--header-h);
    flex-wrap: wrap;
    gap: 0;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .main-nav { width: 100%; }
  .main-nav ul { justify-content: space-between; gap: 0; }
  .main-nav a { padding: 7px 10px; font-size: 13.5px; white-space: nowrap; }
}

/* ---------- 首页最新快讯列表 ---------- */

.latest-list {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.latest-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 24px;
  transition: background-color 0.2s ease, padding-left 0.25s var(--ease-out);
}

.latest-item + .latest-item { border-top: 1px solid var(--border); }
.latest-item:hover { background: var(--surface-2); padding-left: 28px; }

.latest-item time {
  font-size: 13px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.latest-item .title {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
  min-width: 0;
  transition: color 0.2s ease;
}

.latest-item:hover .title { color: var(--accent); }

.latest-item > .icon {
  color: var(--text-3);
  font-size: 16px;
  transition: transform 0.25s var(--ease-out), color 0.2s ease;
}

.latest-item:hover > .icon { transform: translateX(4px); color: var(--accent); }

/* 列表行缩略图（首页快讯/技巧预览，取文章首图） */
.item-thumb {
  flex-shrink: 0;
  width: 64px;
  height: 42px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s var(--ease-out);
}

.latest-item:hover .item-thumb img { transform: scale(1.08); }

@media (max-width: 640px) {
  .latest-item { padding: 15px 18px; gap: 12px; }
  .latest-item > .icon { display: none; }
}

/* ---------- 子页头部 ---------- */

.page-hero { padding: 0px 0 8px; }

.page-hero h1 {
  margin: 12px 0 12px;
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.page-hero .lede {
  max-width: 640px;
  font-size: 16px;
  color: var(--text-2);
}

.page-body { padding: 8px 0 88px; }

/* ---------- 快讯页：列表与分页 ---------- */

.list-meta {
  margin: 8px 0 18px;
  font-size: 13px;
  color: var(--text-3);
}

.news-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.news-item {
  padding: 24px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: transform 0.3s var(--ease-out), border-color 0.25s ease,
    box-shadow 0.3s var(--ease-out);
}

.news-item:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-hover);
}

.news-item-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.news-item time {
  margin-left: auto;
  font-size: 13px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.news-item h2 {
  margin-bottom: 6px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.news-item p {
  font-size: 14px;
  color: var(--text-2);
}

@media (max-width: 640px) {
  .news-item { padding: 20px; }
}

/* ---------- 技巧列表：封面卡（板块三） ---------- */

.tip-item {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.tip-item.no-thumb { grid-template-columns: minmax(0, 1fr); }

.tip-thumb {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.tip-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s var(--ease-out);
}

.tip-item:hover .tip-thumb img { transform: scale(1.05); }

.tip-body { display: block; min-width: 0; }

@media (max-width: 640px) {
  .tip-item { grid-template-columns: 1fr; gap: 14px; }
  .tip-thumb { aspect-ratio: 16 / 9; }
}

/* ---------- 帐号共享页 ---------- */

.notice {
  margin-top: 28px;
  padding: 26px 30px;
  background: var(--warn-soft);
  border-radius: var(--radius-lg);
}

.notice h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 17px;
  font-weight: 650;
  color: var(--warn);
}

.notice ol.rules {
  list-style: decimal;
  padding-left: 22px;
  color: var(--text);
}

.notice ol.rules li {
  margin: 6px 0;
  font-size: 14px;
  line-height: 1.7;
}

.notice ol.rules li::marker {
  color: var(--warn);
  font-weight: 600;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.account-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: transform 0.3s var(--ease-out), border-color 0.25s ease,
    box-shadow 0.3s var(--ease-out);
}

.account-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-hover);
}

.account-card.unavailable { opacity: 0.62; }

.account-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.account-head h3 {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 980px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-ok   { color: var(--ok);   background: var(--ok-soft); }
.status-busy { color: var(--warn); background: var(--warn-soft); }
.status-fix  { color: var(--text-2); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border-strong); }

.account-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13.5px;
}

.meta-row {
  display: flex;
  gap: 14px;
}

.meta-row dt { color: var(--text-3); flex-shrink: 0; }
.meta-row dd { color: var(--text-2); font-variant-numeric: tabular-nums; }

.cred {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.cred .label {
  flex-shrink: 0;
  font-size: 12.5px;
  color: var(--text-3);
}

.cred code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--text);
}

.copy-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 8px;
  color: var(--text-3);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.copy-btn:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.copy-btn .icon { width: 15px; height: 15px; }
.copy-btn .icon-check { display: none; }
.copy-btn.copied { color: var(--ok); }
.copy-btn.copied .icon-copy  { display: none; }
.copy-btn.copied .icon-check { display: block; }

.unavailable-note {
  font-size: 13px;
  color: var(--text-3);
}

.hint-card {
  margin-top: 28px;
  padding: 20px 26px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 14px;
  color: var(--text-2);
}

.hint-card a {
  color: var(--accent);
  font-weight: 500;
}

.hint-card a:hover { opacity: 0.8; }

.load-error {
  padding: 40px 24px;
  text-align: center;
  font-size: 14px;
  color: var(--text-3);
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  grid-column: 1 / -1;
}

@media (max-width: 760px) {
  .account-grid { grid-template-columns: 1fr; }
}

/* ---------- 占位页（404） ---------- */

.coming {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 0 140px;
}

.coming h1 {
  margin: 14px 0 16px;
  font-size: clamp(34px, 6vw, 52px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.coming .lede {
  max-width: 480px;
  margin: 0 auto 36px;
  font-size: 16px;
  color: var(--text-2);
}

.coming .hints {
  margin-top: 44px;
  font-size: 13px;
  color: var(--text-3);
}

/* ---------- 页脚 ---------- */

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  padding: 48px 0 40px;
}

.footer-brand p {
  max-width: 320px;
  margin-top: 12px;
  font-size: 14px;
  color: var(--text-2);
}

.footer-col h4 {
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
}

.footer-col li { margin: 8px 0; }

.footer-col a,
.footer-col span {
  font-size: 14px;
  color: var(--text-2);
}

.footer-col a:hover { color: var(--text); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-3);
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 40px 0 32px;
  }
}

/* ---------- 通栏页面（首页 / 帐号共享等，无 container 的满宽布局） ---------- */

.page-wide .header-inner { padding: 10px 24px; }

.page-wide main > section,
.page-wide main > .home-grid {
  padding-left: 24px;
  padding-right: 24px;
}

.page-wide main { padding-top: 16px; }

/* ---------- 文章详情（板块一） ---------- */

.article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0 4px;
}

.article-meta time {
  font-size: 13.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.article-content { padding: 4px 0 8px; }

.article-content p {
  margin: 0 0 18px;
  font-size: 16px;
  line-height: 1.85;
}

.article-content .muted-note { color: var(--text-3); }

.article-content .article-img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 2px 0 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

/* 板块三正文图片：过高图片限制显示高度，等比缩窄并居中 */
.article-content img.tip-img {
  width: auto;
  max-height: 600px;
  object-fit: contain;
  margin-left: auto;
  margin-right: auto;
}

.article-source {
  margin-top: 12px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-2);
  overflow-wrap: anywhere;
}

.article-source a { color: var(--accent); }
.article-source a:hover { opacity: 0.8; }

.article-back { margin-top: 28px; }

.latest-empty {
  color: var(--text-3);
  font-weight: 400;
}

/* ---------- 首页置顶文章卡 ---------- */

.featured-article {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  transition: transform 0.3s var(--ease-out), border-color 0.25s ease,
    box-shadow 0.3s var(--ease-out);
}

.featured-article:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  border-left-color: var(--accent);
  box-shadow: var(--shadow-hover);
}

.featured-article .fa-main { flex: 1; min-width: 0; }

.featured-article .fa-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.featured-article .fa-top time {
  margin-left: auto;
  font-size: 13px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.featured-article h3 {
  margin-bottom: 6px;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.featured-article p {
  font-size: 14px;
  color: var(--text-2);
}

.featured-article > .icon {
  color: var(--text-3);
  font-size: 16px;
}

/* ---------- 文章留言 ---------- */

.comments { margin-top: 48px; }

.comments-title {
  margin-bottom: 16px;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.comment-list {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.comment { padding: 16px 20px; }
.comment + .comment { border-top: 1px solid var(--border); }

.comment-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}

.comment-author {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

.comment-head time {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.comment p {
  font-size: 14.5px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.comments-empty {
  padding: 24px;
  text-align: center;
  font-size: 14px;
  color: var(--text-3);
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}

.comment-form { margin-top: 16px; }

.comment-actions {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.comment-actions .btn { flex-shrink: 0; }

.comment-note {
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-3);
}

.comment-note b { color: var(--text-2); font-weight: 600; }

/* ---------- 邀请码验证门（板块二） ---------- */

.invite-gate { padding: 20px 0 8px; }

.invite-gate .form-card {
  max-width: 460px;
  margin: 0 auto;
  text-align: center;
}

.invite-gate .gate-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.invite-gate .gate-title .icon { color: var(--accent); }

.invite-gate .gate-desc {
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-2);
}

.invite-gate .field {
  max-width: 280px;
  margin: 0 auto 6px;
}

.invite-gate .field input {
  text-align: center;
  letter-spacing: 0.35em;
  font-size: 20px;
  font-weight: 600;
}

.invite-gate .form-error { text-align: center; }

.invite-gate .form-actions { justify-content: center; margin-top: 14px; }

/* 验证成功欢迎弹窗（引导先看教程） */
.welcome-gate { text-align: center; }

.welcome-gate .desc { text-align: left; }

.welcome-gate h3 { font-size: 19px; }

.welcome-actions { justify-content: center; margin-top: 20px; }

.gate-buy {
  margin-top: 18px;
  font-size: 14px;
  color: var(--text-2);
}

.gate-buy a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  color: var(--accent);
}

.gate-buy a:hover { opacity: 0.8; }

.gate-buy a .icon {
  font-size: 14px;
  transition: transform 0.25s var(--ease-out);
}

.gate-buy a:hover .icon { transform: translate(2px, -2px); }

.invite-until {
  padding: 6px 14px;
  background: var(--ok-soft);
  border-radius: 980px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ok);
  white-space: nowrap;
}

/* 帐号列表头右侧：刷新按钮 + 有效期徽章 */
.list-head-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* 移动端：标题一行、按钮/徽章一行，避免挤压（双类提高优先级，覆盖响应式区的 .section-head） */
@media (max-width: 640px) {
  .section-head.list-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .section-head.list-head .list-head-right {
    width: 100%;
    justify-content: space-between;
  }
}

.refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 980px;
  border: 1px solid var(--border-strong);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease,
    transform 0.25s var(--ease-out);
}

.refresh-btn:hover:not(:disabled) {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.refresh-btn:active:not(:disabled) { transform: scale(0.96); }

.refresh-btn:disabled { opacity: 0.6; cursor: default; }

.refresh-btn .icon { font-size: 15px; }

.refresh-btn.loading .icon { animation: refresh-spin 0.8s linear infinite; }

@keyframes refresh-spin {
  to { transform: rotate(360deg); }
}

/* 后台导出卡密：类型/状态选择 */
.export-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.export-inline select {
  padding: 7px 12px;
  font: inherit;
  font-size: 13px;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 980px;
}

/* ---------- 板块二：使用教程 ---------- */

.tutorial-notice { margin-top: 36px; }

.usage-where {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 48px;
  margin-top: 20px;
  padding: 20px 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.usage-where p {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14.5px;
}

.usage-where img {
  height: 30px;
  width: auto;
  border-radius: 7px;
  border: 1px solid var(--border);
}

.usage-where .correct span { color: var(--ok); }
.usage-where .wrong span { color: var(--danger); }

.tutorial-box {
  margin-top: 20px;
  padding: 24px 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
}

.tutorial-text {
  margin-bottom: 18px;
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--text-2);
  text-align: left;
}

.tutorial-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
}

.tutorial-tab {
  padding: 9px 20px;
  border-radius: 980px;
  border: 1px solid var(--border-strong);
  font-size: 14px;
  color: var(--text-2);
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease,
    transform 0.25s var(--ease-out);
}

.tutorial-tab:hover { color: var(--text); transform: translateY(-1px); }

.tutorial-tab.active {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
  font-weight: 500;
}

.tutorial-img-title {
  margin-bottom: 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
}

.tutorial-img {
  display: block;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.faq-item summary {
  padding: 16px 22px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  position: relative;
  transition: color 0.2s ease;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: "";
  position: absolute;
  right: 22px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-3);
  border-bottom: 2px solid var(--text-3);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.25s var(--ease-out);
}

.faq-item[open] summary::after {
  transform: translateY(-30%) rotate(225deg);
}

.faq-item summary:hover { color: var(--accent); }

.faq-body {
  padding: 0 22px 20px;
  border-top: 1px solid var(--border);
}

.faq-body img {
  display: block;
  width: 100%;
  max-width: 480px;
  margin: 18px auto 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.faq-body p {
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--text-2);
}

/* ---------- 密码复制确认弹窗 ---------- */

.copy-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.45);
}

.copy-gate {
  width: 100%;
  max-width: 430px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 26px 24px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.32);
}

.copy-gate h3 {
  margin-bottom: 10px;
  font-size: 17px;
  font-weight: 650;
}

.copy-gate .desc {
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-2);
}

.copy-gate .desc b { color: var(--text); }

.copy-gate .phrase { color: var(--accent); font-weight: 600; }

.copy-gate input {
  width: 100%;
  padding: 10px 14px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
}

.copy-gate input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.copy-gate .form-error {
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--danger-soft);
  border-radius: var(--radius-md);
  color: var(--danger);
  font-size: 13.5px;
}

.copy-gate-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

@media (max-width: 640px) {
  .comment-actions { flex-direction: column; }
  .comment-actions .btn { align-self: flex-start; }
}

/* ---------- 表单（后台 / 登录） ---------- */

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.field { margin-bottom: 18px; }

.field > label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
}

.field input[type="text"],
.field input[type="password"],
.field input[type="url"],
.field select,
.field textarea {
  width: 100%;
  padding: 10px 14px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  transition: border-color 0.15s ease;
}

.field textarea { resize: vertical; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.field .checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 0;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-2);
  cursor: pointer;
}

.field .checkbox-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.form-error {
  margin-bottom: 18px;
  padding: 12px 16px;
  background: var(--danger-soft);
  border-radius: var(--radius-md);
  color: var(--danger);
  font-size: 14px;
}

.form-error p { margin: 0 0 4px; }
.form-error p:last-child { margin-bottom: 0; }

/* ---------- 管理后台 ---------- */

.admin-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 48px 0 24px;
}

.admin-top h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.admin-sub {
  margin-top: 6px;
  font-size: 14px;
  color: var(--text-2);
}

.table-wrap {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th,
.admin-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.admin-table th {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-3);
  white-space: nowrap;
}

.admin-table tr:last-child td { border-bottom: none; }

.admin-table td a { color: var(--text); font-weight: 500; }
.admin-table td a:hover { color: var(--accent); }

.admin-table .actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.pub-state { font-size: 13px; color: var(--ok); font-weight: 500; }
.pub-state.draft { color: var(--text-3); }

.muted-cell { color: var(--text-3); }
.comment-cell {
  max-width: 320px;
  overflow-wrap: anywhere;
}

.btn-sm { padding: 7px 14px; font-size: 13px; }

.btn-danger {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 980px;
  font-size: 13px;
  font-weight: 500;
  color: var(--danger);
  box-shadow: inset 0 0 0 1px var(--border-strong);
  transition: color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.btn-danger:hover {
  background: var(--danger-soft);
  box-shadow: inset 0 0 0 1px var(--danger);
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-2);
}

.pager a { color: var(--accent); font-weight: 500; }
.pager a:hover { opacity: 0.8; }
.pager .disabled { color: var(--text-3); }

/* ---------- 登录页 ---------- */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px 32px;
}

.login-card .logo {
  display: block;
  margin-bottom: 6px;
  text-align: center;
  font-size: 22px;
}

.login-card .sub {
  margin-bottom: 24px;
  text-align: center;
  font-size: 14px;
  color: var(--text-2);
}

.btn-block { width: 100%; justify-content: center; }

/* ---------- 响应式 ---------- */

@media (max-width: 640px) {
  .section { padding: 24px 0 56px; }
  .section-head { flex-direction: row; align-items: flex-start; gap: 12px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .admin-top { flex-direction: column; align-items: flex-start; gap: 12px; }
  .table-wrap { overflow-x: auto; }
  .admin-table { min-width: 640px; }
}

/* ---------- 动效与过渡 ---------- */

/* 跨页导航淡入淡出（支持的浏览器自动生效，其余忽略） */
@view-transition { navigation: auto; }

/* 页面初次载入的轻微淡入 */
@media (prefers-reduced-motion: no-preference) {
  body { animation: page-fade-in 0.4s ease-out; }
}

@keyframes page-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 滚动进入：JS 给元素加 .reveal，入场完成后移除，避免与 hover 过渡冲突 */
.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
  transition-delay: var(--reveal-delay, 0s);
}

.js .reveal.reveal-in {
  opacity: 1;
  transform: none;
}

/* 吸顶导航：滚动后浮现阴影 */
.site-header {
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.site-header.scrolled {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.07);
  border-bottom-color: transparent;
}

/* 「正常」状态点呼吸 */
@keyframes status-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 45%, transparent); }
  70%, 100% { box-shadow: 0 0 0 6px transparent; }
}

.status-ok::before {
  animation: status-pulse 2.4s ease-out infinite;
}

/* 复制成功提示 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  z-index: 300;
  padding: 10px 20px;
  border-radius: 980px;
  background: var(--text);
  color: var(--bg);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translate(-50%, 14px);
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out);
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* 无障碍：跟随系统「减少动效」设置 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html { scroll-behavior: auto; }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}
