/* ==========================================================================
   我的文献 · 同步看板 —— 同心学苑风格样式表
   由 papers 原 style.css 整体重写：配色 / 圆角 / 阴影 / 渐变 / 字体全部对齐
   /opt/tongxin/app/public/css/style.css（同心学苑）的设计语言。
   保留原 DOM 结构与全部类名，app.js 无需改动。
   ========================================================================== */

:root {
  /* —— 同心学苑调色板 —— */
  --primary: #4A90E2;
  --primary-light: #6BA3E8;
  --primary-dark: #357ABD;
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --accent: #FF9F43;
  --success: #27AE60;
  --danger: #E74C3C;
  --danger-light: #FDEDEC;
  --card: #FFFFFF;
  --text: #2D3436;
  --text-light: #636E72;
  --text-muted: #B2BEC3;
  --border: #E9ECEF;
  --border-light: #F1F3F4;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.12);
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* —— 兼容旧类名（原 papers 变量，值已换成同心学苑色） —— */
  --ink: var(--text);
  --muted: var(--text-light);
  --line: var(--border);
  --bg: #F5F7FB;
  --green: var(--primary);
  --green-soft: #F0F6FE;
  --amber: var(--accent);
  --amber-soft: #FFF8E1;
  --nav: #16213e;
  --white: #FFFFFF;

  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh; }

button, input, select, textarea { font: inherit; font-family: var(--font); }
button, a, input, select { touch-action: manipulation; }
button, a { cursor: pointer; }
button { border: 0; background: none; color: inherit; }
button:disabled { opacity: .6; cursor: wait; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, dialog:focus-visible {
  outline: 3px solid rgba(74,144,226,.45);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}
[hidden] { display: none !important; }

h1, h2, h3, p { margin-top: 0; }
.muted { color: var(--text-light); line-height: 1.8; }
.eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 2px;
  color: var(--primary); text-transform: uppercase;
}

/* ============================ 品牌 ============================ */
.brand { display: flex; gap: 13px; align-items: center; font-size: 19px; font-weight: 700; letter-spacing: .5px; }
.brand-mark {
  display: grid; place-items: center; width: 42px; height: 42px;
  background: var(--primary-gradient); color: #fff;
  border-radius: var(--radius); font-size: 21px; font-weight: 700;
  box-shadow: 0 4px 14px rgba(102,126,234,.35);
  flex-shrink: 0;
}
.brand-en { display: block; font-size: 8px; letter-spacing: 2px; margin-top: 4px; opacity: .55; font-weight: 500; }

/* ============================ 按钮 ============================ */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 10px 20px;
  border-radius: var(--radius); font-size: .9rem; font-weight: 600;
  white-space: nowrap; transition: var(--transition);
}
.button.primary {
  background: var(--primary); color: #fff;
  box-shadow: 0 4px 16px rgba(74,144,226,.25);
}
.button.primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(74,144,226,.35); }
.button.primary:active { transform: translateY(0); }
.button.secondary {
  background: var(--card); border: 1px solid var(--border); color: var(--text-light);
}
.button.secondary:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow); }
.button.full { width: 100%; }
.button svg { width: 16px; height: 16px; }

.text-button { background: none; color: var(--text-light); padding: 5px 8px; font-size: .8rem; border-radius: var(--radius-full); transition: var(--transition); }
.text-button:hover { color: var(--danger); background: var(--danger-light); }
.text-link { color: var(--primary); text-decoration: none; font-size: .8rem; font-weight: 600; }
.text-link:hover { text-decoration: underline; }

