/* ============================================================
   Scholarly · 和紙 Washi Edition v2 (scholarly-washi handoff)
   Loaded after style.css — overrides via body.theme-washi
   Tokens & rules mirror prototype/design/colors_and_type.v2.css
   ============================================================ */

/* ============================================================
   Tokens
   ============================================================ */
body.theme-washi {
  /* paper / ink neutrals */
  --paper:        #faf6ec;
  --paper-shade:  #f1eadb;
  --paper-deep:   #e8dfc9;
  --card-bg:      #fdfaf2;
  --card-border:  #e2d9c4;

  --ink:          #2a2418;
  --ink-soft:     #4d4330;
  --ink-mute:     #8a7e63;
  --ink-pale:     #b9ad90;
  --ink-rule:     rgba(42,36,24,0.12);

  /* accents (japanese palette) */
  --mustard:        #e6b422;
  --mustard-deep:   #b58820;
  --mustard-soft:   #fbecb0;
  --mustard-wash:   rgba(230,180,34,0.18);

  --vermillion:     #c1440e;
  --persimmon:      #e8711a;
  --persimmon-soft: #fde1c2;

  --matcha:         #6b8e23;
  --matcha-soft:    #e0ebc7;

  --indigo:         #2e4d7b;
  --indigo-soft:    #d6deee;

  --plum:           #8a3a5f;
  --plum-soft:      #f0dfe7;

  --seal:           #a83232;

  --accent-gradient-wide:
    linear-gradient(90deg, var(--mustard) 0%, var(--persimmon) 45%, var(--vermillion) 75%, var(--plum) 100%);

  /* type */
  --font-display: "Noto Serif TC", "Noto Serif JP", "Songti TC", "PingFang TC", serif;
  --font-body:    "Zen Kaku Gothic New", "Inter", "PingFang TC", system-ui, sans-serif;
  --font-soft:    "Zen Maru Gothic", "Zen Kaku Gothic New", sans-serif;
  --font-mono:    "JetBrains Mono", "SF Mono", Menlo, monospace;

  /* radii */
  --r-xs: 3px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-pill: 999px;

  /* shadows */
  --shadow-card:       0 1px 2px rgba(42,36,24,0.04), 0 4px 12px rgba(42,36,24,0.05);
  --shadow-card-hover: 0 2px 4px rgba(42,36,24,0.06), 0 10px 30px rgba(42,36,24,0.10);
  --shadow-modal:      0 20px 60px rgba(42,36,24,0.25), 0 2px 6px rgba(42,36,24,0.08);

  /* motion */
  --ease-brand: cubic-bezier(0.22, 0.61, 0.36, 1);

  /* override style.css legacy vars so existing selectors pick washi palette */
  --primary: var(--mustard);
  --primary-2: var(--persimmon);
  --accent-glow: rgba(230, 180, 34, 0.28);
  --accent-gradient: linear-gradient(90deg, var(--mustard) 0%, var(--persimmon) 100%);
  --accent-from: var(--mustard);
  --accent-to: var(--persimmon);
  --surface-strong: var(--card-bg);
  --surface-soft: var(--paper-shade);
  --surface-muted: var(--paper-deep);
  --text-primary: var(--ink);
  --text-secondary: var(--ink-soft);
  --text-muted: var(--ink-mute);
  --border: var(--card-border);
  --border-strong: var(--ink-pale);
  --bg-0: var(--paper);
  --bg-1: var(--paper-shade);
  --bg-color: var(--paper);

  /* sidebar vars used by .side, .side-nav rules in style.css */
  --side-bg:        var(--paper-shade);
  --side-line:      var(--card-border);
  --side-line-soft: var(--ink-rule);
  --ink-side:       var(--ink);
  --ink-side-soft:  var(--ink-soft);
  --ink-side-mute:  var(--ink-mute);
  --purple-ink:     var(--paper);
  --purple-soft:    var(--ink);
  --purple-line:    var(--mustard);
  --side-item-hover: var(--card-bg);
  --hero-tint: transparent;
}

/* ============================================================
   Body · washi background (two-layer dot-grain)
   ============================================================ */
body.theme-washi {
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(rgba(138,110,50,0.055) 1px, transparent 1.5px),
    radial-gradient(rgba(138,110,50,0.04)  1px, transparent 1.5px);
  background-size: 6px 6px, 13px 13px;
  background-position: 0 0, 3px 4px;
  font-feature-settings: "palt" 1;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

/* 3px 頂部尺規（mustard→persimmon→vermillion→plum） */
body.theme-washi::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent-gradient-wide);
  opacity: 0.85;
  z-index: 9999;
  pointer-events: none;
}

body.theme-washi .background-blobs { display: none; }
body.theme-washi .top-progress-bar { top: 3px; background: var(--vermillion); }

/* ============================================================
   App shell
   ============================================================ */
body.theme-washi .app-shell {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  background: var(--paper);
  min-height: 100vh;
}

/* ============================================================
   Sidebar
   ============================================================ */
body.theme-washi .side {
  background: var(--paper-shade);
  border-right: 1px solid var(--card-border);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 28px 22px 24px;
  gap: 22px;
}

