/* ============================================
 * 差旅志 · Dossier Design System
 * 替换原 modern_style.css
 * ============================================ */

:root {
  --parchment: #F4ECDC;
  --parchment-2: #EFE5D0;
  --paper: #FBF6EB;
  --paper-sunk: #F2EAD7;
  --ink: #1A1814;
  --ink-2: #3A352B;
  --ink-muted: #6B6256;
  --seal: #8B2A1F;
  --seal-soft: #B5523F;
  --seal-ink: #6A1D14;
  --blue: #2C3E50;
  --brass: #C7A36E;
  --brass-deep: #9D7E4C;
  --rule: #D6CDB8;
  --rule-soft: #E5DDC8;
  --success: #4A7C59;
  --danger: #8B2A1F;

  --serif-cjk: 'Noto Serif SC', 'Songti SC', 'STSong', serif;
  --serif-en: 'Fraunces', 'Cormorant Garamond', Georgia, serif;
  --sans-cjk: 'Noto Sans SC', 'PingFang SC', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
}

/* ============ Reset & Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background-color: var(--parchment);
  color: var(--ink);
  font-family: var(--sans-cjk);
  font-feature-settings: "tnum", "kern";
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  line-height: 1.55;
  min-height: 100vh;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 0.4  0 0 0 0 0.34  0 0 0 0 0.24  0 0 0 0.05 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>"),
    linear-gradient(180deg, #F6EEDE 0%, #F1E8D3 100%);
}

input, textarea, button, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--seal); text-decoration: none; }
hr { border: 0; margin: 0; }

/* ============ App Shell ============ */
.app-shell {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--paper);
  box-shadow: 0 0 60px -20px rgba(40, 30, 15, 0.15);
  position: relative;
}

/* ============ Top Nav ============ */
.top-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px 14px;
  background: var(--paper);
  border-bottom: 1px dashed var(--rule);
  position: sticky; top: 0; z-index: 30;
}
.top-nav.dark {
  background: var(--ink);
  color: var(--paper);
  border-bottom: 0;
}

.logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--serif-cjk); font-weight: 700;
  font-size: 17px; color: var(--ink); letter-spacing: 0.02em;
  text-decoration: none;
}
.logo .dot {
  width: 26px; height: 26px; background: var(--seal);
  border-radius: 5px;
  display:flex; align-items:center; justify-content:center;
  color: var(--paper); font-size: 14px; font-weight: 700;
  font-family: var(--serif-cjk);
  transform: rotate(-3deg);
  box-shadow: 0 1px 0 var(--seal-ink) inset;
}
.logo .en {
  font-family: var(--serif-en); font-style: italic; font-weight: 400;
  color: var(--ink-muted); font-size: 12px; margin-left: 4px;
}

.icon-btn {
  width: 36px; height: 36px; border-radius: 6px;
  border: 1px solid var(--rule);
  background: var(--paper);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--ink-2);
  text-decoration: none;
  transition: all 0.15s;
}
.icon-btn:hover { background: var(--paper-sunk); border-color: var(--ink-muted); }
.icon-btn.dark { background: transparent; border-color: rgba(255,255,255,0.25); color: var(--paper); }

.crumb {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.14em; color: var(--ink-muted);
  text-transform: uppercase;
}

/* user avatar in nav */
.avatar-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--seal);
  color: var(--paper);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--serif-cjk); font-weight: 700; font-size: 14px;
  border: 0;
  position: relative;
}
.avatar-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 4px;
  min-width: 180px;
  z-index: 50;
  display: none;
  box-shadow: 0 8px 24px -8px rgba(40, 30, 15, 0.2);
}
.avatar-menu.open { display: block; }
.avatar-menu .menu-head {
  padding: 12px 16px;
  border-bottom: 1px dashed var(--rule);
  font-family: var(--mono); font-size: 10px; color: var(--ink-muted);
  letter-spacing: 0.14em; text-transform: uppercase;
}
.avatar-menu a {
  display: block;
  padding: 12px 16px;
  color: var(--ink);
  font-size: 14px;
  border-bottom: 1px solid var(--rule-soft);
  text-decoration: none;
}
.avatar-menu a:last-child { border-bottom: 0; }
.avatar-menu a:hover { background: var(--paper-sunk); }
.avatar-menu a.danger { color: var(--seal); }

/* ============ Main content area ============ */
.main { padding-bottom: 40px; }

