:root {
  --color-bg: #f0f4ff;
  --color-card: #ffffff;
  --color-text: #1b2230;
  --color-muted: #6b7a90;
  --color-accent: #2a62ff;
  --color-accent-soft: #e8eeff;
  --radius-lg: 12px;
  --shadow: 0 6px 20px rgba(16, 42, 95, 0.08);
  --maxw: 640px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 15px;
  line-height: 1.55;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}

#app {
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 60vh;
}

.site-footer {
  max-width: var(--maxw);
  margin: 0 auto;
  text-align: center;
  padding: 18px 12px 8px;
  color: var(--color-muted);
  font-size: 12px;
}

.site-footer a {
  color: var(--color-muted);
  text-decoration: none;
}

.site-footer a:hover { text-decoration: underline; }

.boot-hint {
  text-align: center;
  padding: 80px 16px;
  color: var(--color-muted);
}

/* ---------- 通用容器/卡片 ---------- */
.page-pad {
  padding: 12px 12px 16px;
}

.card {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(16, 42, 95, 0.04);
}

.title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: 0.25px;
}

.subtitle {
  font-size: 12px;
  color: var(--color-muted);
  margin-bottom: 4px;
}

.muted {
  color: var(--color-muted);
  font-size: 12px;
}

/* ---------- Hero 头部 ---------- */
.hero {
  position: relative;
  margin: 0 0 10px;
  padding: 20px 16px 18px;
  border-radius: 0 0 14px 14px;
  background: linear-gradient(135deg, #2a62ff 0%, #5b8cff 45%, #7c5cff 100%);
  color: #fff;
  box-shadow: 0 8px 22px rgba(42, 98, 255, 0.28);
}

.hero-lang {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 30px;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.45);
  cursor: pointer;
}

.hero-lang:active {
  opacity: 0.82;
  background: rgba(255, 255, 255, 0.32);
}

.hero-lang-text {
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
}

.hero-lang-mini {
  top: 10px;
  right: 12px;
  width: 38px;
  height: 28px;
}

.hero-lang-mini .hero-lang-text {
  font-size: 12px;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.hero-actions .hero-lang,
.hero-actions .hero-lang-mini {
  position: static;
  top: auto;
  right: auto;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  backdrop-filter: blur(6px);
}

.hero-logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: contain;
  background: #fff;
  flex: 0 0 auto;
  padding: 3px;
  box-sizing: border-box;
}

.hero-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.hero-tagline {
  display: none;
}

.hero-cta {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
}

.hero-cta:active { opacity: 0.8; }

.hero-stats {
  display: flex;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  gap: 0;
}

.hero-stat {
  flex: 1;
  min-width: 0;
  padding: 2px 14px 2px 0;
  background: transparent;
  border: 0;
  color: inherit;
  text-align: left;
  font: inherit;
  position: relative;
}

.hero-stat--featured {
  padding: 2px 0 2px 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.22);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.hero-stat--link {
  cursor: pointer;
}

.hero-stat--link:active {
  opacity: 0.72;
}

.hero-stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.hero-stat-arrow {
  font-size: 16px;
  line-height: 1;
  opacity: 0.72;
}

.hero-stat-value {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}

.hero-stat-value--date {
  font-size: 18px;
  letter-spacing: 0.5px;
}

.hero-stat-value--score {
  font-size: 17px;
}

.hero-stat-value--dept {
  font-size: 17px;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.hero-stat-label {
  font-size: 11px;
  opacity: 0.88;
}

.hero-stat-note {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.35;
  opacity: 0.82;
}

.hero-date-select {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.home-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 12px;
  cursor: pointer;
}

.home-pick:active {
  opacity: 0.76;
}

.home-pick-rank {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  background: linear-gradient(145deg, #2a62ff, #7c5cff);
}

.home-pick-content {
  flex: 1;
  min-width: 0;
}

.home-pick-title {
  font-size: 14px;
  margin-bottom: 6px;
}

.dept-entry {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  max-width: 46%;
  padding: 4px 0;
  text-decoration: none;
  color: inherit;
}

.dept-entry:active {
  opacity: 0.7;
}

.dept-entry-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-accent);
}

.dept-entry-sub {
  margin-top: 2px;
  font-size: 11px;
  color: var(--color-muted);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.dept-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 4px;
  border-bottom: 1px solid rgba(16, 42, 95, 0.06);
  cursor: pointer;
}

.dept-row:last-child {
  border-bottom: 0;
}

.dept-label {
  font-size: 14px;
}

