/* ============================================================
   方向 A · 纸面编辑风（精修版）
   暖纸底、衬线标题、印章红点缀；毛玻璃页头、精致卡片与表单
   ============================================================ */

:root {
  --font-body: -apple-system, "PingFang SC", "Source Han Sans SC", sans-serif;
  --font-display: "Songti SC", "Noto Serif SC", "SimSun", serif;
  --bg: #f7f4ee;
  --bg-elevated: #fffdf8;
  --ink: #26221c;
  --ink-soft: #5c554a;
  --ink-faint: #9a9184;
  --line: rgba(38, 34, 28, 0.14);
  --line-strong: rgba(38, 34, 28, 0.28);
  --accent: #b03a2e;
  --accent-deep: #932e23;
  --accent-ink: #fffdf8;
  --accent-soft: rgba(176, 58, 46, 0.07);
  --radius: 6px;
  --radius-lg: 10px;
  --shadow: 0 1px 2px rgba(38, 34, 28, 0.06);
  --shadow-lg: 0 10px 28px rgba(38, 34, 28, 0.12);
}

html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(176, 58, 46, 0.05), transparent 60%),
    var(--bg);
}

::selection {
  background: rgba(176, 58, 46, 0.18);
  color: var(--ink);
}

/* ---------- 页头：毛玻璃 ---------- */

.site-header {
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
  backdrop-filter: blur(14px) saturate(1.5);
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  border-radius: 5px;
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 253, 248, 0.35),
    0 2px 6px rgba(176, 58, 46, 0.35);
  letter-spacing: 0;
  transform: rotate(-2deg);
}

.brand:hover .brand-mark {
  transform: rotate(0deg);
}

.brand-mark {
  transition: transform 0.25s ease;
}

.brand-copy strong {
  letter-spacing: 0.06em;
}

.brand-copy small {
  letter-spacing: 0.18em;
}

.co-brand-logo {
  opacity: 0.92;
  transition: opacity 0.2s;
}

.co-brand-logo:hover {
  opacity: 1;
}

/* ---------- 首屏标题 ---------- */

.intro {
  border-bottom: 2px solid var(--ink);
  padding-bottom: 28px;
  margin-bottom: 36px;
  position: relative;
}

.intro::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 72px;
  height: 2px;
  background: var(--accent);
}

.intro h1 {
  font-weight: 700;
  letter-spacing: 0.01em;
}

.intro h1 span {
  position: relative;
  white-space: nowrap;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  background: var(--accent);
}

/* ---------- 面板与卡片 ---------- */

.panel {
  border-radius: var(--radius-lg);
  box-shadow:
    0 1px 2px rgba(38, 34, 28, 0.05),
    0 4px 16px rgba(38, 34, 28, 0.05);
}

.panel-heading h2 {
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-heading h2::before {
  content: "";
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: var(--accent);
}

/* ---------- 分段切换 ---------- */

.mode-tabs {
  background: rgba(38, 34, 28, 0.05);
  border: none;
  border-radius: 8px;
  padding: 4px;
}

.mode-tab {
  border-radius: 6px;
  padding: 9px 12px;
}

.mode-tab.is-active {
  background: var(--bg-elevated);
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(38, 34, 28, 0.12);
}

/* ---------- 拖拽区 ---------- */

.dropzone {
  background: rgba(38, 34, 28, 0.025);
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 34px 20px;
}

.dropzone:hover,
.dropzone:focus-visible,
.dropzone.is-dragover {
  border-color: var(--accent);
  border-style: solid;
  background: var(--accent-soft);
}

.dropzone.is-filled {
  border-style: solid;
  border-color: var(--ok);
  background: color-mix(in srgb, var(--ok) 6%, var(--bg-elevated));
}

.dropzone-icon {
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg-elevated);
  box-shadow: 0 2px 8px rgba(38, 34, 28, 0.1);
  margin-bottom: 4px;
}

.dropzone-icon svg {
  width: 26px;
  height: 26px;
}

/* ---------- 表单控件 ---------- */