/* ============================ 登录页（同心学苑深色玻璃卡） ============================ */
.login-screen {
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: stretch; justify-content: center;
  padding: 40px 20px;
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}
/* 旋转的极光背景（同心学苑 .login-bg::before 同款） */
.login-screen::before {
  content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
  background:
    radial-gradient(circle at 20% 80%, rgba(120,119,198,0.30) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255,107,107,0.15) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(74,144,226,0.20) 0%, transparent 50%);
  animation: bgRotate 20s linear infinite;
  pointer-events: none; z-index: 0;
}
/* 漂浮光点（同心学苑 floating-shapes 等效装饰，纯 CSS） */
.login-screen::after {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(circle at 12% 18%, rgba(255,255,255,.35) 0 3px, transparent 4px),
    radial-gradient(circle at 82% 12%, rgba(107,163,232,.45) 0 4px, transparent 5px),
    radial-gradient(circle at 88% 62%, rgba(255,159,67,.35) 0 3px, transparent 4px),
    radial-gradient(circle at 22% 78%, rgba(118,75,162,.45) 0 4px, transparent 5px),
    radial-gradient(circle at 62% 88%, rgba(255,255,255,.25) 0 3px, transparent 4px);
  animation: floatShapes 15s ease-in-out infinite;
}
@keyframes bgRotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes floatShapes {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: .5; }
  33%      { transform: translateY(-18px) rotate(3deg); opacity: .75; }
  66%      { transform: translateY(-9px) rotate(-2deg); opacity: .35; }
}

