/* aibj.lol 主样式表。纸白 + 靛青的报刊目录体制。 */

/* ---------------------------------------------------------------- tokens */

:root {
  --bg: #f6f3ec;
  --surface: #ffffff;
  --surface-2: #ede7da;
  --ink: #17150f;
  --muted: #5b564c;
  --line: #dcd4c4;
  --accent: #163c6e;
  --accent-ink: #ffffff;
  --accent-wash: #e7edf5;
  --danger: #a8321f;
  --danger-wash: #fbedea;
  --warn: #8a5a05;
  --warn-wash: #fbf3e0;
  --ok: #1f6b4a;

  --serif: "Songti SC", "SimSun", "Noto Serif SC", "Source Han Serif SC", serif;
  --sans: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;

  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 64px;

  --r1: 2px;
  --r2: 4px;
  --r3: 6px;
  --sh1: 0 1px 2px rgba(23, 21, 15, 0.05);
  --sh2: 0 6px 18px -12px rgba(23, 21, 15, 0.28);

  --container: 720px;
  --container-wide: 1100px;

  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
  --dur: 160ms;
  --cta-ease: cubic-bezier(0.18, 0.72, 0.28, 1);
  --cta-loop: 2.6s;
}

/* ------------------------------------------------------------ base */

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

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

body {
  margin: 0;
  padding-bottom: 104px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.72;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0 0 var(--s3);
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.28;
}

h2 {
  font-size: 22px;
  line-height: 1.32;
}

h3 {
  font-size: 18px;
  line-height: 1.4;
  font-family: var(--sans);
}

p {
  margin: 0 0 var(--s3);
}

ul,
ol {
  margin: 0 0 var(--s4);
  padding-left: 1.2em;
}

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

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:focus-visible,
summary:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 60;
  padding: var(--s2) var(--s4);
  background: var(--accent);
  color: var(--accent-ink);
}

.skip:focus {
  left: var(--s2);
  top: var(--s2);
}

.wrap {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: var(--s6) var(--s5) var(--s8);
}

.h1 {
  max-width: var(--container);
  padding-bottom: var(--s3);
  border-bottom: 2px solid var(--ink);
}

.lede {
  max-width: var(--container);
  margin: 0 0 var(--s5);
  color: var(--muted);
  font-size: 17px;
}

.p,
.ul,
.ol,
.note,
.quote,
.kv {
  max-width: var(--container);
}

.p {
  padding: 0;
}

/* ---------------------------------------------------------- header */

.head {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.cbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s1);
  padding: var(--s2) var(--s5);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.cbar__t {
  margin-right: var(--s2);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cbar__i {
  display: inline-block;
  padding: var(--s1) var(--s3);
  border: 1px solid transparent;
  border-radius: var(--r1);
  color: var(--ink);
  white-space: nowrap;
}

.cbar__i:hover {
  background: var(--surface);
  border-color: var(--accent);
  text-decoration: none;
}

.cbar__i--on {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.head__in {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s2) var(--s5);
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: var(--s5) var(--s5) var(--s4);
}

.brand {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
}

.brand:hover {
  text-decoration: none;
}

.brand__sub {
  display: block;
  margin-top: var(--s1);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}

.head__tag {
  flex: 1 1 260px;
  margin: 0;
  padding-bottom: var(--s1);
  color: var(--muted);
  font-size: 14px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1) var(--s4);
  flex: 1 1 100%;
  padding-top: var(--s2);
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.nav__i {
  color: var(--ink);
  padding: var(--s1) 0;
}

.nav__i:hover {
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
  text-decoration: none;
}

.menu {
  display: none;
  flex: 1 1 100%;
}

.menu__s {
  display: inline-block;
  padding: var(--s2) var(--s4);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r1);
  font-size: 14px;
  cursor: pointer;
  list-style: none;
}

.menu__s::-webkit-details-marker {
  display: none;
}

.menu__n ul {
  margin: var(--s3) 0 0;
  padding: 0;
  list-style: none;
}

.menu__n li + li {
  border-top: 1px solid var(--line);
}

.menu__n a {
  display: block;
  padding: var(--s2) var(--s1);
  color: var(--ink);
}