body.theme-washi .side-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 0;
}
/* hanko 印 — 重新利用 .brand-mark 作為紅方印章 */
body.theme-washi .side-brand {
  flex-direction: row !important;
  align-items: center !important;
  flex-wrap: wrap;
  gap: 8px !important;
}
body.theme-washi .side-brand .brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: var(--seal);
  color: var(--paper);
  font-size: 0; /* 隱藏原本的 emoji */
  border-radius: 2px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.15) inset, 0 0 0 1px rgba(255,255,255,0.05) inset;
  transform: rotate(-3deg);
  flex-shrink: 0;
  user-select: none;
  font-feature-settings: normal;
}
body.theme-washi .side-brand .brand-mark::before {
  content: '印';
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0;
}
body.theme-washi .logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2rem !important;
  letter-spacing: 0.02em;
  line-height: 1;
  color: var(--ink) !important;
  background: none !important;
  -webkit-background-clip: initial !important;
  -webkit-text-fill-color: currentColor !important;
  background-clip: initial;
  margin: 0;
}
body.theme-washi .logo span {
  color: var(--vermillion) !important;
  background: none !important;
  -webkit-text-fill-color: currentColor !important;
  font-size: inherit;
}

/* JP 副標 (学術・論文追跡) — 整行另起，跳到 hanko + logo 下方 */
body.theme-washi .side-brand::after {
  content: '学術・論文追跡 · v2';
  flex-basis: 100%;
  font-family: var(--font-soft);
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--ink-mute);
  text-transform: lowercase;
}

/* Discipline switcher */
body.theme-washi .side-discipline { padding: 0; }
body.theme-washi .switch-discipline-btn {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--r-md);
  color: var(--ink);
  padding: 11px 14px;
  font-family: var(--font-body);
  font-size: 13px;
  transition: all .22s var(--ease-brand);
  width: 100%;
}
body.theme-washi .switch-discipline-btn:hover {
  background: var(--mustard-wash);
  border-color: var(--mustard);
}
body.theme-washi .discipline-badge {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.02em;
  background: none;
  border: none;
  padding: 0;
}

/* Section heading (jp-label 風) */
body.theme-washi .side-section-label {
  font-family: var(--font-soft);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3em;
  color: var(--ink-mute);
  text-transform: lowercase;
  padding: 6px 4px 2px;
  margin: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
body.theme-washi .side-section-label .hint {
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--ink-pale);
  font-weight: 400;
}

/* Sidebar nav list */
body.theme-washi .side-nav {
  padding: 0;
  gap: 4px;
}
body.theme-washi .side-nav .category-filters-wrapper { padding: 0; }
body.theme-washi .side-nav .category-filters {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0;
  overflow: visible;
}

/* Sidebar category pill buttons */
body.theme-washi .side-nav .category-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 7px 14px !important;
  border-radius: var(--r-pill) !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  color: var(--ink-soft) !important;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-align: left;
  justify-content: flex-start;
  transition: all .15s var(--ease-brand) !important;
  box-shadow: none;
  line-height: 1.4;
  min-height: 0;
}
body.theme-washi .side-nav .category-btn:hover {
  background: var(--card-bg) !important;
  border-color: var(--card-border) !important;
  color: var(--ink) !important;
  transform: none;
}
body.theme-washi .side-nav .category-btn.active {
  background: var(--ink) !important;
  border-color: var(--ink) !important;
  color: var(--paper) !important;
  font-weight: 600;
}

/* 特殊 active: 收藏（朱）、頂會（柿）、HF Daily（山吹） */
body.theme-washi .side-nav .category-btn[data-filter="favorites"].active {
  background: var(--vermillion) !important;
  border-color: var(--vermillion) !important;
  color: #fff !important;
}
body.theme-washi .side-nav .category-btn.top-conf-btn.active,
body.theme-washi .side-nav .category-btn[data-filter="top_conf"].active {
  background: var(--persimmon-soft) !important;
  border-color: var(--persimmon) !important;
  color: #b35a0c !important;
}
body.theme-washi .side-nav .category-btn[data-filter="hf_daily"].active {
  background: var(--mustard-soft) !important;
  border-color: var(--mustard) !important;
  color: var(--mustard-deep) !important;
}

body.theme-washi .side-nav .top-conf-wrapper .category-btn .chevron-icon {
  margin-left: auto;
}
body.theme-washi .top-conf-wrapper { width: 100%; }
body.theme-washi .conf-submenu {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  padding: 6px;
}
body.theme-washi .conf-submenu .conf-item {
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  white-space: nowrap;
}
body.theme-washi .conf-submenu .conf-item:hover {
  background: var(--paper-shade);
  border-color: var(--card-border);
  color: var(--ink);
}
body.theme-washi .conf-submenu .conf-item.active {
  background: var(--mustard-soft);
  border-color: var(--mustard);
  color: var(--mustard-deep);
}

/* 新增主題 (dashed pill) */
body.theme-washi .side-nav .add-topic-wrapper {
  margin-top: 6px;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1.5px dashed var(--ink-pale);
  border-radius: var(--r-pill);
  background: transparent;
}
body.theme-washi .side-nav .add-topic-wrapper:hover {
  border-color: var(--mustard);
}
body.theme-washi .side-nav .add-topic-wrapper input {
  flex: 1; min-width: 0;
  background: transparent !important;
  border: none !important;
  color: var(--ink-soft);
  font-family: var(--font-soft);
  font-size: 12px;
  padding: 6px 14px;
}
body.theme-washi .side-nav .add-topic-wrapper input::placeholder { color: var(--ink-pale); }
body.theme-washi .side-nav .add-topic-wrapper input:focus {
  outline: none;
  border-color: transparent !important;
}
body.theme-washi .side-nav .add-topic-wrapper .add-topic-btn {
  width: auto;
  height: auto;
  background: transparent !important;
  border: none !important;
  color: var(--ink-mute);
  font-size: 15px;
  padding: 0 12px 0 0;
  cursor: pointer;
}
body.theme-washi .side-nav .add-topic-wrapper .add-topic-btn:hover { color: var(--mustard-deep); }