/* 左：品牌故事（玻璃左半） */
.login-story {
  position: relative; z-index: 10;
  flex: 1 1 50%; max-width: 480px; min-height: 500px;
  padding: 48px;
  display: flex; flex-direction: column;
  color: #edf5eb;
  background: linear-gradient(135deg, rgba(74,144,226,0.25) 0%, rgba(118,75,162,0.25) 100%);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.12); border-right: none;
  border-radius: var(--radius-xl) 0 0 var(--radius-xl);
  box-shadow: 0 32px 64px rgba(0,0,0,0.30), inset 0 1px 0 rgba(255,255,255,0.08);
  overflow: hidden;
  animation: cardUp 0.7s cubic-bezier(0.16,1,0.3,1);
}
/* 同心学苑 .login-story:after 的同心圆环 */
.login-story::after {
  content: ''; position: absolute; width: 440px; height: 440px;
  border: 1px solid rgba(139,167,154,.18); border-radius: 50%;
  right: -250px; top: 120px;
  box-shadow: 0 0 0 60px rgba(139,167,154,.04), 0 0 0 120px rgba(139,167,154,.03);
  pointer-events: none;
}
.login-story .brand { color: #fff; }
.login-story .brand-mark {
  background: rgba(255,255,255,.16); color: #fff;
  border: 1px solid rgba(255,255,255,.22);
  box-shadow: none; backdrop-filter: blur(8px);
}
.login-story .brand-en { color: rgba(255,255,255,.55); opacity: 1; }

.story-copy { margin: auto 0; padding: 70px 0; position: relative; z-index: 1; }
.story-copy .eyebrow { color: rgba(255,255,255,.55); }
.story-copy h1 {
  font-size: 40px; line-height: 1.5; font-weight: 800; letter-spacing: 1px;
  margin: 22px 0; color: #fff;
}
.story-copy p { font-size: .9rem; line-height: 2; color: rgba(255,255,255,.7); margin-bottom: 0; }
.story-lines { display: flex; gap: 17px; margin-top: 38px; font-size: .78rem; color: rgba(255,255,255,.78); position: relative; z-index: 1; }
.story-lines span { border-top: 1px solid rgba(255,255,255,.22); padding-top: 14px; }
.story-foot { color: rgba(255,255,255,.4); font-size: .72rem; position: relative; z-index: 1; }

/* 右：登录表单（玻璃右半） */
.login-panel {
  position: relative; z-index: 10;
  flex: 1 1 50%; max-width: 480px;
  display: grid; place-items: center; padding: 48px;
  background: rgba(255,255,255,0.07);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.12); border-left: 1px solid rgba(255,255,255,0.08);
  border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
  box-shadow: 0 32px 64px rgba(0,0,0,0.30), inset 0 1px 0 rgba(255,255,255,0.08);
  animation: cardUp 0.7s cubic-bezier(0.16,1,0.3,1);
}
@keyframes cardUp { from { opacity: 0; transform: translateY(50px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }

.login-panel form { width: min(340px, 100%); }
.login-panel .eyebrow { color: rgba(255,255,255,.5); }
.login-panel h2 { font-size: 1.6rem; font-weight: 700; margin: 14px 0 8px; color: #fff; }
.login-panel .muted { color: rgba(255,255,255,.55); font-size: .85rem; margin-bottom: 6px; }
.login-panel label {
  display: block; margin: 22px 0 9px;
  font-size: .82rem; font-weight: 600; color: rgba(255,255,255,.85);
}
.login-panel input {
  width: 100%; height: 48px; padding: 12px 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  color: #fff; font-size: .95rem;
  transition: var(--transition); outline: none;
}
.login-panel input::placeholder { color: rgba(255,255,255,.35); }
.login-panel input:focus {
  background: rgba(255,255,255,0.10);
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(74,144,226,.20);
}
/* 登录按钮：同心学苑渐变 + 扫光 */
.login-panel .button.primary.full {
  margin-top: 26px; min-height: 48px;
  background: var(--primary-gradient); border-radius: var(--radius);
  font-size: 1rem; font-weight: 600;
  position: relative; overflow: hidden;
  box-shadow: 0 8px 24px rgba(102,126,234,.30);
}
.login-panel .button.primary.full::before {
  content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}
.login-panel .button.primary.full:hover::before { left: 100%; }
.login-panel .button.primary.full:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(102,126,234,.45);
}
.login-note { font-size: .72rem; color: rgba(255,255,255,.35); text-align: center; margin: 22px 0 0; line-height: 1.8; }
.error-text { font-size: .8rem; color: #FF9A8B; min-height: 20px; margin: 14px 0 0; }
.setup-hint {
  font-size: .78rem; color: #FFD79A;
  background: rgba(255,159,67,.12); border: 1px solid rgba(255,159,67,.25);
  padding: 14px; line-height: 1.8; border-radius: var(--radius); margin: 16px 0 0;
}

/* ============================ 应用外壳 ============================ */
.app { display: flex; min-height: 100vh; min-height: 100dvh; background: var(--bg); }

/* 侧栏 —— 同心学苑白色毛玻璃导航 */
.sidebar {
  width: 226px; flex-shrink: 0;
  position: fixed; inset: 0 auto 0 0; z-index: 1000;
  padding: 28px 18px;
  display: flex; flex-direction: column;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}
.sidebar .brand { font-size: 1rem; gap: 10px; color: var(--text); }
.sidebar .brand-mark { width: 36px; height: 36px; font-size: 1.1rem; border-radius: var(--radius-sm); }
.sidebar .brand-en { color: var(--text-muted); opacity: 1; font-size: .45rem; }

.sidebar-caption {
  font-size: .68rem; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text-muted); margin: 44px 10px 14px; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 11px 14px; margin-bottom: 6px;
  border-radius: var(--radius-full);
  color: var(--text-light); font-size: .82rem; font-weight: 500;
  text-align: left; transition: var(--transition);
}
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active {
  background: var(--primary); color: #fff;
  box-shadow: 0 2px 8px rgba(74,144,226,0.25);
}
.nav-item b {
  margin-left: auto; background: rgba(74,144,226,.12); color: var(--primary);
  padding: 2px 8px; border-radius: var(--radius-full); font-weight: 600; font-size: .7rem;
}
.nav-item.active b { background: rgba(255,255,255,.25); color: #fff; }
.nav-arrow { margin-left: auto; color: var(--primary); font-size: .8rem; }
.nav-item.active .nav-arrow { color: rgba(255,255,255,.85); }

.sidebar-note {
  margin-top: auto; padding: 16px 14px;
  background: var(--bg); border: 1px solid var(--border-light);
  border-radius: var(--radius); font-size: .7rem;
}
.sidebar-note strong { color: var(--text); font-size: .76rem; }
.sidebar-note p { color: var(--text-light); line-height: 1.9; margin: 8px 0 0; }
.small-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--success); margin-right: 7px;
  box-shadow: 0 0 0 3px rgba(39,174,96,.15);
  vertical-align: middle;
}
.sidebar-bottom {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border-light);
  color: var(--text-light); font-size: .74rem;
}
.sidebar-bottom .text-button:hover { color: var(--danger); }

/* 主区 */
.app main { margin-left: 226px; width: calc(100% - 226px); min-width: 0; }

