/*
 * 卡站网站的样式：App 的 Ink 风格（纸色底、墨色字、细线分隔），颜色和 App 的 DesignSystem 一致（Ink 规格 6.1）。
 * 只用系统字体，没有脚本，没有阴影。红色（--seal）只给品牌印章，不用在链接、按钮和错误提示上。
 * 页面里不能写行内样式：Caddy 的 Content-Security-Policy 只放行本站的样式表。
 */

:root {
  --paper: #F5F0E6; /* 背景 */
  --panel: #EFE8DA; /* 面板、占位符底色 */
  --ink: #1A1814;   /* 正文、链接、粗线 */
  --ink2: #5F5B54;  /* 次要文字 */
  --ink3: #8A847A;  /* 只给图形用，不用在文字上 */
  --rule: #CEC9C0;  /* 细线 */
  --seal: #B42318;  /* 品牌印章，只用在这里 */
  --hair: 1px;      /* 细线粗细 */
  --side: 16px;     /* 两边留白 */
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #161410;
    --panel: #24211B;
    --ink: #EDE6D8;
    --ink2: #ADA699;
    --ink3: #7A746A;
    --rule: #413E38;
    --seal: #FF6B5E;
  }
}

/* 高清屏上的细线用半个像素 */
@media (min-resolution: 2dppx) {
  :root { --hair: 0.5px; }
}

/* 宽度 414px 起两边留 20px */
@media (min-width: 414px) {
  :root { --side: 20px; }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 17px;
  line-height: 1.7;
  overflow-wrap: break-word;
}

h1,
h2,
h3,
p,
ul {
  margin: 0;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: 2px;
}

strong {
  font-weight: 600;
}

.wrap {
  width: 100%;
  max-width: calc(720px + 2 * var(--side));
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--side);
  padding-right: var(--side);
}

main {
  flex: 1 0 auto;
  padding-top: 40px;
  padding-bottom: 64px;
}

/* 页头：字标「卡站」和红色印章，右边三个链接 */

.site-header {
  border-bottom: var(--hair) solid var(--rule);
}

.header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  column-gap: 24px;
  min-height: 64px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
  text-decoration: none;
}

.seal {
  flex: none;
  color: var(--seal);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  column-gap: 20px;
  font-size: 15px;
  line-height: 1.4;
}

.site-nav a {
  padding: 12px 0;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.4em;
}

/* 占位符（【公司全称】这类）：面板底色加虚线，审核时一眼能看出来 */

.ph {
  padding: 0 2px;
  border-radius: 3px;
  background: var(--panel);
  text-decoration: underline dashed var(--ink2);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* 链接里的占位符只画虚线，不再叠一条链接下划线 */
a .ph {
  display: inline-block;
}

/* 文件页（隐私政策、用户协议等）和帮助与支持 */

.prose h1 {
  margin-bottom: 24px;
  font-size: 30px;
  line-height: 1.3;
  font-weight: 700;
}

.prose h2 {
  margin-top: 40px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1.5px solid var(--ink);
  font-size: 20px;
  line-height: 1.4;
  font-weight: 600;
}

.prose h3 {
  margin-top: 24px;
  margin-bottom: 4px;
  font-size: 17px;
  line-height: 1.5;
  font-weight: 600;
}

.prose p {
  margin-top: 16px;
}

.prose h1 + p,
.prose h2 + p,
.prose h3 + p {
  margin-top: 0;
}

@media (min-width: 600px) {
  .prose h1 {
    font-size: 34px;
  }
}

/* 相关文件：一行一个，右边一个箭头，和 App「关于卡站」里的行一样 */

.related {
  margin-top: 56px;
}

.related h2 {
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--ink2);
}

.related ul {
  list-style: none;
  padding: 0;
  border-top: var(--hair) solid var(--rule);
}

.related a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 12px 0;
  border-bottom: var(--hair) solid var(--rule);
  line-height: 1.4;
  text-decoration: none;
}

.related a:hover {
  text-decoration: underline;
}

.related a::after {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin-right: 4px;
  border-top: 2px solid var(--ink3);
  border-right: 2px solid var(--ink3);
  transform: rotate(45deg);
}

/* 首页 */

.hero {
  padding-top: 8px;
}

.mark {
  width: 72px;
  height: 72px;
  overflow: hidden;
  border: var(--hair) solid var(--rule);
  border-radius: 16px;
}

.mark img {
  display: block;
  width: 100%;
  height: 100%;
}

.hero-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  font-size: 48px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -2px;
}

.hero-title .seal {
  width: 52px;
  height: 28px;
}

.lede {
  margin-top: 16px;
  font-size: 22px;
  line-height: 1.45;
  font-weight: 600;
}

.avail {
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink2);
}

.features {
  list-style: none;
  margin-top: 48px;
  padding: 0;
  border-top: var(--hair) solid var(--rule);
}

.feature {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  column-gap: 16px;
  padding: 20px 0;
  border-bottom: var(--hair) solid var(--rule);
}

.feature .glyph {
  grid-row: 1 / span 2;
  width: 24px;
  height: 24px;
  margin-top: 4px;
  color: var(--ink3);
}

.feature h2 {
  grid-column: 2;
  font-size: 20px;
  line-height: 1.5;
  font-weight: 600;
}

.feature p {
  grid-column: 2;
  margin-top: 4px;
}

/* 图形里压在后面那张卡上的前一张卡：填纸色，挡住后面的线 */
.glyph .knock {
  fill: var(--paper);
}

.note {
  margin-top: 32px;
  padding: 16px 20px;
  border-radius: 16px;
  background: var(--panel);
  color: var(--ink2);
  font-size: 15px;
  line-height: 1.7;
}

/* 404 页：虚线框，中间一条脉搏线 */

.empty {
  padding: 40px 20px;
  border: 1.5px dashed var(--rule);
  border-radius: 16px;
  text-align: center;
}

.empty .pulse {
  width: 80px;
  height: 24px;
  color: var(--ink3);
}

.empty h1 {
  margin-top: 16px;
  font-size: 22px;
  line-height: 1.4;
  font-weight: 600;
}

.empty p {
  margin-top: 8px;
  color: var(--ink2);
}

/* 页脚：居中（工信部要求备案号放在网站底部中间），链接、版权、备案号 */

.site-footer {
  padding-top: 20px;
  padding-bottom: 40px;
  border-top: var(--hair) solid var(--rule);
  text-align: center;
  font-size: 13px;
  line-height: 1.8;
  color: var(--ink2);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: 20px;
  margin-bottom: 8px;
  font-size: 15px;
}

.footer-links a {
  padding: 8px 0;
}

/* 打印：白纸黑字，不印导航；链接后面印出地址 */

@media print {
  :root {
    --paper: #FFFFFF;
    --panel: #F2F2F2;
    --ink: #000000;
    --ink2: #333333;
    --ink3: #666666;
    --rule: #999999;
    --seal: #B42318;
    color-scheme: light;
  }

  .site-nav,
  .related,
  .footer-links {
    display: none;
  }

  body {
    font-size: 12pt;
  }

  main {
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .prose h2,
  .prose h3 {
    break-after: avoid;
  }

  .prose a[href^="http"]::after {
    content: "（" attr(href) "）";
  }
}

/* 深色模式：App 图标换成深色版（和 App 里「关于卡站」一样是深底浅卡） */
@media screen and (prefers-color-scheme: dark) {
  .mark img {
    filter: invert(1);
  }
}