body.theme-washi .filter-arrow { display: none !important; }

/* Sidebar foot */
body.theme-washi .side-foot {
  margin-top: auto;
  padding: 18px 0 4px;
  border-top: 1px dashed var(--card-border);
  font-size: 11px;
  color: var(--ink-mute);
  font-family: var(--font-body);
  gap: 6px;
}
body.theme-washi .side-foot-item { letter-spacing: 0.04em; }
body.theme-washi kbd,
body.theme-washi .side-foot-item kbd,
body.theme-washi .kbd-hint kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--paper-deep);
  border: 1px solid var(--card-border);
  border-bottom-width: 2px;
  color: var(--ink);
  padding: 1px 6px;
  border-radius: var(--r-xs);
  margin-right: 3px;
  box-shadow: none;
}

/* ============================================================
   Container / header
   ============================================================ */
body.theme-washi .container,
body.theme-washi .app-shell > .container {
  background: transparent;
  padding: 32px 44px 80px;
  max-width: 1320px;
}
body.theme-washi header,
body.theme-washi .app-shell > .container > header {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0 0 24px 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
}

body.theme-washi .header-content {
  background: transparent !important;
  padding: 0 !important;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin: 0;
}

/* Page title block (今日 · today / Signal 推薦 · signal feed) */
body.theme-washi .page-title-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
body.theme-washi .page-title-block .jp-label {
  font-family: var(--font-soft);
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--ink-mute);
  text-transform: lowercase;
}
body.theme-washi .page-title-block .page-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.7rem;
  line-height: 1.1;
  color: var(--ink);
  letter-spacing: 0.02em;
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
}
body.theme-washi .page-title-block .page-title-sub {
  font-family: var(--font-soft);
  font-size: 0.6em;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
  font-weight: 500;
}

/* Hide original ::before/::after header greetings */
body.theme-washi .container > header::before,
body.theme-washi .container > header::after { content: none !important; display: none !important; }

/* Auth / data IO chips */
body.theme-washi .sign-in-btn,
body.theme-washi .sign-out-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--ink-soft);
  border-radius: var(--r-sm);
  padding: 7px 12px;
  font-size: 12px;
  font-family: var(--font-body);
  transition: all .15s var(--ease-brand);
}
body.theme-washi .sign-in-btn:hover {
  border-color: var(--mustard);
  background: var(--mustard-wash);
  color: var(--ink);
}
body.theme-washi .user-info:not([hidden]) {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--r-pill);
  padding: 5px 12px 5px 5px;
  font-size: 12px;
  color: var(--ink);
}
body.theme-washi .user-info[hidden],
body.theme-washi .sign-in-btn[hidden] { display: none !important; }
body.theme-washi .user-info img {
  width: 24px; height: 24px; border-radius: 50%;
}
body.theme-washi .user-info #userName {
  font-family: var(--font-display);
  font-weight: 500;
}

/* Controls row */
body.theme-washi .controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 0;
}
body.theme-washi .search-box {
  flex: 1;
  min-width: 280px;
  position: relative;
  display: flex;
  align-items: center;
}
body.theme-washi .search-box input {
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--r-md);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 11px 44px 11px 42px;
  outline: none;
  box-shadow: none;
  transition: all .18s var(--ease-brand);
}
body.theme-washi .search-box input::placeholder { color: var(--ink-mute); }
body.theme-washi .search-box input:focus {
  border-color: var(--mustard);
  background: var(--card-bg);
  outline: none;
  box-shadow: 0 0 0 3px var(--mustard-wash);
}
body.theme-washi .search-icon {
  color: var(--ink-mute);
  left: 14px;
  opacity: 1;
}
body.theme-washi .pin-search-btn {
  position: absolute;
  right: 6px;
  background: transparent;
  border: none;
  color: var(--ink-mute);
  font-size: 15px;
  padding: 4px 6px;
  border-radius: var(--r-xs);
  cursor: pointer;
}
body.theme-washi .pin-search-btn:hover {
  color: var(--mustard-deep);
  background: var(--mustard-wash);
}

/* Time range segmented control */
body.theme-washi .time-range-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--r-md);
  box-shadow: none;
}
body.theme-washi .time-range-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: var(--r-sm);
  padding: 7px 10px;
  background: transparent;
  color: var(--ink-mute);
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}
body.theme-washi .time-range-btn span {
  font-family: var(--font-mono);
  font-size: 9px;
  opacity: 0.58;
}
body.theme-washi .time-range-btn:hover {
  color: var(--ink);
  background: var(--paper-shade);
}
body.theme-washi .time-range-btn.active {
  color: var(--mustard-deep);
  background: var(--mustard-soft);
  font-weight: 700;
}

/* Sort dropdown */
body.theme-washi .sort-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--r-md);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 10px 14px;
  box-shadow: none;
  transition: all .15s var(--ease-brand);
}
body.theme-washi .sort-trigger:hover {
  border-color: var(--mustard);
  background: var(--card-bg);
}
body.theme-washi .sort-chevron { color: var(--ink-mute); }
body.theme-washi .sort-submenu {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-modal);
  padding: 6px;
  min-width: 240px;
}
body.theme-washi .sort-item {
  font-family: var(--font-body);
  color: var(--ink);
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  border: none;
  text-align: left;
  width: 100%;
  cursor: pointer;
}
body.theme-washi .sort-item:hover { background: var(--paper-shade); }
body.theme-washi .sort-item.active { background: var(--mustard-soft); }
body.theme-washi .sort-item span {
  font-family: var(--font-mono);
  color: var(--ink-mute);
  font-size: 10px;
  opacity: 0.6;
}