/* ============ Section dividers ============ */
.dash { height: 1px; background-image: linear-gradient(to right, var(--rule) 50%, transparent 50%); background-size: 8px 1px; background-repeat: repeat-x; }
.dash-thick { height: 1px; background-image: linear-gradient(to right, var(--ink-muted) 50%, transparent 50%); background-size: 6px 1px; background-repeat: repeat-x; }
.solid-rule { height: 1px; background: var(--ink); }

/* ============ Case Band (dashboard header) ============ */
.case-band {
  padding: 22px 22px 20px;
  background: var(--ink);
  color: var(--paper);
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
}
.case-band .lhs { display: flex; align-items: center; gap: 14px; min-width: 0; }
.case-band .meta { min-width: 0; }
.case-band .title {
  font-family: var(--serif-cjk); font-weight: 700;
  font-size: 18px; letter-spacing: 0.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 280px;
}
.case-band .sub {
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  color: rgba(251, 246, 235, 0.6); letter-spacing: 0.12em;
  text-transform: uppercase; margin-top: 4px;
}

.seal-small {
  width: 40px; height: 40px;
  border: 2px solid var(--seal-soft);
  box-shadow: inset 0 0 0 2px var(--ink), inset 0 0 0 3px var(--seal-soft);
  border-radius: 5px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--serif-cjk); font-weight: 700;
  color: var(--seal-soft); font-size: 20px;
  transform: rotate(-4deg);
  flex-shrink: 0;
}

/* ============ Trip Card (list item) ============ */
.trip-card {
  padding: 20px 22px;
  border-bottom: 1px dashed var(--rule);
  display: block;
  color: var(--ink);
  text-decoration: none;
  transition: background 0.15s;
  position: relative;
}
.trip-card:hover { background: var(--paper-sunk); }
.trip-card .row1 {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.case-no {
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  color: var(--seal); letter-spacing: 0.1em;
}
.case-no::before { content: '◉ '; font-size: 9px; vertical-align: 1px; }
.case-no.muted { color: var(--ink-muted); }
.case-no.muted::before { color: var(--ink-muted); }

.trip-name {
  font-family: var(--serif-cjk); font-weight: 700;
  font-size: 24px; line-height: 1.2;
  margin: 4px 0 4px;
  color: var(--ink);
  word-break: break-all;
}
.trip-en {
  font-family: var(--serif-en); font-style: italic; font-weight: 400;
  font-size: 13px; color: var(--ink-muted);
  letter-spacing: 0.01em;
}
.trip-meta {
  display: flex; gap: 14px; margin-top: 12px;
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  color: var(--ink-2); letter-spacing: 0.04em;
  flex-wrap: wrap;
}
.trip-meta span { display: inline-flex; align-items: center; gap: 6px; }
.trip-meta .pip { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-muted); }

.card-delete {
  position: absolute; top: 18px; right: 22px;
  width: 30px; height: 30px;
  background: transparent; border: 1px solid transparent;
  border-radius: 4px;
  color: var(--ink-muted);
  font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  z-index: 2;
}
.card-delete:hover { border-color: var(--seal); color: var(--seal); background: rgba(139,42,31,0.05); }

/* ============ Tags ============ */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 3px;
  border: 1px solid var(--seal);
  color: var(--seal); background: rgba(139,42,31,0.05);
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.1em;
}
.tag.soft { border-color: var(--rule); color: var(--ink-muted); background: transparent; }
.tag.brass { border-color: var(--brass-deep); color: var(--brass-deep); background: rgba(199,163,110,0.1); }
.tag.blue { border-color: var(--blue); color: var(--blue); background: rgba(44,62,80,0.06); }

/* ============ Day Ribbon ============ */
.day-ribbon {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 24px 22px 12px;
  border-top: 1px solid var(--ink);
  margin-top: 6px;
}
.day-ribbon:first-of-type { border-top: 0; }
.day-cn { font-family: var(--serif-cjk); font-weight: 700; font-size: 22px; color: var(--ink); }
.day-num { font-family: var(--mono); font-size: 11px; font-weight: 500; color: var(--ink-muted); letter-spacing: 0.08em; }
.day-num em { color: var(--seal); font-style: normal; margin-right: 8px; }

