:root {
  --red: #c8102e;
  --red-dark: #9e1b32;
  --red-soft: #fdecef;
  --ink: #111827;
  --ink-2: #344054;
  --muted: #667085;
  --muted-2: #98a2b3;
  --bg: #f4f5f7;
  --card: #ffffff;
  --line: #eceef2;
  --green: #12b76a;
  --amber: #f79009;
  --blue: #2563eb;
  --radius: 18px;
  --shadow: 0 8px 24px rgba(16, 24, 40, 0.06);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #e9ebef;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--red); text-decoration: none; }
.hidden { display: none !important; }
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.app {
  position: relative;
  max-width: 480px;
  height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  overflow: hidden;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.12);
}

.screen { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg); }

/* ---------- 开屏 ---------- */
.splash {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(24px + var(--safe-top)) 24px calc(24px + var(--safe-bottom));
  color: #fff;
  background: radial-gradient(120% 120% at 50% 0%, #ff3b4e 0%, #e91939 52%, #a3122b 100%);
  transition: opacity .38s ease;
}
.splash.out { opacity: 0; pointer-events: none; }
.splash-inner { text-align: center; transform: translateY(-3vh); }
.splash-mark { width: 76px; height: 76px; margin: 0 auto 20px; }
.splash-mark svg { width: 76px; height: 76px; display: block; }
.splash-inner h1 { margin: 0; font-size: 32px; font-weight: 700; letter-spacing: .03em; }
.splash-inner p { margin: 9px 0 0; font-size: 13px; color: rgba(255, 255, 255, .78); letter-spacing: .04em; }
.splash-bar {
  width: 116px; height: 3px; margin: 26px auto 0; border-radius: 999px;
  background: rgba(255, 255, 255, .22); overflow: hidden;
}
.splash-bar i {
  display: block; width: 42%; height: 100%; border-radius: inherit; background: #fff;
  animation: splash-slide 1.15s ease-in-out infinite;
}
@keyframes splash-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(340%); }
}
.splash-foot {
  position: absolute; left: 0; right: 0; bottom: calc(28px + var(--safe-bottom));
  margin: 0; text-align: center; font-size: 11.5px; letter-spacing: .08em;
  color: rgba(255, 255, 255, .5);
}
@media (prefers-reduced-motion: reduce) {
  .splash-bar i { animation-duration: 2.6s; }
}