.dept-check {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid #c5d0e6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.dept-check--on {
  background: linear-gradient(145deg, #2a62ff, #7c5cff);
  border-color: transparent;
}

.dept-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(16, 42, 95, 0.08);
  box-shadow: 0 -8px 24px rgba(16, 42, 95, 0.08);
}

.dept-save {
  min-height: 44px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
}

.page-pad--dept {
  padding-bottom: 96px;
}

body.page-departments {
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

body.page-departments .tabbar {
  display: none !important;
}

/* ---------- Section 标题 ---------- */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.section-title {
  font-size: 15px;
  font-weight: 600;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  background: var(--color-accent-soft);
  color: #1f3fbf;
  font-weight: 500;
}

.empty-hint {
  text-align: center;
  padding: 16px 8px;
  color: var(--color-muted);
  font-size: 13px;
}

/* ---------- 日期列表行 ---------- */
.date-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 2px;
  border-bottom: 1px solid #edf0f7;
  cursor: pointer;
}

.date-row:active { opacity: 0.75; }
.date-row:last-child { border-bottom: none; }

.date-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(145deg, #e8eeff, #f3f5ff);
  color: #2a62ff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.date-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
}

.date-chevron {
  color: #a8b2c3;
  font-size: 18px;
  line-height: 1;
  padding-left: 4px;
}

/* ---------- 论文条目 ---------- */
.paper-item {
  position: relative;
  padding-left: 20px;
  overflow: hidden;
  cursor: pointer;
}

.paper-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, #2a62ff, #7c5cff);
}

.paper-item:active { opacity: 0.85; }

.paper-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #141a24;
  line-height: 1.45;
}

.paper-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border-radius: 5px;
  font-size: 11px;
  color: #3b4a63;
  background: #f3f6fc;
  border: 1px solid #e4eaf5;
}