.topbar {
  height: 60px;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 32px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  position: sticky; top: 0; z-index: 500;
  font-size: .76rem; color: var(--text-light);
}
.slash { padding: 0 10px; color: var(--text-muted); }
.server-pill {
  padding: 6px 14px; border-radius: var(--radius-full);
  border: 1px solid var(--border); background: var(--bg);
  color: var(--primary); font-size: .72rem; font-weight: 500;
  transition: var(--transition);
}
.server-pill::before {
  content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--success); margin-right: 7px; vertical-align: middle;
}
.server-pill.offline { color: var(--danger); background: var(--danger-light); border-color: #F8D7DA; }
.server-pill.offline::before { background: var(--danger); }

.page-content { max-width: 1490px; margin: 0 auto; padding: 32px 32px 24px; }

.page-heading {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  margin-bottom: 26px;
}
.page-heading h1 {
  font-size: 1.8rem; font-weight: 800; letter-spacing: -.3px;
  margin: 10px 0 10px; color: var(--text);
}
.page-heading p { font-size: .8rem; margin-bottom: 4px; }
.page-heading .text-link { font-weight: 600; }

/* ============================ 同步横幅 ============================ */
.sync-banner {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 22px; margin-bottom: 20px;
  background: var(--green-soft);
  border: 1px solid #DCEAFB;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.sync-banner.warning { background: var(--amber-soft); border-color: #F7E4B8; }
.sync-icon {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(74,144,226,.14); color: var(--primary);
  font-size: 1.1rem; font-weight: 700;
}
.warning .sync-icon { background: rgba(255,159,67,.18); color: var(--accent); }
.sync-copy h2 { font-size: .95rem; font-weight: 700; margin: 0 0 6px; color: var(--text); }
.sync-copy p { font-size: .76rem; color: var(--text-light); line-height: 1.8; margin: 0; }
.sync-time {
  margin-left: auto; text-align: right; min-width: 180px;
  padding-left: 20px; border-left: 1px solid var(--border);
}
.sync-time span, .sync-time small { display: block; color: var(--text-muted); font-size: .68rem; }
.sync-time strong { display: block; margin: 6px 0 4px; font-size: .82rem; font-weight: 700; color: var(--text); }

/* ============================ 指标卡 ============================ */
.metrics {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  margin-bottom: 24px;
}
.metric {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  position: relative; overflow: hidden;
}
.metric::before {
  content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 3px;
  background: var(--primary-gradient); opacity: 0; transition: var(--transition);
}
.metric:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.metric:hover::before { opacity: 1; }
.metric span { font-size: .76rem; color: var(--text-light); font-weight: 500; }
.metric strong {
  display: block; font-size: 2rem; font-weight: 800; letter-spacing: -1px;
  margin: 10px 0 8px; color: var(--text);
}
.metric small { font-size: .68rem; color: var(--text-muted); line-height: 1.7; }
.metric.attention strong { color: var(--accent); }

/* ============================ 文献库卡片 ============================ */
.library-card {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.card-heading {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 22px 24px;
}
.card-heading h2 { font-size: .95rem; font-weight: 700; margin: 0 0 7px; color: var(--text); }
.card-heading p { font-size: .74rem; color: var(--text-muted); margin: 0; }
.count-tag {
  display: inline-block; margin-left: 8px; padding: 2px 9px;
  background: rgba(74,144,226,.10); color: var(--primary);
  border-radius: var(--radius-full); font-size: .68rem; font-weight: 700;
  vertical-align: middle;
}
.source-label { font-size: .72rem; color: var(--text-muted); display: flex; align-items: center; gap: 8px; }
.source-label select {
  max-width: 190px; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card); color: var(--text-light); font-size: .74rem;
  transition: var(--transition); outline: none;
}
.source-label select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(74,144,226,.08); }

/* 工具条 */
.list-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px 16px; gap: 14px;
}
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
  padding: 8px 14px; border-radius: var(--radius-full);
  font-size: .74rem; font-weight: 500; color: var(--text-light);
  transition: var(--transition); background: transparent;
}
.tab:hover { background: var(--bg); color: var(--text); }
.tab.selected {
  background: var(--primary); color: #fff; font-weight: 600;
  box-shadow: 0 2px 8px rgba(74,144,226,.25);
}
.search {
  width: 240px; max-width: 100%; padding: 10px 14px;
  font-size: .76rem;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-full); color: var(--text);
  outline: none; transition: var(--transition);
}
.search::placeholder { color: var(--text-muted); }
.search:focus { background: var(--card); border-color: var(--primary); box-shadow: 0 0 0 3px rgba(74,144,226,.08); }