/* ============ Entry Row (timeline) ============ */
.entry {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 16px;
  padding: 14px 22px;
  align-items: start;
  position: relative;
}
.entry-time {
  font-family: var(--mono); font-size: 16px; font-weight: 600;
  color: var(--blue);
  letter-spacing: 0.02em; line-height: 1.1;
  padding-top: 4px;
}
.entry-time small {
  display: block; font-size: 10px; font-weight: 400;
  color: var(--ink-muted); margin-top: 3px; letter-spacing: 0.04em;
}
.entry-body {
  padding-left: 18px;
  border-left: 1px solid var(--rule);
  position: relative;
  min-width: 0;
}
.entry-body::before {
  content: '';
  position: absolute; left: -4px; top: 8px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--seal);
  box-shadow: 0 0 0 2px var(--paper);
}
.entry-act {
  font-size: 14.5px; color: var(--ink); line-height: 1.5;
  margin-bottom: 4px;
  word-break: break-word;
}
.entry-photo {
  margin-top: 8px;
  border: 1px solid var(--rule);
  padding: 4px;
  background: var(--paper);
  border-radius: 3px;
  width: 96px; height: 96px;
  display: block;
  overflow: hidden;
  cursor: pointer;
}
.entry-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 2px; display: block; }

.entry-actions {
  display: flex; flex-direction: column; gap: 4px;
}
.entry-actions button {
  width: 28px; height: 28px;
  background: transparent; border: 1px solid transparent;
  border-radius: 4px;
  color: var(--ink-muted);
  font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center;
}
.entry-actions button:hover { border-color: var(--ink-muted); color: var(--ink); background: var(--paper-sunk); }
.entry-actions button.danger:hover { border-color: var(--seal); color: var(--seal); background: rgba(139,42,31,0.05); }

/* ============ Extra (attachment-only) Entry ============ */
.extras-head {
  padding: 24px 22px 8px;
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.18em; color: var(--ink-muted);
  text-transform: uppercase;
  border-top: 1px dashed var(--rule);
  margin-top: 8px;
}
.extras-head::before { content: '— '; color: var(--seal); }
.extra-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 10px 22px 14px;
  font-family: var(--mono); font-size: 12px; color: var(--ink-2);
}
.extra-row .thumb {
  width: 40px; height: 40px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
}
.extra-row .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.extra-row .actions { display: flex; gap: 4px; }
.extra-row .actions button {
  width: 28px; height: 28px;
  background: transparent; border: 1px solid transparent;
  border-radius: 4px;
  color: var(--ink-muted);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px;
}
.extra-row .actions button:hover { border-color: var(--ink-muted); color: var(--ink); }
.extra-row .actions button.danger:hover { border-color: var(--seal); color: var(--seal); }

/* ============ Buttons ============ */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%;
  background: var(--seal);
  color: var(--paper);
  border: 0;
  padding: 16px 24px;
  font-family: var(--serif-cjk); font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.4em;
  text-align: center;
  border-radius: 4px;
  transition: all 0.18s ease;
  box-shadow: 0 1px 0 var(--seal-ink) inset, 0 2px 0 var(--seal-ink);
  text-decoration: none;
}
.btn-primary:hover { background: var(--seal-soft); color: var(--paper); }
.btn-primary:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--seal-ink) inset, 0 1px 0 var(--seal-ink); }
.btn-primary .en {
  font-family: var(--serif-en); font-style: italic; font-weight: 400;
  font-size: 11px; letter-spacing: 0.2em;
  margin-left: 14px; opacity: 0.75;
}
.btn-primary[disabled] { opacity: 0.5; cursor: not-allowed; }

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%;
  background: transparent;
  border: 1px dashed var(--ink-muted);
  color: var(--ink);
  padding: 14px 24px;
  font-family: var(--sans-cjk); font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.2em;
  text-align: center;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.15s;
}
.btn-ghost:hover { border-color: var(--ink); background: var(--paper-sunk); color: var(--ink); }