/* Per-page */
body.theme-washi .per-page-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--r-md);
  padding: 5px 10px;
}
body.theme-washi .per-page-wrapper:hover { border-color: var(--mustard); }
body.theme-washi .per-page-label { color: var(--ink-mute); font-size: 12px; font-family: var(--font-body); }
body.theme-washi .per-page-select {
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  border: none;
  font-size: 12px;
  outline: none;
}

/* ============================================================
   Papers grid
   ============================================================ */
body.theme-washi .papers-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
@media (max-width: 880px) {
  body.theme-washi .papers-grid { grid-template-columns: 1fr !important; }
}

/* ============================================================
   Paper card
   ============================================================ */
body.theme-washi .paper-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--r-lg);
  padding: 18px 20px 14px;
  box-shadow: var(--shadow-card);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all .28s var(--ease-brand);
  overflow: hidden;
  position: relative;
  opacity: 1;
  animation: none;
}

/* mustard 頂部 2px 線（hover 現） */
body.theme-washi .paper-card::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 2px;
  background: var(--mustard);
  border-radius: 0;
  opacity: 0;
  transition: opacity .24s var(--ease-brand);
}
body.theme-washi .paper-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
  border-color: var(--mustard);
}
body.theme-washi .paper-card:hover::before { opacity: 1; }

/* 既読 斜絲帶（repurpose .read-ribbon div） */
body.theme-washi .paper-card .read-ribbon {
  display: none;
}
body.theme-washi .paper-card.is-read { opacity: 0.74; }
body.theme-washi .paper-card.is-read .paper-title,
body.theme-washi .paper-card.is-read .paper-title-link { color: var(--ink-mute); }
body.theme-washi .paper-card.is-read::after {
  content: '既読';
  position: absolute;
  top: 14px;
  left: -24px;
  transform: rotate(-45deg);
  background: var(--matcha);
  color: #fff;
  font-family: var(--font-soft);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2em;
  padding: 2px 26px;
  z-index: 3;
  pointer-events: none;
}

/* star */
body.theme-washi .star-btn {
  position: absolute;
  top: 12px; right: 12px;
  background: none !important;
  border: none;
  color: var(--ink-pale);
  min-width: 0;
  min-height: 0;
  width: auto; height: auto;
  padding: 4px;
  font-size: 18px;
  border-radius: 50%;
  transition: transform .18s var(--ease-brand), color .18s;
  z-index: 2;
}
body.theme-washi .star-btn:hover {
  color: var(--vermillion);
  background: transparent !important;
  transform: scale(1.15);
}
body.theme-washi .paper-card.starred .star-btn,
body.theme-washi .star-btn.starred { color: var(--vermillion); }

/* read toggle small pill */
body.theme-washi .read-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--paper-shade);
  border: 1px solid var(--card-border);
  color: var(--ink-mute);
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-size: 10px;
  padding: 3px 9px;
  box-shadow: none;
}
body.theme-washi .paper-card.is-read .read-btn {
  background: var(--matcha-soft);
  color: #557019;
  border-color: #9cb45a;
}