.field-group input,
.field-group select,
.field-group textarea,
.paste-box textarea,
.search-box input,
.toolbar select {
  border-radius: var(--radius);
  border-color: var(--line);
  background: var(--bg-elevated);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.field-group input:hover,
.field-group select:hover,
.field-group textarea:hover,
.paste-box textarea:hover,
.search-box input:hover,
.toolbar select:hover {
  border-color: var(--line-strong);
}

.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus,
.paste-box textarea:focus,
.search-box input:focus,
.toolbar select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(176, 58, 46, 0.14);
  background: #fff;
}

.field-group input[readonly] {
  background: rgba(38, 34, 28, 0.04);
  color: var(--ink-soft);
  border-style: dashed;
}

.extra-fields summary {
  padding: 4px 0;
}

/* ---------- 按钮 ---------- */

.button {
  border-radius: var(--radius);
  letter-spacing: 0.04em;
  transition: transform 0.12s, box-shadow 0.2s, background 0.15s, opacity 0.15s;
}

.button-primary {
  background: linear-gradient(180deg, #bc4538 0%, var(--accent) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 253, 248, 0.25),
    0 2px 6px rgba(176, 58, 46, 0.35);
}

.button-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-deep) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 253, 248, 0.2),
    0 6px 16px rgba(176, 58, 46, 0.4);
  transform: translateY(-1px);
}

.button-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.button-secondary {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent);
}

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

.button-quiet:hover {
  background: rgba(38, 34, 28, 0.05);
}

/* ---------- 每日题目横幅 ---------- */

.day-banner {
  background: linear-gradient(135deg, rgba(176, 58, 46, 0.09), rgba(176, 58, 46, 0.04));
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-lg);
}

/* ---------- 课题卡片 ---------- */

.topics-list {
  gap: 16px;
}

.topic-card {
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: 0 1px 2px rgba(38, 34, 28, 0.04);
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}

.topic-card:hover {
  box-shadow: 0 8px 24px rgba(38, 34, 28, 0.1);
  transform: translateY(-2px);
  border-color: var(--line-strong);
}

.topic-card h3 {
  font-size: 17px;
  letter-spacing: 0.02em;
}

.topic-category {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.03em;
}

.topic-status {
  font-weight: 600;
}

.topic-day {
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(176, 58, 46, 0.35);
}

.topic-details section {
  background: rgba(38, 34, 28, 0.03);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 8px;
}

.topic-details h4 {
  color: var(--accent);
  letter-spacing: 0.06em;
}

.topic-card footer {
  border-top: 1px dashed var(--line);
}

.avatar {
  border-radius: 6px;
  font-family: var(--font-display);
  font-weight: 700;
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 253, 248, 0.35),
    0 1px 3px rgba(176, 58, 46, 0.3);
}

.version-item {
  border-left: 2px solid color-mix(in srgb, var(--accent) 40%, transparent);
  background: rgba(38, 34, 28, 0.03);
}

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

.auth-panel {
  padding: 36px 32px;
  border-radius: 14px;
  box-shadow:
    0 1px 2px rgba(38, 34, 28, 0.05),
    0 12px 40px rgba(38, 34, 28, 0.1);
}

.auth-panel .eyebrow {
  margin-bottom: 12px;
}

.user-chip {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

/* ---------- 状态与反馈 ---------- */

.inline-error {
  border-radius: var(--radius);
}

.empty-icon {
  border-radius: 14px;
  transform: rotate(-3deg);
  box-shadow:
    inset 0 0 0 2px rgba(176, 58, 46, 0.25),
    0 2px 8px rgba(38, 34, 28, 0.08);
}

.loading-state {
  letter-spacing: 0.1em;
}

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

.site-footer {
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-elevated) 60%, transparent);
}

.footer-brand .co-brand-logo {
  opacity: 0.75;
  filter: saturate(0.85);
  transition: opacity 0.2s, filter 0.2s;
}

.footer-brand .co-brand-logo:hover {
  opacity: 1;
  filter: none;
}

/* ---------- 滚动条 ---------- */

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: rgba(38, 34, 28, 0.18);
  border-radius: 6px;
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(38, 34, 28, 0.3);
}

/* ---------- 焦点可见性 ---------- */

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