.tag--score { color: #0f6b4a; background: #e9f7f0; border-color: #d0efe2; }
.tag--dept  { color: #1f4a8a; background: #e9f0ff; border-color: #d6e3ff; }
.tag--date  { color: #5a6478; background: #eef2f8; border-color: #dde5f0; }
.hero-recent-switch {
  margin-top: 10px;
  align-self: flex-start;
  padding: 6px 12px;
  font-size: 12px;
  color: #1f4a8a;
  background: #e9f0ff;
  border: 1px solid #d6e3ff;
  border-radius: 999px;
  cursor: pointer;
}
.tag--journal { color: #5a3a8a; background: #f3edff; border-color: #e4d6ff; max-width: 100%; }
.tag--zone  { color: #7a4a2a; background: #fff4e8; border-color: #ffe0c2; }

/* ---------- 每日列表页头 ---------- */
.daily-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.load-foot {
  text-align: center;
  padding: 8px 0 4px;
  font-size: 12px;
  color: var(--color-muted);
}

.divider {
  height: 1px;
  background: #edf0f7;
  margin: 8px 0 0;
}

/* ---------- 详情页 section ---------- */
.section-h {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #1b2230;
}

.section-h-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2a62ff;
  box-shadow: 0 0 0 4px rgba(42, 98, 255, 0.12);
}

.body-text {
  font-size: 14px;
  color: #2c3544;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: normal;
}

.body-text mark,
.hl-mark {
  background: #ffe58f;
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 15px;
  cursor: pointer;
  background: #eef1f7;
  color: #2c3544;
}

.btn:active { opacity: 0.85; }
.btn[disabled] { opacity: 0.6; cursor: default; }

.btn-block { width: 100%; }

.btn-primary { background: var(--color-accent); color: #fff; }

.btn-ghost {
  background: #fff;
  border: 1px solid #d6ddea;
  color: #2c3544;
}

.btn-sm { padding: 6px 12px; font-size: 13px; }

.btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.link-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #fff;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
}

/* ---------- 我的页 ---------- */
.profile-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2a62ff, #7c5cff);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(42, 98, 255, 0.3);
  flex-shrink: 0;
}

.profile-avatar--img {
  object-fit: contain;
  padding: 4px;
  font-size: 0;
  background: #fff;
}

.profile-text { flex: 1; }

/* ---------- 协议/隐私 ---------- */
.legal-paragraph {
  margin-top: 7px;
  color: #3b4a63;
  font-size: 13px;
  line-height: 1.65;
}

/* ---------- 底部 tabBar ---------- */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(56px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: #fff;
  border-top: 1px solid #e9edf5;
  display: flex;
  z-index: 50;
}

.tabbar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  text-decoration: none;
  color: #8891a2;
  font-size: 0;
  max-width: calc(var(--maxw) / 2);
}

.tab-item.active { color: var(--color-accent); }
.tab-ico {
  width: 26px;
  height: 26px;
  display: block;
  object-fit: contain;
}
.tab-ico--active { display: none; }
.tab-item.active .tab-ico--idle { display: none; }
.tab-item.active .tab-ico--active { display: block; }

/* 让 tabbar 内容也居中于 maxw */
@media (min-width: 641px) {
  .tabbar { justify-content: center; }
  .tab-item { flex: 0 0 auto; width: 120px; }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  top: 45%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 100;
  max-width: 80%;
  text-align: center;
}

/* ---------- 骨架加载 ---------- */
.spin {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(42, 98, 255, 0.25);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 日历弹层 ---------- */
.cal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 28, 45, 0.45);
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
}
.cal-sheet {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 16px 16px 12px 12px;
  padding: 14px 14px 18px;
  box-shadow: 0 16px 40px rgba(20, 28, 45, 0.2);
}
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.cal-title { font-weight: 700; font-size: 15px; color: #1f2a3d; }
.cal-close {
  border: none;
  background: #f1f4fb;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: #5b677a;
}
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 10px;
}
.cal-month { font-weight: 600; color: #2c3544; }
.cal-nav-btn {
  border: none;
  background: #f1f4fb;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 20px;
  cursor: pointer;
  color: #2a62ff;
}
.cal-week,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}
.cal-week { color: #8891a2; font-size: 12px; margin-bottom: 6px; }
.cal-day {
  border: none;
  background: transparent;
  height: 38px;
  border-radius: 10px;
  font-size: 14px;
  color: #c5cad6;
  cursor: default;
}
.cal-day.is-available {
  color: #2c3544;
  background: #f4f7ff;
  cursor: pointer;
  font-weight: 600;
}
.cal-day.is-available:hover { background: #e7eeff; }
.cal-day.is-selected {
  background: #2a62ff !important;
  color: #fff !important;
}
.cal-day.is-empty { visibility: hidden; }

/* ---------- 搜索 ---------- */
.hero-search-btn {
  border: none;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 0 12px;
  height: 30px;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  box-sizing: border-box;
}
.hero-search-btn svg { width: 16px; height: 16px; display: block; }
.search-box {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.search-box input {
  flex: 1;
  border: 1px solid #d9e1f2;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  outline: none;
}
.search-box input:focus { border-color: #2a62ff; box-shadow: 0 0 0 3px rgba(42, 98, 255, 0.12); }
.search-range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}
.search-range-btn {
  border: 1px solid #d9e1f2;
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
}
.search-range-btn .lbl {
  display: block;
  font-size: 11px;
  color: #8891a2;
  margin-bottom: 2px;
}
.search-range-btn .val {
  font-size: 14px;
  font-weight: 600;
  color: #2c3544;
}
.hero-date-select { display: none !important; }

.paper-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.paper-card-head .subtitle { margin-bottom: 0; }
.fav-star {
  border: none;
  background: transparent;
  color: #c5ccd8;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  flex: 0 0 auto;
}
.fav-star::before { content: "☆"; }
.fav-star.is-on { color: #f5a623; }
.fav-star.is-on::before { content: "★"; }
.fav-star:active { transform: scale(0.92); }

.auth-form { margin-top: 4px; }
.auth-label {
  display: block;
  font-size: 12px;
  color: var(--color-muted);
  margin: 8px 0 4px;
}
.auth-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d9e1f2;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  outline: none;
  background: #fff;
}
.auth-input:focus {
  border-color: #2a62ff;
  box-shadow: 0 0 0 3px rgba(42, 98, 255, 0.12);
}
.auth-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}
.auth-actions .btn { flex: 1; }
.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 10px;
  color: #9aa6b8;
  font-size: 12px;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e5ebf5;
}
.btn-google {
  background: #fff;
  color: #1b2230;
  border: 1px solid #d9e1f2;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}
.btn-google:active { background: #f5f7fb; }
.btn-link {
  display: inline-block;
  margin-top: 10px;
  border: none;
  background: transparent;
  color: #2a62ff;
  font-size: 13px;
  padding: 0;
  cursor: pointer;
}
.google-btn-mount {
  width: 100%;
  min-height: 44px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 8px;
}
.google-btn-mount > div {
  width: auto !important;
  margin: 0 auto;
}