/* Venue + signal row (inline) */
body.theme-washi .venue-badge {
  display: inline-block;
  vertical-align: middle;
  padding: 3px 10px;
  border-radius: 3px;
  margin: 0 6px 0 0;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  background: #6b6247; /* fallback = arXiv */
  box-shadow: none;
  text-shadow: none;
}
body.theme-washi .venue-badge[data-venue="CVPR"]    { background: #2e4d7b; }
body.theme-washi .venue-badge[data-venue="ACL"]     { background: #c1440e; }
body.theme-washi .venue-badge[data-venue="NeurIPS"] { background: #6b8e23; }
body.theme-washi .venue-badge[data-venue="ICML"]    { background: #8a3a5f; }
body.theme-washi .venue-badge[data-venue="ICLR"]    { background: #e8711a; }
body.theme-washi .venue-badge[data-venue="SIGGRAPH"]{ background: #4a3a8a; }
body.theme-washi .venue-badge[data-venue="arXiv"]   { background: #6b6247; }
body.theme-washi .venue-badge[data-venue="Bridge"]  { background: #2a2418; }
body.theme-washi .venue-badge[data-venue="EMNLP"]   { background: #3e6b4a; }
body.theme-washi .venue-badge[data-venue="AAAI"]    { background: #5a3a7b; }
body.theme-washi .venue-badge[data-venue="KDD"]     { background: #6b4a1e; }

/* Signal block — inline meter row */
body.theme-washi .signal-block {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0 0 6px;
  box-shadow: none;
  flex-wrap: wrap;
}
body.theme-washi .signal-block .signal-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  flex-wrap: wrap;
}
body.theme-washi .signal-block .signal-score {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-mute);
  background: transparent;
  padding: 0;
  border: none;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  letter-spacing: 0.08em;
}
body.theme-washi .signal-block .signal-score b {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--mustard-deep);
  letter-spacing: 0;
}
body.theme-washi .value-tier {
  font-family: var(--font-soft);
  font-size: 10px;
  letter-spacing: 0.06em;
  padding: 1px 7px;
  border-radius: var(--r-pill);
  background: var(--paper-shade);
  border: 1px solid var(--card-border);
  color: var(--ink-mute);
}
body.theme-washi .value-tier[data-tier="high"],
body.theme-washi .value-tier[data-tier="hot"] {
  background: var(--persimmon-soft);
  border-color: var(--persimmon);
  color: var(--vermillion);
}
body.theme-washi .value-tier[data-tier="solid"] {
  background: var(--matcha-soft);
  border-color: var(--matcha);
  color: #557019;
}
body.theme-washi .value-tier[data-tier="emerging"] {
  background: var(--indigo-soft);
  border-color: var(--indigo);
  color: var(--indigo);
}
body.theme-washi .signal-axes {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}
body.theme-washi .signal-axis {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--ink-mute);
}
body.theme-washi .signal-axis .sa-label {
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  color: var(--ink-mute);
  opacity: 0.85;
  min-width: 12px;
}
body.theme-washi .signal-axis .sa-track {
  display: inline-block;
  width: 26px;
  height: 3px;
  background: var(--ink-rule);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
body.theme-washi .signal-axis .sa-fill {
  display: block;
  height: 100%;
  background: var(--mustard);
  border-radius: 2px;
  transition: width 0.4s ease;
}
body.theme-washi .value-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  width: 100%;
}
body.theme-washi .value-reason {
  font-family: var(--font-body);
  font-size: 10.5px;
  color: var(--ink-mute);
  background: var(--paper-shade);
  border: 1px solid var(--card-border);
  border-radius: var(--r-pill);
  padding: 2px 8px;
}

/* Title / authors */
body.theme-washi .paper-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15.5px;
  line-height: 1.55;
  letter-spacing: 0.01em;
  color: var(--ink);
  padding-right: 28px;
  margin: 0;
  text-wrap: pretty;
}
body.theme-washi .paper-title-link {
  color: var(--ink);
  text-decoration: none;
  background: none;
}
body.theme-washi .paper-title-link:hover {
  color: var(--vermillion);
  text-decoration: underline;
  text-decoration-color: var(--mustard);
  text-underline-offset: 3px;
}
body.theme-washi .paper-authors {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 12px;
  color: #8a6d3a;
  margin: 0;
}
body.theme-washi .paper-authors .author-btn {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  padding: 0;
  cursor: pointer;
}
body.theme-washi .paper-authors .author-btn:hover {
  color: var(--vermillion);
  text-decoration: underline;
}

/* Tags */
body.theme-washi .paper-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  margin: 2px 0 0 0;
}
body.theme-washi .tag-chips { gap: 6px; flex-wrap: wrap; display: flex; }
body.theme-washi .tag-chip {
  padding: 2px 10px;
  border-radius: var(--r-pill);
  font-size: 11px;
  background: var(--mustard-soft);
  border: 1px solid var(--mustard);
  color: var(--mustard-deep);
  font-family: var(--font-body);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
body.theme-washi .tag-chip.tag-bridge {
  background: var(--plum-soft);
  border-color: var(--plum);
  color: var(--plum);
}
body.theme-washi .tag-chip .tag-remove { color: var(--mustard-deep); opacity: 0.55; }
body.theme-washi .tag-add-btn {
  background: transparent;
  border: 1px dashed var(--ink-pale);
  color: var(--ink-mute);
  border-radius: var(--r-pill);
  font-size: 11px;
  padding: 2px 10px;
  font-family: var(--font-soft);
  cursor: pointer;
}
body.theme-washi .tag-add-btn:hover {
  border-color: var(--mustard);
  color: var(--mustard-deep);
}

body.theme-washi .paper-summary {
  border-top: 1px dashed var(--card-border);
  font-family: var(--font-body);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.9;
  padding: 10px 0 0;
  margin: 4px 0 0;
}

/* Note panel (washi 記事箋) */
body.theme-washi .note-panel {
  background: var(--paper-shade);
  border: 1px solid var(--card-border);
  border-radius: var(--r-md);
  padding: 10px;
  margin-top: 8px;
}
body.theme-washi .note-textarea {
  width: 100%;
  background: repeating-linear-gradient(
    to bottom,
    var(--card-bg) 0,
    var(--card-bg) 28px,
    var(--ink-rule) 28px,
    var(--ink-rule) 29px
  );
  border: 1px solid var(--card-border);
  border-radius: var(--r-sm);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 29px;
  padding: 4px 10px;
  resize: vertical;
  min-height: 120px;
}
body.theme-washi .note-cancel-btn {
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--ink-mute);
  font-family: var(--font-body);
  border-radius: var(--r-sm);
  padding: 6px 14px;
  cursor: pointer;
}
body.theme-washi .note-save-btn {
  background: var(--mustard);
  border: 1.5px solid var(--ink);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 600;
  border-radius: var(--r-sm);
  padding: 6px 14px;
  box-shadow: 2px 2px 0 var(--mustard-deep);
  transition: all .18s var(--ease-brand);
  cursor: pointer;
}
body.theme-washi .note-save-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--mustard-deep);
}

/* Card footer */
body.theme-washi .paper-footer {
  border-top: 1px dashed var(--card-border);
  padding-top: 11px;
  margin-top: auto;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: transparent;
  box-shadow: none;
}
body.theme-washi .paper-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-mute);
  background: transparent;
  padding: 0;
  border: none;
}

/* Stat chips — citation (matcha), hf (mustard), github (paper) */
body.theme-washi .citation-badge {
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-size: 11px;
  color: #557019;
  background: var(--matcha-soft);
  border: 1px solid #9cb45a;
  font-family: var(--font-mono);
}
body.theme-washi .hf-badge {
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-size: 11px;
  color: var(--mustard-deep);
  background: #fff1b8;
  border: 1px solid var(--mustard);
  font-family: var(--font-mono);
}
body.theme-washi .influential-badge,
body.theme-washi .survey-badge,
body.theme-washi .speed-badge,
body.theme-washi .h5-badge {
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-size: 11px;
  color: var(--ink-soft);
  background: var(--paper-shade);
  border: 1px solid var(--card-border);
  font-family: var(--font-mono);
}
body.theme-washi .influential-badge { color: var(--plum); background: var(--plum-soft); border-color: var(--plum); }
body.theme-washi .speed-badge { color: var(--vermillion); background: var(--persimmon-soft); border-color: var(--persimmon); }
body.theme-washi .view-badge {
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-size: 11px;
  color: var(--indigo);
  background: var(--indigo-soft);
  border: 1px solid var(--indigo);
  font-family: var(--font-mono);
}

body.theme-washi .github-link-btn,
body.theme-washi .github-slot a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ink-soft);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--r-pill);
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-decoration: none;
}
body.theme-washi .github-link-btn:hover {
  color: var(--ink);
  border-color: var(--ink);
}