/* ---------- 通用按钮 / 表单 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 18px; border-radius: 14px;
  font-size: 15px; font-weight: 600; letter-spacing: .01em;
  transition: transform .12s ease, filter .12s ease, background .12s ease;
}
.btn:active { transform: scale(.985); }
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 8px 18px rgba(200, 16, 46, .22); }
.btn-primary:active { background: var(--red-dark); }
.btn-secondary { background: var(--red-soft); color: var(--red); }
.btn-secondary:active { background: #fbdce2; }
.btn-ghost { color: var(--muted); background: transparent; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn .spinner { width: 16px; height: 16px; border-width: 2px; }

.field {
  width: 100%; border: 1px solid var(--line); background: #fafbfc;
  border-radius: 13px; padding: 12px 14px; font-size: 15px; color: var(--ink);
  outline: none; transition: border-color .15s, background .15s;
  -webkit-appearance: none; appearance: none;
}
.field::placeholder { color: var(--muted-2); }
.field:focus { border-color: rgba(200, 16, 46, .45); background: #fff; }
.field-suffix { display: flex; align-items: stretch; }
.field-suffix .field { border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: 0; }
.field-suffix .suffix { display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--line); border-left: 0; border-radius: 0 13px 13px 0; background: #f2f4f7; color: var(--muted); font-size: 13px; white-space: nowrap; user-select: none; }
.field-suffix:focus-within .suffix { border-color: rgba(200, 16, 46, .45); }
textarea.field { resize: vertical; min-height: 84px; line-height: 1.55; }
select.field { height: 46px; }

.label { display: block; margin: 15px 0 7px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.label:first-of-type { margin-top: 10px; }
.hint { margin: 8px 0 14px; font-size: 12px; color: var(--muted-2); line-height: 1.55; }
.pill { font-size: 11px; font-weight: 600; color: var(--muted); background: #f2f4f7; border-radius: 999px; padding: 3px 9px; }
.footnote { text-align: center; font-size: 12px; color: var(--muted-2); margin: 18px 0 26px; }
.server-hint { text-align: center; font-size: 11.5px; color: var(--muted-2); margin: 2px 0 6px; word-break: break-all; line-height: 1.5; }

/* ---------- 品牌 ---------- */
.brand-mark {
  width: 58px; height: 58px; flex: 0 0 auto;
  border-radius: 17px;
  background: linear-gradient(145deg, #ff3b4e, #b3132c);
  display: grid; place-items: center;
  box-shadow: 0 10px 24px rgba(158, 27, 50, .28);
}
.brand-mark svg { width: 32px; height: 32px; }
.brand-mark.small { width: 48px; height: 48px; border-radius: 14px; margin: 0 auto 14px; }
.brand-mark.small svg { width: 26px; height: 26px; }

/* ---------- 登录 ---------- */
.login-screen { display: block; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.login-hero {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 16px;
  padding: calc(34px + var(--safe-top)) 24px 30px;
  color: #fff;
  background: radial-gradient(120% 130% at 10% 0%, #ff3b4e 0%, #e91939 45%, #a3122b 100%);
}
.login-hero::after {
  content: ""; position: absolute; right: -60px; top: -70px; width: 190px; height: 190px;
  border-radius: 50%; border: 34px solid rgba(255, 255, 255, .08);
}
.login-hero h1 { margin: 0 0 3px; font-size: 26px; letter-spacing: .02em; }
.login-hero p { margin: 0; font-size: 13px; opacity: .82; }
.login-back {
  position: absolute; right: 18px; top: calc(18px + var(--safe-top));
  z-index: 2; color: #fff; font-size: 12px; font-weight: 600;
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .25);
  padding: 6px 12px; border-radius: 999px;
}
.login-body { padding: 18px 16px 10px; }
.login-body .card { margin-bottom: 14px; }
.notice {
  display: flex; gap: 10px; align-items: flex-start;
  background: #fff8e6; border: 1px solid #fdecb6; color: #7a5b13;
  border-radius: 14px; padding: 12px 14px; font-size: 12.5px; line-height: 1.55;
  margin-bottom: 14px;
}
.notice .ico { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; color: #b7791f; }
.notice strong { color: #6b4d09; }

.card {
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  padding: 18px;
}
.form-card { padding: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-head h3 { margin: 0; font-size: 16px; }
.dot-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted-2); }
.dot-label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #d0d5dd; }
.dot-label.on { color: var(--green); }
.dot-label.on::before { background: var(--green); box-shadow: 0 0 0 3px rgba(18, 183, 106, .14); }

.help { margin: 4px 0 14px; font-size: 12.5px; color: var(--muted); }
.help summary { cursor: pointer; color: var(--red); font-weight: 600; padding: 4px 0; list-style: none; }
.help summary::-webkit-details-marker { display: none; }
.help summary::before { content: "＋ "; }
.help[open] summary::before { content: "－ "; }
.help ol { margin: 8px 0 0; padding-left: 18px; line-height: 1.7; }

/* ---------- 锁屏 ---------- */
.lock-screen { background: radial-gradient(120% 120% at 50% 0%, #fff 0%, #f4f5f7 60%); }
.lock-box { margin: auto; width: 100%; max-width: 320px; padding: 24px; text-align: center; }
.lock-box h2 { margin: 0 0 6px; font-size: 20px; }
.lock-box p { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.lock-box .field { text-align: center; letter-spacing: .35em; font-size: 18px; margin-bottom: 14px; }
.lock-error { color: var(--red) !important; min-height: 18px; margin-top: 12px !important; font-size: 12.5px !important; }

/* ---------- 主界面骨架 ---------- */
.app-shell { background: var(--bg); }
.topbar {
  position: relative; z-index: 20; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + var(--safe-top)) 16px 10px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(16, 24, 40, .05);
}
.topbar-left { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.topbar-titles { min-width: 0; }
.topbar-titles h1 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-titles p { margin: 1px 0 0; font-size: 11.5px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center; color: var(--ink-2);
  transition: background .15s;
}
.icon-btn:active { background: #eef0f3; }
.back-btn { margin-left: -8px; }

/* ---------- 新版本提示条 ---------- */
.update-banner {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px 9px 14px;
  background: #fff4f5; border-bottom: 1px solid rgba(200, 16, 46, .14);
  color: var(--red); font-size: 12.5px; font-weight: 600;
  cursor: pointer; flex: 0 0 auto;
}
.update-banner.hidden { display: none; }
.update-banner-dot {
  width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%;
  background: var(--red); box-shadow: 0 0 0 3px rgba(200, 16, 46, .14);
}
.update-banner-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.update-banner-go { color: var(--red); font-weight: 700; opacity: .8; }
.update-banner-close {
  display: grid; place-items: center; margin-left: 2px;
  width: 26px; height: 26px; margin-right: -4px;
  border-radius: 8px; color: var(--muted); font-weight: 500; font-size: 16px;
}
.update-banner-close:active { background: rgba(16, 24, 40, .06); }

/* ---------- 下拉刷新 ---------- */
.ptr {
  position: fixed; left: 50%; top: calc(52px + var(--safe-top)); z-index: 60;
  transform: translate(-50%, 0); opacity: 0;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line);
  box-shadow: 0 8px 22px rgba(9, 11, 16, .14);
  color: var(--muted); font-size: 12px; font-weight: 600;
  pointer-events: none; white-space: nowrap;
}
.ptr .spinner { width: 15px; height: 15px; border-width: 2px; border-color: rgba(200, 16, 46, .22); border-top-color: var(--red); }
.ptr.ready { color: var(--red); border-color: rgba(200, 16, 46, .35); }
.ptr.ready .spinner { border-top-color: var(--red); }

/* 组件页下拉：没有可刷新的内容 */
.ptr-nothing {
  position: fixed; left: 50%; z-index: 60;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none; opacity: 0;
}
.ptr-nothing.on { opacity: 1; animation: nothing-pop .24s cubic-bezier(.2, .8, .3, 1); }
.ptr-nothing img { width: 86px; height: 90px; object-fit: contain; display: block; border-radius: 14px; box-shadow: 0 10px 26px rgba(9, 11, 16, .18); }
.ptr-nothing span {
  font-size: 12.5px; font-weight: 650; color: var(--muted);
  background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 14px; white-space: nowrap;
  box-shadow: 0 8px 22px rgba(9, 11, 16, .14);
}
@keyframes nothing-pop {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.88); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ---------- 邮件搜索 ---------- */
.mail-search-box { position: relative; margin-bottom: 12px; }
.mail-search-ico {
  position: absolute; left: 13px; top: 50%; width: 17px; height: 17px;
  transform: translateY(-50%); color: var(--muted-2); pointer-events: none;
}
.mail-search-box .field { padding-left: 38px; height: 46px; }
.mail-search-status { font-size: 12.5px; color: var(--muted-2); padding: 2px 2px 12px; line-height: 1.5; }
.mail-search-results .mail-list { box-shadow: none; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #e11d3c, #9e1b32);
  color: #fff; font-size: 14px; font-weight: 700;
  box-shadow: 0 4px 10px rgba(158, 27, 50, .25);
}

.content { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; padding-bottom: calc(96px + var(--safe-bottom)); }
.view { padding: 16px; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 7px 4px calc(7px + var(--safe-bottom));
  background: #ffffff;
  border-top: 1px solid rgba(16, 24, 40, .06);
}
.tab {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 0; color: var(--muted-2); font-size: 10.5px; font-weight: 600;
  border-radius: 12px; transition: color .15s;
}
.tab .ico { width: 22px; height: 22px; }
.tab.active { color: var(--red); }
.tab.active .ico { stroke-width: 2.1; }
.tab-badge {
  position: absolute; top: 3px; left: 50%; margin-left: 4px;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--red); color: #fff; font-size: 10px; font-style: normal; font-weight: 700;
  display: grid; place-items: center; border: 2px solid #fff;
}

.fab-wrap { position: absolute; right: 18px; bottom: calc(84px + var(--safe-bottom)); z-index: 25; }
.fab {
  width: 54px; height: 54px; border-radius: 18px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(145deg, #e11d3c, #b0102a);
  box-shadow: 0 12px 24px rgba(200, 16, 46, .32);
  transition: transform .15s;
}
.fab:active { transform: scale(.94); }
.fab .ico { width: 24px; height: 24px; }

/* ---------- 首页 ---------- */
.hero {
  position: relative; overflow: hidden;
  border-radius: 24px; padding: 20px;
  color: #fff;
  background: radial-gradient(120% 150% at 0% 0%, #e01e3d 0%, #c8102e 50%, #94162b 100%);
  box-shadow: 0 14px 30px rgba(158, 27, 50, .22);
}
.hero::before { content: ""; position: absolute; right: -46px; top: -58px; width: 150px; height: 150px; border-radius: 50%; background: rgba(255, 255, 255, .09); }
.hero::after { content: ""; position: absolute; right: 24px; bottom: -70px; width: 120px; height: 120px; border-radius: 50%; border: 22px solid rgba(255, 255, 255, .07); }
.hero-greeting { font-size: 13px; opacity: .82; margin: 0 0 2px; }
.hero-name { margin: 0; font-size: 24px; letter-spacing: .01em; font-weight: 700; }
.hero-date { margin: 4px 0 0; font-size: 12px; opacity: .72; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 22px; position: relative; z-index: 1; }
.hero-stat { background: rgba(255, 255, 255, .13); border: 1px solid rgba(255, 255, 255, .14); border-radius: 14px; padding: 10px 8px; text-align: center; backdrop-filter: blur(4px); font: inherit; color: inherit; cursor: pointer; -webkit-appearance: none; appearance: none; transition: transform .12s, background .12s; }
.hero-stat:active { transform: scale(.97); background: rgba(255, 255, 255, .2); }
.hero-stat b { display: block; font-size: 21px; line-height: 1.1; letter-spacing: .02em; }
.hero-stat span { font-size: 10.5px; opacity: .78; }

.section { margin-top: 22px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; padding: 0 2px; }
.section-head h2 { margin: 0; font-size: 16px; letter-spacing: .01em; }
.section-head button { font-size: 12px; color: var(--muted); font-weight: 600; }
.section-head button:active { color: var(--red); }

.timeline { display: flex; flex-direction: column; gap: 10px; }
.due-card {
  display: flex; gap: 13px; align-items: stretch;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 13px 14px; box-shadow: var(--shadow);
  transition: transform .12s;
}
.due-card:active { transform: scale(.992); }
.due-date {
  flex: 0 0 auto; width: 46px; border-radius: 11px; background: #f5f6f8;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 6px 0; color: var(--ink-2);
}
.due-date b { font-size: 18px; line-height: 1.05; }
.due-date span { font-size: 10px; color: var(--muted-2); }
.due-date.urgent { background: var(--red-soft); color: var(--red); }
.due-date.urgent span { color: rgba(200, 16, 46, .65); }
.due-main { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.due-title { font-size: 14.5px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.due-meta { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted-2); min-width: 0; }
.due-meta .course-dot { width: 6px; height: 6px; border-radius: 50%; flex: 0 0 auto; }
.due-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.due-right { flex: 0 0 auto; display: flex; align-items: center; }
.badge-due { font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 8px; background: #f2f4f7; color: var(--muted); white-space: nowrap; }
.badge-due.urgent { background: var(--red-soft); color: var(--red); }
.badge-due.overdue { background: #fef3f2; color: #d92d20; }

/* ---------- 组件 ---------- */
.widgets-section { margin-top: 0; }
.widget-grid { display: flex; flex-direction: column; gap: 10px; }
.widget-card {
  display: flex; align-items: center; gap: 13px; width: 100%;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 13px 14px; box-shadow: var(--shadow); text-align: left;
  transition: transform .12s;
}
.widget-card:active { transform: scale(.992); }
.widget-icon {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 13px;
  display: grid; place-items: center; color: var(--red); background: var(--red-soft);
}
.widget-icon .ico { width: 24px; height: 24px; stroke-width: 1.8; }
.widget-icon.maa { color: #1f8a70; background: #e9f7f2; }
.widget-icon.silent { color: #5b6472; background: #f1f3f6; }
.widget-card.active {
  border-color: rgba(200, 16, 46, .45);
  background: linear-gradient(0deg, rgba(200, 16, 46, .07), rgba(200, 16, 46, .07)), var(--card);
  box-shadow: 0 8px 20px rgba(200, 16, 46, .16);
}
.widget-card.active .widget-icon.silent { color: #fff; background: var(--red); }
.widget-card.active .widget-text b { color: var(--red); }
.widget-flag {
  flex: 0 0 auto; font-size: 11px; font-weight: 700; letter-spacing: .02em;
  color: var(--red); background: var(--red-soft); border-radius: 999px; padding: 4px 9px;
}
.widget-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.widget-text b { font-size: 14.5px; font-weight: 650; }
.widget-text span { font-size: 11.5px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.widget-card .feishu-chevron { flex: 0 0 auto; width: 18px; height: 18px; color: var(--muted-2); }
.widget-soon {
  border: 1px dashed #dfe3ea; border-radius: 16px;
  padding: 16px; text-align: center; color: var(--muted-2); font-size: 12px;
  background: rgba(255, 255, 255, .55);
}

.mail-preview { display: flex; flex-direction: column; gap: 0; background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.mail-preview .mail-row { border-bottom: 1px solid var(--line); }
.mail-preview .mail-row:last-child { border-bottom: 0; }

.ann-mini { display: flex; flex-direction: column; gap: 10px; }
.ann-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px 15px; box-shadow: var(--shadow);
}
.ann-card.clickable { cursor: pointer; transition: transform .12s; }
.ann-card.clickable:active { transform: scale(.992); background: #fbfbfc; }
.ann-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.ann-course { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--muted); }
.ann-course i { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.ann-time { font-size: 11px; color: var(--muted-2); white-space: nowrap; }
.ann-title { font-size: 14.5px; font-weight: 650; margin: 0 0 4px; }
.ann-body { font-size: 13px; color: var(--muted); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ann-body p { margin: 0; }
.ann-body.expanded { -webkit-line-clamp: unset; display: block; }

/* ---------- 邮件 ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; padding: 8px 14px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line); color: var(--muted);
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.chip.active { background: var(--red); color: #fff; border-color: var(--red); box-shadow: 0 2px 8px rgba(200, 16, 46, .22); }
.chip .n { font-size: 10.5px; background: var(--red); color: #fff; border-radius: 999px; padding: 1px 6px; margin-left: 4px; }

.mail-list { background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.mail-row {
  display: flex; gap: 12px; align-items: center;
  padding: 13px 14px; border-bottom: 1px solid var(--line);
  transition: background .12s;
}
.mail-row:last-child { border-bottom: 0; }
.mail-row:active { background: #f8f9fb; }
.mail-row.unread { background: linear-gradient(90deg, rgba(200, 16, 46, .035), transparent 55%); }
.mail-avatar {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 13px;
  display: grid; place-items: center; font-size: 15px; font-weight: 700;
  color: #fff; background: linear-gradient(145deg, #e11d3c, #9e1b32);
}
.mail-avatar.c1 { background: linear-gradient(145deg, #3b82f6, #1d4ed8); }
.mail-avatar.c2 { background: linear-gradient(145deg, #10b981, #047857); }
.mail-avatar.c3 { background: linear-gradient(145deg, #8b5cf6, #6d28d9); }
.mail-avatar.c4 { background: linear-gradient(145deg, #f59e0b, #b45309); }
.mail-main { flex: 1; min-width: 0; }
.mail-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.mail-from { font-size: 13px; font-weight: 600; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-row.unread .mail-from { color: var(--ink); font-weight: 700; }
.mail-time { flex: 0 0 auto; font-size: 11px; color: var(--muted-2); }
.mail-subject { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 14px; line-height: 1.35; }
.mail-subject span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-row.unread .mail-subject { font-weight: 650; }
.mail-preview-text { font-size: 12px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.unread-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.attach-ico { flex: 0 0 auto; width: 14px; height: 14px; color: var(--muted-2); }

.load-more { margin: 14px 0 4px; }

/* ---------- 详情 ---------- */
.detail-head { margin-bottom: 16px; }
.detail-subject { margin: 0 0 12px; font-size: 20px; line-height: 1.35; letter-spacing: .01em; }
.detail-meta { display: flex; gap: 11px; align-items: center; }
.detail-meta .mail-avatar { width: 42px; height: 42px; }
.detail-meta-main { min-width: 0; flex: 1; }
.detail-from { font-size: 14px; font-weight: 650; }
.detail-sub { font-size: 12px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); }
/* 邮件正文来自第三方 HTML，常见固定宽度表格 / nowrap，统一压回屏幕内 */
.mail-body {
  font-size: 14.5px; line-height: 1.75; color: var(--ink-2);
  max-width: 100%; overflow-x: auto;
  overflow-wrap: anywhere; word-break: break-word;
}
.mail-body * { max-width: 100% !important; box-sizing: border-box; }
.mail-body img { max-width: 100% !important; height: auto !important; border-radius: 8px; }
.mail-body table { width: 100% !important; max-width: 100% !important; table-layout: fixed !important; border-collapse: collapse; }
.mail-body td, .mail-body th { padding: 4px 6px; }
.mail-body p, .mail-body div, .mail-body span, .mail-body font,
.mail-body td, .mail-body th, .mail-body a, .mail-body li {
  white-space: normal !important;
  overflow-wrap: anywhere;
}
.mail-body div { min-width: 0 !important; }
.mail-body pre, .mail-body pre *, .mail-plain { white-space: pre-wrap !important; word-break: break-word; font-family: inherit; margin: 0; }
.mail-body blockquote { margin: 10px 0; padding: 8px 12px; border-left: 3px solid var(--line); color: var(--muted); }
.mail-body a { word-break: break-all; }
.attachments { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.attachment { display: flex; gap: 10px; align-items: center; background: #f7f8fa; border-radius: 12px; padding: 10px 12px; }
.attachment .ico { width: 18px; height: 18px; color: var(--muted); flex: 0 0 auto; }
.attachment div { min-width: 0; }
.attachment b { display: block; font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment span { font-size: 11px; color: var(--muted-2); }
.detail-actions { display: flex; gap: 10px; margin-top: 16px; }
.detail-actions .btn { flex: 1; height: 44px; border-radius: 13px; }
.ann-detail-meta { flex-wrap: wrap; row-gap: 4px; }
.ann-detail-meta .ann-course { font-size: 12.5px; }
.ann-detail-meta .ann-time { font-size: 12px; }
.detail-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.detail-facts > div { background: #f7f8fa; border-radius: 12px; padding: 10px 12px; min-width: 0; }
.detail-facts span { display: block; font-size: 10.5px; color: var(--muted-2); margin-bottom: 3px; }
.detail-facts b { display: block; font-size: 12.5px; font-weight: 650; color: var(--ink); line-height: 1.35; }
.detail-facts b.urgent, .detail-facts b.overdue { color: var(--red); }

/* ---------- Canvas ---------- */
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: #e9ebef; border-radius: 14px; margin-bottom: 16px; }
.seg { padding: 8px 4px; border-radius: 11px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.seg.active { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(16, 24, 40, .08); }
.seg .n { font-size: 10px; color: var(--red); margin-left: 2px; }

.todo-list { display: flex; flex-direction: column; gap: 10px; }
.todo-item {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px 15px 14px 18px; box-shadow: var(--shadow); overflow: hidden;
}
.todo-item::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3.5px; border-radius: 4px; background: var(--course-color, var(--red)); }
.todo-item.clickable { cursor: pointer; transition: transform .12s; }
.todo-item.clickable:active { transform: scale(.992); }
.todo-title { font-size: 14.5px; font-weight: 650; line-height: 1.4; margin-bottom: 5px; }
.todo-meta { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted-2); flex-wrap: wrap; }
.todo-meta .course { color: var(--muted); font-weight: 600; }
.todo-right { position: absolute; right: 14px; top: 14px; }
.todo-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 9px; }
.status-chip { font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 7px; background: #f2f4f7; color: var(--muted); }
.status-chip.done { background: #ecfdf3; color: #067647; }
.status-chip.warn { background: #fffaeb; color: #b54708; }
.todo-tags { display: flex; gap: 6px; }

.course-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.course-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 15px; box-shadow: var(--shadow); min-height: 118px; display: flex; flex-direction: column; justify-content: space-between; transition: transform .12s; }
.course-card:active { transform: scale(.98); }
.course-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-size: 14px; font-weight: 700; margin-bottom: 12px; }
.course-name { font-size: 13.5px; font-weight: 650; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.course-code { font-size: 11px; color: var(--muted-2); margin-top: 3px; }

.conv-row { display: flex; gap: 12px; align-items: center; padding: 14px; background: var(--card); border-bottom: 1px solid var(--line); }
.conv-row:last-child { border-bottom: 0; }
.conv-list { background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.conv-avatar { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #eef2ff; color: #4f46e5; font-weight: 700; font-size: 14px; }
.conv-main { flex: 1; min-width: 0; }
.conv-subject { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-last { font-size: 12px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.conv-side { flex: 0 0 auto; text-align: right; }
.conv-time { font-size: 10.5px; color: var(--muted-2); }
.conv-unread { display: inline-block; margin-top: 5px; min-width: 17px; height: 17px; line-height: 17px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; }

.bubble-list { display: flex; flex-direction: column; gap: 12px; }
.bubble { max-width: 86%; padding: 11px 14px; border-radius: 16px; background: #fff; border: 1px solid var(--line); font-size: 13.5px; line-height: 1.6; box-shadow: var(--shadow); }
.bubble.me { align-self: flex-end; background: var(--red); border-color: var(--red); color: #fff; border-bottom-right-radius: 5px; }
.bubble:not(.me) { border-bottom-left-radius: 5px; }
.bubble .who { font-size: 10.5px; opacity: .68; margin-bottom: 4px; }
.bubble p { margin: 0 0 6px; }
.bubble p:last-child { margin: 0; }

/* ---------- 飞书 ---------- */
.segmented.two { grid-template-columns: repeat(2, 1fr); }
.feishu-account {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; margin-bottom: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
}
.feishu-account-main { flex: 1; min-width: 0; }
.feishu-account-main b { display: block; font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feishu-account-main span { display: block; font-size: 11px; color: var(--muted-2); margin-top: 2px; }
.feishu-auth-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 30px 22px; text-align: center; box-shadow: var(--shadow);
}
.feishu-logo {
  width: 58px; height: 58px; margin: 0 auto 14px; border-radius: 18px;
  display: grid; place-items: center; color: var(--ink-2);
  background: #fff; border: 1px solid var(--line);
  box-shadow: 0 8px 20px rgba(17, 24, 39, .08);
}
.feishu-logo .ico { width: 34px; height: 34px; }
.feishu-beta {
  margin: 0 0 12px; padding: 10px 12px; border-radius: 12px;
  background: #fff; border: 1px solid var(--line); color: var(--muted);
  font-size: 12px; line-height: 1.5;
}
.feishu-auth-card h2 { margin: 0 0 8px; font-size: 18px; }
.feishu-auth-card p { margin: 0 0 10px; font-size: 13px; color: var(--muted); line-height: 1.65; }
.feishu-auth-card .btn { margin-top: 8px; }
.feishu-wait { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; font-size: 12px; color: var(--muted-2); }
.feishu-alert {
  margin: 10px 0; padding: 10px 12px; border-radius: 10px;
  background: #fffaeb; color: #b54708; font-size: 12px; line-height: 1.5; text-align: left;
}
.conv-row { cursor: pointer; }
.conv-row:active { background: #f8f9fb; }
.conv-avatar.feishu { background: #e8f0ff; color: #2f6bff; border-radius: 13px; }
.feishu-chevron { width: 16px; height: 16px; color: var(--muted-2); }
.feishu-media-note { font-size: 11px; color: var(--muted-2); margin-top: 6px; }
.bubble .msg-content a { color: inherit; text-decoration: underline; }
.msg-chip {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  background: rgba(16, 24, 40, .07); font-size: 12px; font-weight: 600;
}
.bubble.me .msg-chip { background: rgba(255, 255, 255, .22); }
.msg-muted { color: var(--muted-2); font-size: 12.5px; }
.msg-post-title { font-weight: 700; margin-bottom: 4px; }
.msg-post-line { min-height: 1.2em; }
.msg-post-line code { font-size: 12px; background: rgba(16, 24, 40, .06); padding: 1px 4px; border-radius: 4px; }
a.todo-item { display: block; text-decoration: none; color: inherit; }
.feishu-task-due { display: flex; align-items: center; gap: 8px; margin-top: 9px; font-size: 11.5px; color: var(--muted-2); }

/* ---------- 滴答清单 ---------- */
.widget-icon.dida { color: #4772fa; background: #eef2ff; }
.dida-logo { color: #4772fa; }
.dida-toolbar { display: flex; align-items: stretch; gap: 8px; margin-bottom: 16px; }
.dida-toolbar .segmented { flex: 1; margin-bottom: 0; }
.dida-add {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: center; gap: 4px;
  padding: 0 13px; border-radius: 14px; background: var(--red); color: #fff;
  font-size: 12.5px; font-weight: 650; box-shadow: 0 6px 14px rgba(200, 16, 46, .22);
  transition: transform .12s;
}
.dida-add:active { transform: scale(.97); }
.dida-add[disabled] { opacity: .45; box-shadow: none; }
.dida-add[disabled]:active { transform: none; }
.dida-add .ico { width: 16px; height: 16px; stroke-width: 2.4; }
.dida-task { display: flex; align-items: flex-start; gap: 11px; cursor: pointer; }
.dida-task:active { background: #f8f9fb; }
.dida-task-main { flex: 1; min-width: 0; }
.dida-task .todo-title { margin-bottom: 6px; }
.dida-task .todo-meta { row-gap: 5px; }
.dida-desc {
  margin-top: 7px; font-size: 12px; color: var(--muted-2); line-height: 1.55;
  white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.dida-check {
  flex: 0 0 auto; width: 30px; height: 30px; margin-top: 1px; padding: 0;
  border-radius: 50%; border: 1.6px solid #d5dae3; background: #fff; color: #c7ccd6;
  display: grid; place-items: center; transition: border-color .15s, background .15s, color .15s;
}
.dida-check .ico { width: 17px; height: 17px; stroke-width: 2.6; }
.dida-check:active, .dida-check.busy { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.dida-check .spinner { width: 14px; height: 14px; border-width: 2px; }
.dida-pin {
  flex: 0 0 auto; margin-top: 1px; padding: 5px 9px; border-radius: 9px;
  border: 1px solid var(--line); background: transparent; color: var(--muted-2);
  font-size: 11px; font-weight: 650; line-height: 1.2; transition: border-color .15s, background .15s, color .15s;
}
.dida-pin:active { transform: scale(.97); }
.dida-pin.on { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.dida-flag { font-size: 10.5px; font-weight: 700; padding: 3px 7px; border-radius: 7px; background: #f2f4f7; color: var(--muted); }
.dida-flag.high { background: #fef3f2; color: #d92d20; }
.dida-flag.mid { background: #fffaeb; color: #b54708; }
.dida-flag.allDay { background: #eef2ff; color: #4772fa; }

/* ---------- 设置 ---------- */
.set-section { margin-bottom: 20px; }
.set-section > h3 { margin: 0 0 8px 4px; font-size: 12px; font-weight: 700; color: var(--muted-2); letter-spacing: .06em; text-transform: uppercase; }
.set-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.set-card + .set-card { margin-top: 12px; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row .ico { width: 20px; height: 20px; color: var(--muted); flex: 0 0 auto; }
.set-main { flex: 1; min-width: 0; }
.set-label { font-size: 14px; font-weight: 550; }
.set-value { font-size: 11.5px; color: var(--muted-2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-action { flex: 0 0 auto; font-size: 12px; font-weight: 600; color: var(--red); padding: 6px 2px; }
.set-action.muted { color: var(--muted); }
.status-badge { font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 999px; background: #f2f4f7; color: var(--muted); }
.status-badge.on { background: #ecfdf3; color: #067647; }
.theme-row { border-bottom: 0; padding-bottom: 10px; }
.theme-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 0 16px 14px; }
.theme-opt {
  height: 36px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--bg); color: var(--muted);
  font-size: 12.5px; font-weight: 600;
  transition: background .15s, color .15s, border-color .15s;
}
.theme-opt.active {
  background: var(--card); color: var(--red); border-color: rgba(200, 16, 46, .38);
  box-shadow: var(--shadow);
}
.about-text { font-size: 12.5px; color: var(--muted); line-height: 1.75; padding: 14px 16px; }
.about-text strong { color: var(--ink-2); }
.about-text p { margin: 10px 0 0; }
.about-text p:first-of-type { margin-top: 6px; }

/* ---------- 账号 / 成员 ---------- */
.account-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px; border-bottom: 1px solid var(--line);
}
.account-avatar { width: 44px; height: 44px; font-size: 17px; flex: 0 0 auto; }
.account-main { flex: 1; min-width: 0; }
.account-name { font-size: 15px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-sub { font-size: 11.5px; color: var(--muted-2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invite-box {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  margin: 12px 16px; padding: 16px; border-radius: 14px;
  background: #fff8e6; border: 1px dashed #f0d08a; text-align: center;
}
.invite-code { font-size: 22px; font-weight: 800; letter-spacing: .08em; color: #7a4d00; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.invite-meta { font-size: 11.5px; color: #8a6a2a; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 10px; }
.member-list { border-top: 0; }
.member-row { display: flex; align-items: center; gap: 11px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.member-row:last-child { border-bottom: 0; }
.member-avatar { width: 34px; height: 34px; font-size: 13px; flex: 0 0 auto; }
.member-main { flex: 1; min-width: 0; }
.member-name { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.member-sub { font-size: 11px; color: var(--muted-2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-tag { font-size: 10px; font-weight: 600; color: var(--red); background: var(--red-soft); padding: 2px 7px; border-radius: 999px; }

/* ---------- 邀请码 ---------- */
.invite-panel { border-top: 1px solid var(--line); padding: 12px 16px 14px; background: #fcfcfd; }
.invite-card .invite-panel { border-top: 0; }
.invite-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.invite-head span { font-size: 12px; font-weight: 600; color: var(--muted); }
.invite-list { display: flex; flex-direction: column; gap: 8px; }
.invite-row { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; }
.invite-row code { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; font-weight: 700; letter-spacing: .04em; color: var(--ink-2); }
.invite-row span { flex: 0 0 auto; font-size: 11px; color: var(--muted-2); }
.invite-empty { margin: 0; font-size: 12px; color: var(--muted-2); }

/* ---------- 空状态 / 骨架 ---------- */
.empty { text-align: center; padding: 44px 20px; color: var(--muted-2); }
.empty .ico { width: 42px; height: 42px; margin: 0 auto 12px; color: #cfd4dc; stroke-width: 1.5; }
.empty h3 { margin: 0 0 6px; font-size: 15px; color: var(--ink-2); }
.empty p { margin: 0 0 16px; font-size: 12.5px; line-height: 1.6; }
.empty .btn { height: 40px; padding: 0 18px; font-size: 13px; }

.skeleton { background: linear-gradient(90deg, #eef0f3 25%, #f7f8fa 37%, #eef0f3 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 8px; }
.hero .skeleton { background: linear-gradient(90deg, rgba(255, 255, 255, .16) 25%, rgba(255, 255, 255, .34) 37%, rgba(255, 255, 255, .16) 63%); background-size: 400% 100%; }
/* 区块标题的骨架比正文卡片的底色略深一点，白底上也能看出闪动 */
.sk-bar { background: linear-gradient(90deg, #e4e7ec 25%, #f2f4f7 37%, #e4e7ec 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 6px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.sk-row { display: flex; gap: 12px; padding: 14px; background: #fff; border-radius: 16px; margin-bottom: 10px; border: 1px solid var(--line); }
.sk-avatar { width: 40px; height: 40px; border-radius: 12px; flex: 0 0 auto; }
.sk-lines { flex: 1; }
.sk-line { height: 11px; margin-bottom: 8px; }
.sk-line.w60 { width: 60%; }
.sk-line.w85 { width: 85%; }
.sk-chip { flex: 0 0 auto; width: 64px; height: 31px; border-radius: 999px; }
.sk-chip.w2 { width: 76px; }
.sk-seg { height: 31px; border-radius: 11px; }

/* 详情页各自的骨架版式 */
.sk-detail-head { margin-bottom: 16px; }
.sk-detail-head > .sk-line { margin-bottom: 0; }
.sk-detail-meta { display: flex; gap: 11px; align-items: center; margin-top: 16px; }
.sk-detail-meta-main { flex: 1; min-width: 0; }
.sk-detail-meta-main .sk-line { margin-bottom: 7px; }
.sk-detail-meta-main .sk-line:last-child { margin-bottom: 0; }
.sk-detail-body { display: flex; flex-direction: column; gap: 10px; }
.sk-detail-paras { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.sk-course-head { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.sk-course-icon { width: 46px; height: 46px; border-radius: 14px; flex: 0 0 auto; }
.sk-course-main { flex: 1; min-width: 0; }
.sk-course-main .sk-line { margin-bottom: 8px; }
.sk-course-main .sk-line:last-child { margin-bottom: 0; }
.sk-section-head { display: flex; align-items: center; justify-content: space-between; padding: 0 2px; margin-bottom: 10px; }
.sk-course-item {
  position: relative; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px 14px 14px 18px; margin-bottom: 10px; box-shadow: var(--shadow);
}
.sk-course-item::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3.5px; border-radius: 4px; background: var(--line); }
.sk-course-item .sk-line { margin-bottom: 8px; }
.sk-course-item .sk-line:last-child { margin-bottom: 0; }
.sk-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sk-fact { height: 54px; border-radius: 12px; }
.sk-bubble-list { display: flex; flex-direction: column; gap: 12px; }
.sk-bubble {
  padding: 12px 14px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.sk-bubble.me { align-self: flex-end; border-bottom-right-radius: 5px; }
.sk-bubble:not(.me) { border-bottom-left-radius: 5px; }
.sk-bubble .sk-line { margin-bottom: 8px; }
.sk-bubble .sk-line:last-child { margin-bottom: 0; }

/* 点按反馈：叠一层会淡出的底色，快速点按也能看见 */
.tap-flash { position: relative; }
.tap-flash::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: rgba(200, 16, 46, .10); pointer-events: none;
  animation: tap-flash .38s ease-out forwards;
}
@keyframes tap-flash { from { opacity: 1; } to { opacity: 0; } }
html[data-theme="dark"] .tap-flash::after { background: rgba(255, 255, 255, .10); }

.spinner { width: 18px; height: 18px; border: 2.5px solid rgba(0, 0, 0, .12); border-top-color: currentColor; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
.btn-primary .spinner { border-color: rgba(255, 255, 255, .35); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 弹层 ---------- */
.sheet {
  position: absolute; inset: 0; z-index: 60; display: flex; flex-direction: column;
  background: var(--bg); animation: slideUp .22s cubic-bezier(.2, .8, .2, 1);
}
.sheet[hidden] { display: none; }
@keyframes slideUp { from { transform: translateY(8%); opacity: .4; } to { transform: none; opacity: 1; } }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(10px + var(--safe-top)) 14px 10px; background: #fff; border-bottom: 1px solid var(--line);
}
.sheet-head h2 { margin: 0; font-size: 16px; }
.sheet-spacer { width: 38px; }
.sheet-body { flex: 1; overflow-y: auto; padding: 16px; padding-bottom: calc(24px + var(--safe-bottom)); }
.compose-actions { margin-top: 20px; }

/* ---------- 浮窗 ---------- */
.modal { position: absolute; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: 18px; }
.modal[hidden] { display: none; }
.modal-mask { position: absolute; inset: 0; background: rgba(9, 11, 16, .48); animation: modal-fade .16s ease; }
.modal-card {
  position: relative; width: 100%; max-width: 400px; max-height: 86%;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 24px 60px rgba(9, 11, 16, .28);
  animation: modal-pop .2s cubic-bezier(.2, .8, .2, 1);
}
.modal-head {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 8px 8px 18px; border-bottom: 1px solid var(--line);
}
.modal-head h2 { margin: 0; font-size: 15.5px; }
.modal-body { flex: 1; overflow-y: auto; padding: 16px 18px calc(20px + var(--safe-bottom)); }
.confirm-body { padding: 16px 18px 4px; font-size: 13.5px; line-height: 1.7; color: var(--ink-2); word-break: break-word; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 16px 18px calc(18px + var(--safe-bottom)); }
.confirm-actions .btn { height: 44px; border-radius: 13px; font-size: 14px; }
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-pop { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }

.dida-detail-title { font-size: 19px; font-weight: 700; line-height: 1.35; word-break: break-word; }
.dida-detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 9px; font-size: 12px; color: var(--muted); }
.dida-project { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.dida-project i { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.dida-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0 14px; }
.dida-facts > div { background: #f7f8fa; border-radius: 12px; padding: 10px 12px; min-width: 0; }
.dida-facts span { display: block; font-size: 10.5px; color: var(--muted-2); margin-bottom: 3px; }
.dida-facts b { display: block; font-size: 12.5px; font-weight: 650; line-height: 1.45; color: var(--ink); }
.dida-detail-section { margin: 4px 0 18px; }
.dida-detail-section h3 { margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--muted-2); }
.dida-detail-section p { margin: 0; font-size: 13.5px; line-height: 1.7; color: var(--ink-2); white-space: pre-line; word-break: break-word; }
.dida-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dida-form-grid .field { height: 50px; padding: 0 12px; font-size: 13.5px; line-height: normal; }
.dida-form-grid input[type="datetime-local"] { padding-right: 8px; }
.dida-form-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.dida-form-actions .btn { height: 44px; border-radius: 13px; }

.toast {
  position: absolute; left: 50%; bottom: calc(92px + var(--safe-bottom)); transform: translate(-50%, 12px);
  z-index: 80; max-width: 84%; padding: 10px 16px; border-radius: 12px;
  background: rgba(17, 24, 39, .92); color: #fff; font-size: 12.5px; line-height: 1.5;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: rgba(180, 18, 42, .95); }

/* ---------- 版本与更新 ---------- */
.version-head { padding: 4px 2px 0; }
.version-name { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.version-now { margin-top: 4px; color: var(--muted); font-size: 13px; }
.update-panel {
  margin: 16px 0 4px; padding: 14px;
  border: 1px solid var(--line); border-radius: 14px; background: #f7f8fa;
}
.update-status { margin-bottom: 10px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.update-status:last-child { margin-bottom: 0; }
.update-notes {
  margin: 0 0 12px; padding: 11px 12px; border-radius: 10px;
  background: #fff; border: 1px solid var(--line);
}
.update-notes:empty { display: none; }
.update-notes-ver { margin-bottom: 5px; color: var(--red); font-size: 12.5px; font-weight: 700; }
.update-notes-text { color: var(--ink-2); font-size: 13.5px; line-height: 1.7; }
.update-file { color: var(--muted-2); word-break: break-all; }
.changelog-list { margin-top: 6px; }
.changelog-item { padding: 14px 2px; border-top: 1px solid var(--line); }
.changelog-ver { margin-bottom: 6px; color: var(--red); font-size: 13px; font-weight: 600; }
.changelog-text { color: var(--ink-2); font-size: 13.5px; line-height: 1.7; }

/* ---------- 宽屏 ---------- */
@media (min-width: 640px) {
  body { background: #dfe3e8; }
  .app { height: min(900px, calc(100dvh - 32px)); margin: 16px auto; border-radius: 32px; }
}

/* ---------- 黑夜模式 ---------- */
html[data-theme="dark"] {
  --red: #e0324d;
  --red-dark: #b3122e;
  --red-soft: #3a1a22;
  --ink: #eef1f6;
  --ink-2: #cfd6e2;
  --muted: #a2acbd;
  --muted-2: #7f8a9c;
  --bg: #0f1218;
  --card: #181c24;
  --line: #272d39;
  --shadow: 0 10px 28px rgba(0, 0, 0, .38);
  color-scheme: dark;
}
html[data-theme="dark"],
html[data-theme="dark"] body { background: #090b10; }
html[data-theme="dark"] .app,
html[data-theme="dark"] .screen,
html[data-theme="dark"] .app-shell { background: var(--bg); }
html[data-theme="dark"] .topbar { background: rgba(24, 28, 36, .9); border-bottom-color: rgba(255, 255, 255, .06); }
html[data-theme="dark"] .tabbar { background: #12161d; border-top-color: rgba(255, 255, 255, .06); }
html[data-theme="dark"] .tab-badge { border-color: #12161d; }
html[data-theme="dark"] .icon-btn:active { background: #232936; }
html[data-theme="dark"] .field { background: #12161d; }
html[data-theme="dark"] .field:focus { background: #171c25; }
html[data-theme="dark"] .field-suffix .suffix { background: #202632; }
html[data-theme="dark"] .pill { background: #232a36; }
html[data-theme="dark"] .lock-screen { background: radial-gradient(120% 120% at 50% 0%, #161a22 0%, #0f1218 60%); }
html[data-theme="dark"] .notice { background: #2e2714; border-color: #4a3d18; color: #e6c67a; }
html[data-theme="dark"] .notice .ico { color: #d9ae4e; }
html[data-theme="dark"] .notice strong { color: #f0d391; }
html[data-theme="dark"] .widget-soon { border-color: #333a47; background: rgba(255, 255, 255, .03); }
html[data-theme="dark"] .ann-card.clickable:active { background: #1f2530; }
html[data-theme="dark"] .mail-row:active,
html[data-theme="dark"] .conv-row:active { background: #202633; }
html[data-theme="dark"] .mail-row.unread { background: linear-gradient(90deg, rgba(224, 50, 77, .12), transparent 60%); }
html[data-theme="dark"] .attachment,
html[data-theme="dark"] .detail-facts > div { background: #202633; }
html[data-theme="dark"] .segmented { background: #232936; }
html[data-theme="dark"] .seg.active { background: #343b4a; box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
html[data-theme="dark"] .chip { background: #181c24; }
html[data-theme="dark"] .status-chip,
html[data-theme="dark"] .status-badge,
html[data-theme="dark"] .dida-flag,
html[data-theme="dark"] .badge-due { background: #232a36; }
html[data-theme="dark"] .status-chip.done,
html[data-theme="dark"] .status-badge.on { background: #14311f; color: #6ee7a8; }
html[data-theme="dark"] .status-chip.warn,
html[data-theme="dark"] .dida-flag.mid { background: #33280f; color: #f2b54a; }
html[data-theme="dark"] .badge-due.overdue,
html[data-theme="dark"] .dida-flag.high { background: #3a1a1e; color: #ff8b8b; }
html[data-theme="dark"] .dida-flag.allDay { background: #1c2740; color: #7fa2ff; }
html[data-theme="dark"] .bubble { background: #1e2430; }
html[data-theme="dark"] .bubble.me { background: var(--red); border-color: var(--red); color: #fff; }
html[data-theme="dark"] .msg-chip,
html[data-theme="dark"] .msg-post-line code { background: rgba(255, 255, 255, .09); }
html[data-theme="dark"] .feishu-logo,
html[data-theme="dark"] .feishu-beta { background: #1e2430; }
html[data-theme="dark"] .feishu-alert { background: #33280f; color: #f2b54a; }
html[data-theme="dark"] .conv-avatar,
html[data-theme="dark"] .widget-icon.dida { background: #232b3d; }
html[data-theme="dark"] .widget-icon.maa { background: #1c2e2a; }
html[data-theme="dark"] .widget-icon.silent { background: #262c37; color: #9aa4b2; }
html[data-theme="dark"] .widget-card.active {
  border-color: rgba(255, 107, 129, .45);
  background: linear-gradient(0deg, rgba(200, 16, 46, .16), rgba(200, 16, 46, .16)), var(--card);
}
html[data-theme="dark"] .widget-flag { background: rgba(255, 107, 129, .16); color: #ff8a9b; }
html[data-theme="dark"] .conv-avatar.feishu { background: #1b2a45; color: #7fa2ff; }
html[data-theme="dark"] .dida-check { border-color: #3a4253; background: #1a2029; color: #5a6577; }
html[data-theme="dark"] .dida-task:active { background: #1f2530; }
html[data-theme="dark"] .dida-facts > div { background: #202633; }
html[data-theme="dark"] .modal-mask { background: rgba(0, 0, 0, .62); }
html[data-theme="dark"] .invite-box { background: #2e2714; border-color: #4a3d18; }
html[data-theme="dark"] .invite-code { color: #f0c46a; }
html[data-theme="dark"] .invite-meta { color: #c9a25e; }
html[data-theme="dark"] .invite-panel { background: #141920; }
html[data-theme="dark"] .invite-row { background: #1e2430; }
html[data-theme="dark"] .empty .ico { color: #465063; }
html[data-theme="dark"] .skeleton,
html[data-theme="dark"] .skeleton.sk-avatar,
html[data-theme="dark"] .skeleton.sk-line {
  background: linear-gradient(90deg, #232a36 25%, #2e3646 37%, #232a36 63%);
  background-size: 400% 100%;
}
html[data-theme="dark"] .sk-row { background: #181c24; }
html[data-theme="dark"] .hero .skeleton {
  background: linear-gradient(90deg, rgba(255, 255, 255, .32) 25%, rgba(255, 255, 255, .5) 37%, rgba(255, 255, 255, .32) 63%);
  background-size: 400% 100%;
}
html[data-theme="dark"] .sheet-head { background: #12161d; }
html[data-theme="dark"] .update-panel { background: #1e2430; }
html[data-theme="dark"] .update-banner { background: #2a1a20; border-bottom-color: rgba(224, 50, 77, .22); }
html[data-theme="dark"] .update-notes { background: #1e2430; }
html[data-theme="dark"] .btn-secondary:active { background: #4a2029; }
html[data-theme="dark"] .due-date { background: #232936; }
html[data-theme="dark"] .due-date.urgent span { color: rgba(255, 130, 150, .72); }
html[data-theme="dark"] .mail-body { color: #cfd6e2; }
html[data-theme="dark"] .mail-body * { color: inherit !important; background-color: transparent !important; }
html[data-theme="dark"] .mail-body a { color: #ff8095 !important; }
@media (min-width: 640px) {
  html[data-theme="dark"] body { background: #05070a; }
}