:root {
  color-scheme: dark;
  --background: #12151a;
  --surface: #191e25;
  --border: #303743;
  --text: #f1eee8;
  --muted: #a2aab6;
  --accent: #e7b18c;
  --ink: #211710;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  line-height: 1.55;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--background); color: var(--text); }
a { color: inherit; text-decoration: none; }
a, button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.wrap { width: min(100% - 80px, 1120px); margin-inline: auto; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 2; padding: 8px 16px; background: var(--accent); color: var(--ink); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.topbar { border-bottom: 1px solid var(--border); background: #161a20; }
.topbar-inner { display: flex; align-items: center; gap: 55px; min-height: 76px; }
.brand { display: inline-flex; gap: 12px; align-items: center; font: 26px Georgia, serif; white-space: nowrap; }
.brand-mark { width: 13px; height: 13px; border: 1px solid var(--accent); transform: rotate(45deg); position: relative; }
.brand-mark::after { content: ""; position: absolute; inset: 3px; background: var(--accent); }
.shortcuts, .account { display: flex; align-items: center; gap: 8px; }
.shortcuts a { display: flex; align-items: center; padding: 8px 13px; font-size: .94rem; color: var(--muted); border-radius: 4px; white-space: nowrap; }
.shortcuts a:hover, .shortcuts a[aria-current] { background: #262c35; color: var(--text); }
.account { margin-left: auto; min-width: 0; }
.username { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.button { display: inline-flex; align-items: center; justify-content: center; padding: 8px 16px; min-height: 40px; white-space: nowrap; border: 1px solid transparent; border-radius: 4px; font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; }
.button.primary { background: var(--accent); color: var(--ink); }
.button.primary:hover { background: #f4c5a5; }
.button.secondary { border-color: #3d4755; background: transparent; color: var(--text); }
.button.secondary:hover { background: #262c35; }
.main { flex: 1; padding-block: 38px 72px; }
.hero { display: grid; grid-template-columns: .9fr 1.1fr; align-items: stretch; min-height: 320px; background: linear-gradient(112deg, #2c2729, #20252d 58%); border: 1px solid #41414a; border-radius: 8px; overflow: hidden; }
.hero-copy { align-self: center; padding: clamp(28px, 5vw, 66px); }
.hero-copy p { color: var(--accent); margin: 0 0 10px; font-size: .93rem; letter-spacing: .22em; }
.hero h1 { margin: 0; font: 400 clamp(3rem, 7vw, 6.15rem)/1 Georgia, serif; letter-spacing: -.055em; }
.hero-rule { margin-top: 24px; width: 47px; height: 2px; background: var(--accent); }
.hero-image { display: grid; padding: 24px; margin: 12px; }
.image-frame { display: grid; place-items: center; min-width: 0; min-height: 140px; border: 1px dashed #56606e; border-radius: 5px; background: #1b2028; }
.image-frame span { position: relative; width: 34px; height: 26px; border: 1px solid #6a7481; border-radius: 3px; opacity: .7; overflow: hidden; }
.image-frame span::before { content: ""; position: absolute; width: 5px; height: 5px; top: 5px; left: 7px; border-radius: 50%; border: 1px solid #828c99; }
.image-frame span::after { content: ""; position: absolute; width: 22px; height: 22px; top: 13px; right: 3px; transform: rotate(45deg); border: 1px solid #828c99; }
.section-heading { margin-block: 42px 16px; }
.section-heading h2 { margin: 0; font-size: 1.45rem; letter-spacing: .045em; }
.category-nav { display: flex; flex-wrap: wrap; gap: 4px 19px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.category-nav a { padding: 9px 3px 12px; white-space: nowrap; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: .94rem; }
.category-nav a:hover { color: var(--text); }
.category-nav a[aria-current] { color: var(--accent); border-color: var(--accent); }
.category-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.category-card { --tile: #adc1e1; --tile-bg: #283346; display: flex; align-items: center; gap: 15px; padding: 20px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.category-card.writing { --tile: #e2b499; --tile-bg: #39302f; }
.category-card.translation { --tile: #b7c8b1; --tile-bg: #293730; }
.category-card.help { --tile: #cbb9dd; --tile-bg: #352d41; }
.category-card:hover { border-color: var(--tile); background: #222831; }
.category-icon { display: grid; place-items: center; flex: 0 0 42px; height: 42px; border-radius: 4px; color: var(--tile); background: var(--tile-bg); font-size: 1.23rem; }
.card-label { display: grid; }
.card-label strong { font-size: 1rem; }
.card-label > span { margin-top: 3px; color: var(--muted); font-size: .84rem; }
.page-heading { margin-block: 6px 26px; }
.page-heading h1, .auth h1 { margin: 12px 0 0; font-size: 2rem; }
.breadcrumb { display: flex; gap: 10px; color: var(--muted); font-size: .9rem; }
.breadcrumb a:hover { color: var(--accent); }
.topic-list { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; }
.topic-list h2 { margin: 0; padding: 14px 20px; font-size: .95rem; border-bottom: 1px solid var(--border); }
.empty-state { margin: 0; text-align: center; padding: 62px 20px; color: var(--muted); }
.auth { width: min(100%, 440px); margin: 12px auto; padding: clamp(22px, 5vw, 35px); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.auth h1 { margin: 0 0 20px; }
.auth label { display: block; margin-top: 15px; }
.auth input { width: 100%; margin-top: 6px; padding: 10px 12px; background: var(--background); color: var(--text); border: 1px solid #45515f; border-radius: 4px; font: inherit; }
.auth .button { width: 100%; margin-top: 22px; }
.field-hint, .auth-switch { color: var(--muted); margin-block: 5px 0; font-size: .88rem; }
.auth-switch { margin-top: 18px; }
.auth-switch a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.form-error { padding: 9px 12px; border-left: 2px solid #eca799; background: #352928; color: #f3c1b8; }
.footer { border-top: 1px solid var(--border); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 64px; color: var(--muted); font-size: .88rem; }
.footer a { color: var(--text); font: 18px Georgia, serif; }
@media (max-width: 820px) {
  .wrap { width: calc(100% - 44px); }
  .topbar-inner { gap: 16px; }
  .hero { min-height: 260px; }
  .hero-image { padding: 14px; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .wrap { width: calc(100% - 32px); }
  .topbar-inner { flex-wrap: wrap; min-height: 0; padding-block: 13px 8px; gap: 8px 10px; }
  .brand { font-size: 23px; }
  .shortcuts { width: 100%; order: 1; gap: 4px; }
  .shortcuts a { padding-inline: 10px; }
  .account .button { min-height: 36px; padding: 5px 10px; }
  .username { max-width: 82px; }
  .main { padding-block: 23px 48px; }
  .hero { grid-template-columns: 1fr; }
  .hero-copy { padding: 28px 25px 0; }
  .hero-rule { margin-top: 15px; }
  .hero-image { padding: 0; margin: 22px; }
  .image-frame { min-height: 116px; }
  .section-heading { margin-top: 28px; }
  .category-nav { gap: 3px 12px; }
  .category-grid { gap: 9px; }
  .category-card { padding: 11px; gap: 9px; }
  .category-icon { flex-basis: 34px; height: 34px; }
}
@media (max-width: 340px) {
  .category-grid { grid-template-columns: 1fr; }
}