body.theme-washi .note-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--plum-soft);
  border: 1px solid var(--plum);
  color: var(--plum);
  border-radius: var(--r-pill);
  padding: 3px 10px;
  font-size: 11px;
  font-family: var(--font-body);
  cursor: pointer;
}

/* Bridge badge — washi indigo pill */
body.theme-washi .bridge-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 4px 6px 4px 0;
  padding: 3px 10px;
  background: transparent;
  border: 1px solid var(--indigo);
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--indigo);
  font-weight: 600;
}
body.theme-washi .bridge-badge .bridge-others {
  opacity: 0.78;
  font-weight: 400;
  font-size: 10px;
  color: var(--ink-soft);
  font-family: var(--font-body);
  letter-spacing: 0;
}
body.theme-washi .paper-card.has-note .note-btn {
  background: var(--plum);
  color: #fff;
  border-color: var(--plum);
}

body.theme-washi .paper-link {
  color: var(--indigo);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  text-decoration: none;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  padding: 0;
}
body.theme-washi .paper-link:hover { color: var(--vermillion); }

/* ============================================================
   Discipline picker modal
   ============================================================ */
body.theme-washi .discipline-picker .dp-backdrop {
  background: rgba(42, 36, 24, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
body.theme-washi .dp-modal {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-modal);
}
/* Toolbar · search bar */
body.theme-washi .dp-toolbar {
  border-bottom: 1px solid var(--ink-rule);
}
body.theme-washi .dp-search svg { color: var(--ink-mute); }
body.theme-washi .dp-search input {
  background: var(--paper);
  border: 1px solid var(--card-border);
  color: var(--ink);
  font-family: var(--font-body);
}
body.theme-washi .dp-search input:focus {
  border-color: var(--mustard);
  background: var(--paper-shade);
  box-shadow: 0 0 0 3px var(--mustard-wash);
}
body.theme-washi .dp-search input::placeholder { color: var(--ink-pale); }
/* Category chips */
body.theme-washi .dp-chip {
  background: var(--paper);
  border: 1px solid var(--card-border);
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-weight: 500;
}
body.theme-washi .dp-chip:hover {
  background: var(--mustard-soft);
  color: var(--ink);
  border-color: var(--mustard);
}
body.theme-washi .dp-chip.active {
  background: var(--mustard);
  border-color: var(--ink);
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--mustard-deep);
}
body.theme-washi .dp-chip-count {
  background: var(--paper-deep);
  color: var(--ink-mute);
}
body.theme-washi .dp-chip.active .dp-chip-count {
  background: var(--ink);
  color: var(--paper);
}
/* Section headers */
body.theme-washi .dp-section-head {
  border-bottom: 1px dashed var(--ink-rule);
}
body.theme-washi .dp-section-title {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0.04em;
}
body.theme-washi .dp-section-en {
  font-family: var(--font-soft);
  color: var(--ink-mute);
}
body.theme-washi .dp-section-count {
  background: var(--paper-shade);
  color: var(--ink-mute);
  border: 1px solid var(--card-border);
}
body.theme-washi .dp-empty { color: var(--ink-mute); }
body.theme-washi .dp-body::-webkit-scrollbar-thumb { background: var(--ink-rule); }
body.theme-washi .dp-header::before {
  content: 'discipline · 研究領域';
  display: block;
  font-family: var(--font-soft);
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--ink-mute);
  margin-bottom: 4px;
  text-transform: lowercase;
}
body.theme-washi .dp-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--ink);
  letter-spacing: 0.02em;
  margin: 0 0 4px;
}
body.theme-washi .dp-subtitle {
  color: var(--ink-mute);
  font-size: 13px;
  line-height: 1.8;
  font-family: var(--font-body);
  margin: 0 0 16px;
}
body.theme-washi .dp-card {
  background: var(--paper-shade);
  border: 1px solid var(--card-border);
  color: var(--ink);
  box-shadow: none;
}
body.theme-washi .dp-card:hover {
  background: var(--mustard-wash);
  border-color: var(--mustard);
  box-shadow: 2px 2px 0 var(--mustard-deep);
}
body.theme-washi .dp-card.active {
  background: var(--mustard-soft);
  border: 1.5px solid var(--mustard);
  box-shadow: 2px 2px 0 var(--mustard-deep);
}
body.theme-washi .dp-card-name {
  font-family: var(--font-display);
  color: var(--ink);
}
body.theme-washi .dp-card-name-en {
  font-family: var(--font-soft);
  color: var(--ink-mute);
}
body.theme-washi .dp-card-arxiv {
  font-family: var(--font-mono);
  color: var(--plum);
}
body.theme-washi .dp-card-confs,
body.theme-washi .dp-card-topics {
  color: var(--ink-mute);
}
body.theme-washi .dp-track-star { color: var(--ink-pale); }
body.theme-washi .dp-track-star.active,
body.theme-washi .dp-track-star:hover { color: var(--vermillion); }
body.theme-washi .dp-close {
  background: transparent;
  border: none;
  color: var(--ink-mute);
  font-size: 24px;
}
body.theme-washi .dp-close:hover { color: var(--ink); }