/* --------------------------------------------------------- sections */

.sec {
  padding-block: var(--s7);
  border-top: 1px solid var(--line);
}

.sec:first-of-type {
  border-top: 0;
}

.sec__t {
  max-width: var(--container);
}

.sub__t {
  max-width: var(--container);
  margin-top: var(--s5);
}

.note {
  margin: 0 0 var(--s4);
  padding: var(--s3) var(--s4);
  border-radius: var(--r1);
  font-size: 15px;
}

.note--info {
  background: var(--accent-wash);
  color: var(--accent);
}

.note--warn {
  background: var(--warn-wash);
  color: var(--warn);
}

.note--danger {
  background: var(--danger-wash);
  color: var(--danger);
}

.quote {
  margin: 0 0 var(--s4);
  padding: var(--s2) var(--s5);
  border-left: 1px solid var(--line);
  color: var(--muted);
}

.quote__c {
  display: block;
  margin-top: var(--s2);
  font-size: 13px;
  font-style: normal;
}

/* --------------------------------------------------------- tlinks */

.tlinks {
  margin: 0 0 var(--s5);
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.tlink {
  border-bottom: 1px solid var(--line);
}

.tlink__a {
  display: block;
  padding: var(--s3) var(--s1);
}

.tlink__a:hover {
  background: var(--surface);
  text-decoration: none;
}

.tlink__h {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
}

.tlink__d {
  display: block;
  margin-top: var(--s1);
  color: var(--muted);
  font-size: 14px;
}

/* ------------------------------------------------------------ grid */

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin: 0 0 var(--s5);
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.gcell {
  border-bottom: 1px solid var(--line);
}

.gcell__a {
  display: block;
  height: 100%;
  padding: var(--s3) var(--s1);
}

.gcell__a:hover {
  background: var(--surface);
  text-decoration: none;
}

.gcell__h {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
}

.gcell__d {
  display: block;
  margin-top: var(--s1);
  color: var(--muted);
  font-size: 14px;
}

/* ----------------------------------------------------------- cards */

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s3);
  margin: 0 0 var(--s5);
  padding: 0;
  list-style: none;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  box-shadow: var(--sh1);
}

.card__a {
  display: block;
  padding: var(--s4);
}

.card__a:hover {
  text-decoration: none;
  box-shadow: var(--sh2);
}

.card__h {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
}

.card__d {
  display: block;
  margin-top: var(--s1);
  color: var(--muted);
  font-size: 14px;
}

.card__tag {
  display: inline-block;
  margin-left: var(--s2);
  padding: 0 var(--s2);
  background: var(--accent-wash);
  color: var(--accent);
  border-radius: var(--r1);
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
}

/* ----------------------------------------------------------- chips */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin: 0 0 var(--s4);
  padding: 0;
  list-style: none;
}