.btn-blue {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--blue);
  color: var(--paper);
  border: 0;
  padding: 12px 20px;
  font-family: var(--sans-cjk); font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.16em;
  border-radius: 4px;
  transition: all 0.15s;
}
.btn-blue:hover { background: #3a4f63; color: var(--paper); }

.btn-link {
  background: transparent; border: 0;
  color: var(--seal);
  font-family: var(--serif-en); font-style: italic;
  font-size: 13px;
  padding: 0;
}
.btn-link:hover { color: var(--seal-soft); }

.btn-danger {
  background: var(--seal);
  color: var(--paper);
  border: 0;
  padding: 12px 20px;
  font-family: var(--sans-cjk); font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.16em;
  border-radius: 4px;
}
.btn-danger:hover { background: var(--seal-soft); }

.bottom-action {
  padding: 20px 22px 28px;
  border-top: 1px solid var(--ink);
  background: var(--paper-sunk);
  display: flex; flex-direction: column; gap: 10px;
}

/* ============ Form Fields ============ */
.field { padding: 18px 22px 16px; border-bottom: 1px dashed var(--rule); }
.field:last-child { border-bottom: 0; }
.field-label {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 6px;
}
.field-label .cn {
  font-family: var(--serif-cjk); font-weight: 500;
  font-size: 13px; color: var(--ink-muted); letter-spacing: 0.16em;
}
.field-label .en {
  font-family: var(--mono); font-size: 9px; font-weight: 500;
  color: var(--ink-muted); letter-spacing: 0.12em; text-transform: uppercase;
}
.field-input, .field-textarea {
  width: 100%;
  border: 0;
  background: transparent;
  border-bottom: 1px solid var(--ink);
  padding: 8px 0 10px;
  font-family: var(--sans-cjk); font-size: 16px; font-weight: 500;
  color: var(--ink);
  outline: none;
  border-radius: 0;
  -webkit-appearance: none;
}
.field-input:focus, .field-textarea:focus { border-bottom-color: var(--seal); }
.field-input.mono, .field-textarea.mono { font-family: var(--mono); font-weight: 500; letter-spacing: 0.02em; }
.field-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.6;
}
.field-input::placeholder, .field-textarea::placeholder { color: var(--rule); }
input[type="file"].field-input { padding: 8px 0; font-family: var(--mono); font-size: 13px; }
.field-hint {
  margin-top: 8px;
  font-family: var(--serif-cjk); font-size: 12px;
  color: var(--ink-muted); line-height: 1.6;
}
.field-hint .seal-text { color: var(--seal); }

/* time input pair */
.field-pair { display: flex; align-items: center; gap: 12px; }
.field-pair .field-input { flex: 1; }
.field-pair .sep { color: var(--ink-muted); font-family: var(--serif-cjk); }

/* ============ Empty State ============ */
.empty {
  text-align: center;
  padding: 80px 32px;
  color: var(--ink-muted);
}
.empty .icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--paper-sunk);
  border: 1px dashed var(--rule);
  margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  color: var(--ink-muted);
}
.empty h3 {
  font-family: var(--serif-cjk); font-weight: 700;
  font-size: 18px; color: var(--ink); margin: 0 0 8px;
}
.empty p { font-size: 13px; margin: 0; }

/* ============ Modal (sheet) ============ */
.sheet-backdrop {
  position: fixed; inset: 0;
  background: rgba(26, 24, 20, 0.55);
  z-index: 100;
  display: none;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.15s ease;
}
.sheet-backdrop.open { display: flex; }
.sheet {
  background: var(--paper);
  border-radius: 12px 12px 0 0;
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp 0.22s ease;
}
@media (min-width: 600px) {
  .sheet-backdrop { align-items: center; }
  .sheet { border-radius: 8px; max-width: 480px; max-height: 88vh; }
}
.sheet-handle {
  width: 48px; height: 4px;
  background: var(--rule);
  border-radius: 2px;
  margin: 10px auto 0;
}
.sheet-head {
  padding: 18px 22px 14px;
  border-bottom: 1px dashed var(--rule);
  display: flex; align-items: baseline; justify-content: space-between;
}
.sheet-title {
  font-family: var(--serif-cjk); font-weight: 700;
  font-size: 20px;
  color: var(--ink);
  margin: 0;
}
.sheet-sub {
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  color: var(--ink-muted); letter-spacing: 0.14em;
  text-transform: uppercase;
}
.sheet-body { padding: 4px 0; }
.sheet-foot {
  padding: 16px 22px 24px;
  display: flex; gap: 12px;
  border-top: 1px solid var(--ink);
  background: var(--paper-sunk);
}
.sheet-foot button { flex: 1; }
.sheet-foot .btn-primary { flex: 2; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ============ Toast ============ */
.toast-container {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 200;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--ink);
  color: var(--paper);
  padding: 12px 20px;
  border-radius: 4px;
  font-family: var(--sans-cjk); font-size: 14px;
  box-shadow: 0 8px 24px -8px rgba(0,0,0,0.4);
  animation: slideUp 0.22s ease;
  pointer-events: auto;
}
.toast.error { background: var(--seal); }
.toast.success { background: var(--success); }

/* ============ Doc Preview (export page) ============ */
.doc-preview {
  margin: 16px 22px 0;
  padding: 18px 18px 16px;
  background: var(--parchment);
  border: 1px solid var(--rule);
  border-radius: 3px;
  position: relative;
}
.doc-preview h4 {
  font-family: var(--serif-cjk); font-weight: 700;
  font-size: 17px; text-align: center; margin: 4px 0 16px;
  color: var(--ink);
}
.doc-preview small {
  display: block; text-align: right;
  font-family: var(--serif-cjk); font-size: 11px;
  color: var(--ink-muted); margin-top: 14px;
  line-height: 1.6;
}
.corner { position: absolute; width: 12px; height: 12px; border: 1px solid var(--ink-muted); opacity: 0.6; }
.corner-tl { top: 6px; left: 6px; border-right: 0; border-bottom: 0; }
.corner-tr { top: 6px; right: 6px; border-left: 0; border-bottom: 0; }
.corner-bl { bottom: 6px; left: 6px; border-right: 0; border-top: 0; }
.corner-br { bottom: 6px; right: 6px; border-left: 0; border-top: 0; }