/* ============================================================
   Loader / empty state
   ============================================================ */
body.theme-washi .loader-container { color: var(--ink-mute); }
body.theme-washi .spinner {
  background: conic-gradient(from 0deg,
    var(--mustard),
    var(--persimmon),
    var(--vermillion),
    var(--mustard)) !important;
  border: none;
}
body.theme-washi .spinner::after {
  background: var(--paper) !important;
}
body.theme-washi #loaderText { font-family: var(--font-body); color: var(--ink-mute); }

body.theme-washi .no-results { padding: 40px 20px; text-align: center; }
body.theme-washi .no-results-icon { font-size: 48px; }
body.theme-washi .no-results-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink);
  margin: 12px 0 4px;
}
body.theme-washi .no-results-hint {
  color: var(--ink-mute);
  font-size: 13px;
  font-family: var(--font-body);
}
body.theme-washi .no-results-action {
  background: var(--mustard);
  border: 1.5px solid var(--ink);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 600;
  border-radius: var(--r-sm);
  padding: 10px 18px;
  box-shadow: 2px 2px 0 var(--mustard-deep);
  transition: all .18s var(--ease-brand);
  cursor: pointer;
  margin-top: 16px;
}
body.theme-washi .no-results-action:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--mustard-deep);
}
body.theme-washi .topic-suggestions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  margin-top: 16px;
}
body.theme-washi .topic-suggestions .ts-label {
  font-family: var(--font-soft);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ink-mute);
}
body.theme-washi .topic-suggestions .ts-chip {
  background: var(--mustard-soft);
  border: 1px solid var(--mustard);
  color: var(--mustard-deep);
  border-radius: var(--r-pill);
  padding: 4px 12px;
  font-family: var(--font-body);
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}
body.theme-washi .topic-suggestions .ts-chip:hover {
  background: var(--mustard);
  color: var(--ink);
}

/* ============================================================
   Floating utility buttons
   ============================================================ */
body.theme-washi .kbd-hint-btn,
body.theme-washi .back-to-top {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--ink-soft);
  border-radius: 50%;
  box-shadow: var(--shadow-card);
  transition: all .2s var(--ease-brand);
}
body.theme-washi .kbd-hint-btn:hover,
body.theme-washi .back-to-top:hover {
  background: var(--mustard-wash);
  border-color: var(--mustard);
  color: var(--ink);
}

body.theme-washi .kbd-hint {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--ink-soft);
  font-family: var(--font-body);
  box-shadow: var(--shadow-card);
  border-radius: var(--r-md);
}

body.theme-washi .ctx-menu {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-modal);
  border-radius: var(--r-md);
}
body.theme-washi .ctx-item {
  font-family: var(--font-body);
  color: var(--ink);
  background: transparent;
}
body.theme-washi .ctx-item:hover { background: var(--paper-shade); }
body.theme-washi .ctx-danger { color: var(--vermillion); }

/* ============================================================
   Focus states
   ============================================================ */
body.theme-washi button:focus-visible,
body.theme-washi input:focus-visible,
body.theme-washi select:focus-visible,
body.theme-washi textarea:focus-visible {
  outline: 2px solid var(--mustard);
  outline-offset: 2px;
}

/* ============================================================
   Responsive
   ============================================================ */
/* 窄桌面：壓縮側欄但保持 on the side (not on top) */
@media (max-width: 960px) and (min-width: 721px) {
  body.theme-washi .app-shell { grid-template-columns: 220px minmax(0, 1fr); }
  body.theme-washi .side { padding: 22px 14px 20px; gap: 16px; }
  body.theme-washi .side-nav .category-btn { font-size: 12.5px; padding: 6px 10px; }
}

/* 真·手機：折疊成單欄 */
@media (max-width: 720px) {
  body.theme-washi .app-shell { grid-template-columns: 1fr; }
  body.theme-washi .side {
    position: relative;
    height: auto;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--card-border);
    padding: 18px 16px;
  }
  body.theme-washi .side-nav .category-filters {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }
  body.theme-washi .side-foot { display: none; }
  body.theme-washi .container,
  body.theme-washi .app-shell > .container { padding: 22px 18px 60px; }
}

/* ============================================================
   v3 polish — hanko, watermark, micro-interactions
   ============================================================ */

/* Page title hanko — "今" 紅方印 在主標旁 */
body.theme-washi .page-title-block .page-title::after {
  content: '今';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: 4px;
  background: var(--seal);
  color: var(--paper);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
  border-radius: 2px;
  transform: translateY(-2px) rotate(3deg);
  box-shadow: 0 1px 0 rgba(0,0,0,0.15) inset, 0 0 0 1px rgba(255,255,255,0.06) inset;
  vertical-align: middle;
  user-select: none;
}