/* 表格 */
.table-wrap { overflow-x: auto; max-height: 650px; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
thead { position: sticky; top: 0; z-index: 1; background: #FAFBFD; }
th {
  text-align: left; font-size: .68rem; font-weight: 600;
  letter-spacing: .5px; color: var(--text-muted);
  padding: 12px 24px;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  background: #FAFBFD;
}
th:first-child { width: 52%; }
th:nth-child(2) { width: 16%; }
th:nth-child(3) { width: 18%; }
th:last-child { width: 14%; }
td {
  padding: 16px 24px; font-size: .76rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
tr:last-child td { border-bottom: 0; }
tr:hover td { background: #F7F9FC; }

.title-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.file-icon {
  flex-shrink: 0; width: 34px; height: 40px;
  display: grid; place-items: center;
  background: rgba(74,144,226,.08);
  border: 1px solid rgba(74,144,226,.16);
  border-radius: var(--radius-sm);
  color: var(--primary); font-size: .56rem; font-weight: 700;
}
.file-icon.note { background: rgba(39,174,96,.08); border-color: rgba(39,174,96,.18); color: var(--success); }
.title-text { min-width: 0; }
.title-button {
  display: block; max-width: 100%;
  padding: 0; background: none; text-align: left;
  color: var(--text); font-size: .78rem; font-weight: 500; line-height: 1.6;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: var(--transition);
}
.title-button:hover { color: var(--primary); text-decoration: none; }
.subtitle { display: block; margin-top: 3px; font-size: .64rem; color: var(--text-muted); }
.collection-cell {
  font-size: .72rem; color: var(--text-light);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.status { font-size: .72rem; white-space: nowrap; color: var(--text-light); }
.status::before {
  content: ''; display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: middle;
}
.status.saved { color: var(--success); }
.status.missing { color: var(--accent); }
.status.metadata { color: var(--text-muted); }
.status.bad { color: var(--danger); }

.right { text-align: right; }
.action-link { color: var(--primary); font-size: .72rem; font-weight: 600; white-space: nowrap; text-decoration: none; }
.action-link:hover { text-decoration: underline; }
.no-action { color: var(--text-muted); font-size: .72rem; }

.list-footer {
  display: flex; justify-content: space-between; gap: 14px;
  padding: 16px 24px; border-top: 1px solid var(--border-light);
  font-size: .68rem; color: var(--text-muted);
  background: #FCFDFE;
}

/* ============================ 校验卡 ============================ */
.verification-card {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  margin-bottom: 20px; padding: 20px 24px;
  background: linear-gradient(135deg, #F7F9FF 0%, #FFF8F0 100%);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.verification-card > div { display: flex; align-items: center; gap: 15px; }
.verification-symbol {
  width: 40px; height: 40px; display: grid; place-items: center; flex-shrink: 0;
  border-radius: 50%; background: rgba(102,126,234,.12);
  color: #667eea; font-size: 1.1rem;
}
.verification-card h3 { font-size: .84rem; font-weight: 700; margin: 0 0 6px; color: var(--text); }
.verification-card p { font-size: .72rem; color: var(--text-light); line-height: 1.8; margin: 0; }
.verification-card button { font-size: .78rem; min-height: 38px; flex-shrink: 0; }

.page-footer {
  display: flex; justify-content: space-between; gap: 18px;
  margin-top: 22px; font-size: .68rem; color: var(--text-muted); line-height: 1.8;
}

/* ============================ 提示 / 空态 ============================ */
.notice {
  padding: 14px 16px; border-radius: var(--radius);
  margin-bottom: 18px; font-size: .78rem;
  border: 1px solid transparent;
}
.notice.error { color: #A94442; background: var(--danger-light); border-color: #F8D7DA; }
.empty { padding: 50px 20px; text-align: center; font-size: .8rem; color: var(--text-muted); }

/* ============================ 详情弹窗 ============================ */
dialog {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 32px; max-width: 620px; width: calc(100% - 36px);
  color: var(--text); background: var(--card);
  box-shadow: var(--shadow-lg);
}
dialog::backdrop { background: rgba(22,33,62,.55); backdrop-filter: blur(4px); }
dialog h2 {
  font-size: 1.15rem; font-weight: 700; line-height: 1.6;
  margin: 12px 0 20px; overflow-wrap: anywhere;
}
.dialog-close {
  float: right; width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 50%; background: var(--bg); color: var(--text-light);
  font-size: 1.2rem; line-height: 1; transition: var(--transition);
}
.dialog-close:hover { background: var(--danger-light); color: var(--danger); }
#detail-content { font-size: .8rem; line-height: 2; overflow-wrap: anywhere; }
#detail-content a { display: block; color: var(--primary); margin: 10px 0; font-weight: 500; }
.detail-label { color: var(--text-muted); font-size: .68rem; margin-top: 14px; font-weight: 600; letter-spacing: .5px; }

/* ============================ 响应式 ============================ */
@media (min-width: 1600px) {
  .page-content { padding-top: 44px; }
  .page-heading { margin-bottom: 32px; }
  .metrics { margin-bottom: 30px; }
}

@media (max-width: 1100px) {
  .sidebar { width: 190px; padding: 24px 14px; }
  .app main { margin-left: 190px; width: calc(100% - 190px); }
  .topbar { padding: 0 22px; }
  .page-content { padding: 26px 22px; }
  .list-toolbar { flex-direction: column; align-items: flex-start; }
  .search { width: 100%; }
  th, td { padding-left: 16px; padding-right: 16px; }
  .metric { padding: 18px 16px; }
  .sync-time { min-width: 154px; padding-left: 16px; }
  .story-copy h1 { font-size: 32px; }
}

@media (max-width: 900px) {
  /* 登录页改为上下堆叠 */
  .login-screen { flex-direction: column; align-items: center; padding: 24px 16px; }
  .login-story {
    flex: 0 0 auto; width: 100%; max-width: 520px; min-height: auto;
    padding: 30px;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    border-right: 1px solid rgba(255,255,255,0.12); border-bottom: none;
  }
  .login-story::after { display: none; }
  .story-copy { padding: 26px 0 8px; }
  .story-copy h1 { font-size: 28px; line-height: 1.4; margin: 14px 0; }
  .story-copy p { font-size: .84rem; }
  .story-lines, .story-foot { display: none; }
  .login-panel {
    flex: 0 0 auto; width: 100%; max-width: 520px;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    border-left: 1px solid rgba(255,255,255,0.12); border-top: none;
    padding: 32px 28px 40px;
  }
  .login-panel h2 { font-size: 1.35rem; }
}

@media (max-width: 760px) {
  .sidebar { display: none; }
  .app main { margin-left: 0; width: 100%; }
  .topbar { height: 54px; padding: 0 16px; font-size: .7rem; }
  .page-content { padding: 22px 16px; }
  .page-heading { flex-direction: column; align-items: flex-start; gap: 12px; }
  .page-heading h1 { font-size: 1.45rem; }
  .page-heading .button { font-size: .76rem; padding: 8px 14px; min-height: 38px; }
  .metrics { grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 18px; }
  .metric { padding: 16px; }
  .metric strong { font-size: 1.7rem; margin: 8px 0 6px; }
  .sync-banner { flex-wrap: wrap; align-items: flex-start; padding: 16px; gap: 12px; }
  .sync-copy { flex: 1; }
  .sync-time {
    width: 100%; display: flex; align-items: center; gap: 10px;
    text-align: left; padding: 12px 0 0; border-left: 0; border-top: 1px solid var(--border);
  }
  .sync-time strong { font-size: .76rem; margin: 0; }
  .sync-time small { display: none; }
  .card-heading { flex-direction: column; align-items: flex-start; padding: 18px 16px; }
  .source-label { align-self: stretch; justify-content: space-between; }
  .list-toolbar { padding: 0 12px 14px; gap: 10px; }
  .tabs { width: 100%; justify-content: space-between; gap: 2px; }
  .tab { font-size: .68rem; padding: 8px 10px; }
  .search { width: 100%; }
  .table-wrap { max-height: 700px; }
  th:first-child { width: 57%; }
  th:nth-child(2), td:nth-child(2) { display: none; }
  th:nth-child(3) { width: 24%; }
  th:last-child { width: 19%; }
  th, td { padding: 13px 10px; }
  .title-cell { gap: 8px; }
  .file-icon { width: 28px; height: 34px; font-size: .5rem; }
  .title-button {
    white-space: normal; display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    line-height: 1.7; font-size: .72rem;
  }
  .subtitle { font-size: .58rem; }
  .status, .action-link { font-size: .66rem; }
  .status::before { width: 5px; height: 5px; margin-right: 4px; }
  .list-footer { padding: 14px; font-size: .62rem; }
  .text-link { font-size: .7rem; }
  .verification-card { flex-direction: column; align-items: flex-start; gap: 14px; padding: 16px; }
  .verification-card button { align-self: flex-end; }
  .page-footer { flex-direction: column; gap: 5px; }
  dialog { padding: 22px 18px; }
}

@media (max-width: 375px) {
  .login-screen { padding: 12px 10px; }
  .login-story { padding: 20px 18px; }
  .story-copy h1 { font-size: 24px; }
  .login-panel { padding: 24px 18px 30px; }
  .metrics { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .login-screen::before, .login-screen::after,
  .login-story, .login-panel { animation: none !important; }
  * { transition-duration: .01ms !important; }
}

/* ==========================================================================
   全站左侧导航（/nav/tongxin-nav.css）占位适配  —— 2026-11-21
   --------------------------------------------------------------------------
   问题：导航栏 rail 固定占视口左侧 --txn-w（76px），nav.css 用
        html.txn-on body { padding-left: var(--txn-w) } 让正文让位。
        但 .sidebar 是 position:fixed，inset:0 auto 0 0 —— 它相对**视口**定位，
        不会跟着 body 的 padding-left 走，于是左侧 76px 被 rail 压住，
        品牌名、导航项文字全部被裁掉（"我的文献" 只剩 "的文献"）。

   修法：fixed 元素自己让出 --txn-w。main 不用改，因为它本来就在 body
        内容盒内（padding-left 已生效），margin-left:226px 仍然正确。
   ========================================================================== */
html.txn-on .sidebar {
  left: var(--txn-w, 76px);
}
/* 窄屏 rail 隐藏且不再让位，sidebar 回到 0（此宽度下 .sidebar 本身已 display:none，双保险） */
@media (max-width: 680px) {
  html.txn-on .sidebar { left: 0; }
}
/* ==========================================================================
   断点补齐（2026-11-21 第二次修复）
   --------------------------------------------------------------------------
   原状：.sidebar{display:none} / .app main{margin-left:0} 只在 max-width:760px
        里；而登录页堆叠断点是 900px。于是 760–900px 是"没人管"的灰区：
        rail 66 + sidebar 190 = 256px 被占掉，内容只剩 564px，
        但 .metrics 仍按 4 列排 → 每张卡约 130px，标题与说明全部折行堆叠。
   修法：把"收起侧栏"与"指标卡改 2 列"提前到 900px，与登录页断点对齐。
   ========================================================================== */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .app main { margin-left: 0; width: 100%; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .topbar { padding: 0 16px; }
  .page-content { padding: 22px 16px; }
  .page-heading { flex-direction: column; align-items: flex-start; gap: 12px; }
  .list-toolbar { flex-direction: column; align-items: flex-start; gap: 10px; }
  .search { width: 100%; }
  .card-heading { flex-direction: column; align-items: flex-start; gap: 12px; }
  .source-label { align-self: stretch; justify-content: space-between; }
  .sync-banner { flex-wrap: wrap; align-items: flex-start; }
  .sync-time { width: 100%; border-left: 0; border-top: 1px solid var(--border); padding: 10px 0 0; text-align: left; }
}