.chip {
  padding: var(--s1) var(--s3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  font-size: 14px;
}

.chip--on {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

/* ---------------------------------------------------------- tables */

.tablewrap {
  max-width: 100%;
  margin: 0 0 var(--s5);
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background: var(--surface);
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.tbl th,
.tbl td {
  padding: var(--s3);
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  white-space: normal;
}

.tbl th {
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 700;
}

.tbl tr:last-child td {
  border-bottom: 0;
}

/* ------------------------------------------------------------- faq */

.faq {
  max-width: var(--container);
  margin: 0 0 var(--s5);
  border-top: 1px solid var(--line);
}

.faq__i {
  border-bottom: 1px solid var(--line);
}

.faq__q {
  display: block;
  padding: var(--s3) var(--s6) var(--s3) var(--s1);
  position: relative;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.faq__q::-webkit-details-marker {
  display: none;
}

.faq__q::after {
  content: "+";
  position: absolute;
  right: var(--s2);
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-size: 18px;
}

.faq__i[open] .faq__q::after {
  content: "\2212";
}

.faq__a {
  padding: 0 var(--s1) var(--s4);
  color: var(--muted);
  font-size: 15px;
}

/* -------------------------------------------------------------- kv */

.kv {
  margin: 0 0 var(--s5);
  padding: 0;
  border-top: 1px solid var(--line);
}

.kv__k,
.kv__v {
  margin: 0;
  padding: var(--s2) 0;
  border-bottom: 1px solid var(--line);
}

.kv__k {
  font-weight: 700;
}

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

/* ------------------------------------------------------------ bio */

.bio {
  margin: 0 0 var(--s5);
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.bio__i {
  padding: var(--s4) 0;
  border-bottom: 1px solid var(--line);
}

.bio__a {
  display: block;
  font-size: 16px;
  font-weight: 700;
}

.bio__u {
  display: block;
  margin-top: var(--s1);
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.bio__d {
  margin: var(--s2) 0 0;
  max-width: var(--container);
  color: var(--muted);
  font-size: 14px;
}

/* ----------------------------------------------------------- find */

.find {
  max-width: var(--container);
  margin: 0 0 var(--s4);
}

.find__l {
  display: block;
  margin-bottom: var(--s2);
  font-size: 14px;
  font-weight: 700;
}

.find__i {
  width: 100%;
  padding: var(--s3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  color: var(--ink);
  font-size: 16px;
  font-family: inherit;
}

.find__e {
  max-width: var(--container);
  color: var(--muted);
  font-size: 14px;
}

.find__r {
  max-width: var(--container);
  margin: 0 0 var(--s4);
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.find__r li {
  padding: var(--s2) 0;
  border-bottom: 1px solid var(--line);
}

/* --------------------------------------------------------- footer */

.foot {
  margin-top: var(--s7);
  padding: var(--s7) 0 var(--s8);
  background: var(--surface-2);
  border-top: 1px solid var(--line);
}

.foot__in {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s6);
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 var(--s5);
}

.foot__b {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
}

.foot__d {
  margin: var(--s2) 0 0;
  max-width: 34em;
  color: var(--muted);
  font-size: 14px;
}

.foot__nav {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s5);
}

.fgroup__t {
  margin: 0 0 var(--s2);
  font-family: var(--serif);
  font-weight: 700;
}

.fgroup ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.fgroup li + li {
  margin-top: var(--s1);
}

.fgroup a {
  color: var(--muted);
  font-size: 14px;
}

.fgroup a:hover {
  color: var(--accent);
}

/* ------------------------------------------------------------ cta */

.site-cta {
  position: fixed;
  left: 50%;
  bottom: calc(var(--s3) + env(safe-area-inset-bottom, 0px));
  z-index: 50;
  width: min(560px, calc(100% - 28px));
  transform: translateX(-50%);
}

.site-cta__a {
  position: relative;
  display: block;
  overflow: hidden;
  padding: var(--s3) var(--s5);
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--r3);
  box-shadow: var(--sh2);
  text-align: center;
}

.site-cta__a:hover {
  text-decoration: none;
}

.site-cta__t {
  position: relative;
  z-index: 1;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.site-cta__a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: var(--s2);
  width: 100%;
  height: 1px;
  background: var(--accent-ink);
  opacity: 0.7;
  transform: translateX(-100%);
  animation: cta-rule-draw var(--cta-loop) var(--cta-ease) infinite;
}

.site-cta__a::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bg);
  opacity: 0;
  animation: cta-paper-damp var(--cta-loop) var(--cta-ease) infinite;
}

@keyframes cta-rule-draw {
  0% {
    transform: translateX(-100%);
  }
  45% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(0);
  }
}

@keyframes cta-paper-damp {
  0% {
    opacity: 0;
  }
  30% {
    opacity: 0.2;
  }
  60% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

/* ----------------------------------------------------------- totop */

.totop {
  position: fixed;
  right: var(--s4);
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  z-index: 45;
  width: 44px;
  height: 44px;
  background: var(--surface);
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: var(--sh1);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.totop:hover {
  border-color: var(--accent);
}

/* -------------------------------------------------------- breakpoints */

@media (min-width: 640px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--s5);
  }

  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .foot__nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .foot__in {
    grid-template-columns: 1fr 2fr;
  }

  .foot__nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

  .cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 899px) {
  .nav {
    display: none;
  }

  .menu {
    display: block;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .site-cta__a::after {
    animation: none;
    transform: translateX(0);
  }

  .site-cta__a::before {
    animation: none;
    opacity: 0.1;
  }
}