/* Empty state — 漢字 縦書 watermark + 望遠鏡 dashed mustard ring */
body.theme-washi .no-results {
  position: relative;
  padding: 64px 20px 56px !important;
  overflow: hidden;
}
body.theme-washi .no-results::before {
  content: '学術 · 論文 · 研究 · 考察';
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: 0.6em;
  color: var(--ink);
  opacity: 0.06;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}
body.theme-washi .no-results-icon {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  border: 2px dashed var(--mustard);
  border-radius: 50%;
  background: var(--mustard-soft);
  font-size: 40px !important;
  position: relative;
  margin: 0 auto;
}
body.theme-washi .no-results-icon::after {
  content: '空';
  position: absolute;
  bottom: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  background: var(--seal);
  color: var(--paper);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  transform: rotate(-6deg);
  box-shadow: 0 1px 0 rgba(0,0,0,0.18) inset;
  user-select: none;
}

/* Card hover — 更明確的 lift + mustard 邊 + 內側微紙紋 */
body.theme-washi .paper-card {
  transition:
    transform .28s var(--ease-brand),
    box-shadow .28s var(--ease-brand),
    border-color .28s var(--ease-brand);
}
body.theme-washi .paper-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--mustard) !important;
}

/* Card focus-within ring（鍵盤導覽友善） */
body.theme-washi .paper-card:focus-within {
  border-color: var(--mustard) !important;
  box-shadow: var(--shadow-card-hover), 0 0 0 2px var(--mustard-wash);
}

/* Filter chip：active 時加上 2px offset 印章感陰影 */
body.theme-washi .category-btn.active {
  box-shadow: 2px 2px 0 var(--mustard-deep);
  transform: translate(-1px, -1px);
}
body.theme-washi .category-btn.active:hover {
  box-shadow: 3px 3px 0 var(--mustard-deep);
  transform: translate(-2px, -2px);
}

/* Sort trigger / per-page select 與 search 對齊高度 + hover 微提 */
body.theme-washi .sort-trigger,
body.theme-washi .per-page-select {
  transition: all .18s var(--ease-brand);
}
body.theme-washi .sort-trigger:hover,
body.theme-washi .per-page-select:hover {
  border-color: var(--mustard);
  background: var(--mustard-wash);
}

/* Note save button 已有 2px offset，補強 active pressed 感 */
body.theme-washi .note-save-btn:active {
  transform: translate(0, 0);
  box-shadow: 0 0 0 var(--mustard-deep);
}
body.theme-washi .no-results-action:active {
  transform: translate(0, 0);
  box-shadow: 0 0 0 var(--mustard-deep);
}

/* Loader spinner — 補強：環形漸層更明確 */
body.theme-washi .spinner {
  width: 44px;
  height: 44px;
  position: relative;
}

/* Top progress bar 更醒目 — 加上微脈動 */
body.theme-washi .top-progress-bar {
  background: linear-gradient(90deg, var(--mustard) 0%, var(--persimmon) 50%, var(--vermillion) 100%) !important;
  height: 2px;
  box-shadow: 0 0 8px var(--accent-glow);
}

/* 行動裝置：卡片 hover lift 縮小避免 sticky hover */
@media (hover: none) {
  body.theme-washi .paper-card:hover {
    transform: none;
    box-shadow: var(--shadow-card);
  }
}

/* Reduced motion 尊重系統設定 */
@media (prefers-reduced-motion: reduce) {
  body.theme-washi *,
  body.theme-washi *::before,
  body.theme-washi *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  body.theme-washi .paper-card:hover { transform: none; }
}

/* ── Loader 容器：搭配 skeleton 改為靠上排列 ───────────── */
body.theme-washi .loader-container {
  height: auto;
  min-height: 30vh;
  justify-content: flex-start;
  padding-top: 1.5rem;
  width: 100%;
  align-self: stretch;
}
body.theme-washi .loader-container .spinner {
  width: 36px;
  height: 36px;
}
body.theme-washi .loader-container p {
  margin-top: 0.85rem;
  font-size: 0.85rem;
}

/* ── Skeleton 占位卡片：首屏感知速度 ─────────────────────── */
body.theme-washi .skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
  padding: 0 0.25rem;
  width: 100%;
}
body.theme-washi .skeleton-card {
  background: var(--washi-paper, #f9f4e7);
  border: 1px solid rgba(120, 100, 70, 0.12);
  border-radius: 14px;
  padding: 1.5rem 1.4rem;
  min-height: 220px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
  position: relative;
  overflow: hidden;
}
body.theme-washi .skeleton-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%);
  background-size: 220% 100%;
  animation: sk-shimmer 1.6s ease-in-out infinite;
  pointer-events: none;
}
body.theme-washi .sk-line,
body.theme-washi .sk-block {
  background: rgba(120, 100, 70, 0.14);
  border-radius: 4px;
}
body.theme-washi .sk-line { height: 14px; margin-bottom: 10px; }
body.theme-washi .sk-title { height: 22px; width: 78%; margin-bottom: 14px; }
body.theme-washi .sk-author { width: 48%; }
body.theme-washi .sk-tag { width: 32%; height: 12px; margin-top: 6px; }
body.theme-washi .sk-block {
  height: 64px;
  margin: 14px 0 12px;
  border-radius: 8px;
  background: rgba(120, 100, 70, 0.09);
}
@keyframes sk-shimmer {
  0%   { background-position: 220% 0; }
  100% { background-position: -120% 0; }
}
@media (prefers-reduced-motion: reduce) {
  body.theme-washi .skeleton-card::after { animation: none; opacity: 0.5; }
}