/* ============ Table Preview ============ */
.table-prev {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 11px;
}
.table-prev th, .table-prev td {
  border-bottom: 1px solid var(--rule);
  padding: 8px 6px;
  text-align: left;
  color: var(--ink);
  vertical-align: top;
}
.table-prev th {
  font-family: var(--sans-cjk);
  font-weight: 500;
  font-size: 10px;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.table-prev tr:last-child td { border-bottom: 0; }

/* ============ Note Box ============ */
.note {
  margin: 14px 22px;
  padding: 12px 14px;
  background: rgba(199, 163, 110, 0.14);
  border-left: 3px solid var(--brass-deep);
  font-family: var(--serif-cjk); font-size: 12px;
  color: var(--ink-2); line-height: 1.6;
  border-radius: 0 3px 3px 0;
}
.note b { color: var(--brass-deep); }
.note.danger { background: rgba(139, 42, 31, 0.08); border-left-color: var(--seal); }
.note.danger b { color: var(--seal); }

/* ============ Image Lightbox ============ */
.lightbox-bd {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 300;
  display: none;
  align-items: center; justify-content: center;
}
.lightbox-bd.open { display: flex; }
.lightbox-bd img { max-width: 92%; max-height: 92%; object-fit: contain; }
.lightbox-bd .close {
  position: absolute; top: 16px; right: 16px;
  background: rgba(255,255,255,0.1);
  color: white; border: 0;
  width: 40px; height: 40px; border-radius: 50%;
  font-size: 22px;
}

/* ============ Login / Auth ============ */
.auth-shell {
  max-width: 520px; margin: 0 auto;
  min-height: 100vh;
  background: var(--paper);
  display: flex; flex-direction: column;
  position: relative;
}
.auth-hero {
  padding: 72px 32px 48px;
  text-align: center;
  position: relative;
}
.auth-seal {
  width: 80px; height: 80px; border-radius: 50%;
  border: 3px solid var(--seal);
  box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 4px var(--seal);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--serif-cjk); font-weight: 700;
  color: var(--seal);
  font-size: 36px;
  transform: rotate(-2deg);
  position: relative;
  margin-bottom: 28px;
}
.auth-seal::after {
  content: '';
  position: absolute; inset: -2px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='80' height='80'><filter id='n'><feTurbulence baseFrequency='1.5' numOctaves='1' seed='5'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.35'/></svg>");
  mix-blend-mode: multiply;
  pointer-events: none;
  border-radius: 50%;
}
.auth-mark {
  font-family: var(--serif-cjk); font-weight: 900;
  font-size: 52px; color: var(--ink);
  line-height: 1; margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.auth-en {
  font-family: var(--serif-en); font-style: italic; font-weight: 400;
  color: var(--seal); font-size: 16px; letter-spacing: 0.04em;
  margin: 0 0 32px;
}
.auth-meta {
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  color: var(--ink-muted); letter-spacing: 0.18em;
  text-transform: uppercase;
  display: flex; align-items: center; gap: 14px; justify-content: center;
}
.auth-meta .bar { flex: 0 0 24px; height: 1px; background: var(--rule); }

.auth-fields { padding: 24px 32px; }
.auth-foot { padding: 0 32px 36px; text-align: center; margin-top: 24px; }
.auth-link {
  font-family: var(--serif-en); font-style: italic;
  color: var(--ink-muted); font-size: 14px;
}
.auth-link b { color: var(--seal); border-bottom: 1px solid var(--seal); font-weight: 400; font-style: normal; font-family: var(--sans-cjk); margin-left: 4px; padding: 0 2px 1px; }

/* ============ Print friendly ============ */
@media print {
  body { background: white !important; }
  .top-nav, .bottom-action, .sheet-backdrop, .toast-container, .no-print { display: none !important; }
  .app-shell { box-shadow: none; max-width: none; }
}

/* ============ Utility ============ */
.tnum { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }
.serif { font-family: var(--serif-cjk); }
.muted { color: var(--ink-muted); }
.seal-color { color: var(--seal); }
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.items-center { align-items: center; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.hidden { display: none !important; }
