/* ===========================================================
   FURINA CALENDAR · 设计系统
   深海歌剧主题：宝石蓝底色 + 冰蓝高光 + 香槟金点缀
   配色取自「芙宁娜闪耀日程」官方视觉
   =========================================================== */

:root {
  /* 背景层次：由深到浅 */
  --bg-0: #050d20;
  --bg-1: #081228;
  --bg-2: #0d1e3e;
  --bg-3: #142b53;
  --bg-glass: rgba(14, 32, 62, 0.72);
  --bg-glass-hi: rgba(20, 44, 82, 0.90);

  --line: rgba(126, 176, 240, 0.16);
  --line-hi: rgba(146, 196, 255, 0.34);

  --text-0: #eef6ff;
  --text-1: #c3d9f2;
  --text-2: #8bA9c9;
  --text-3: #5f7da1;

  /* 主色：冰蓝 */
  --accent: #6cb8f0;
  --accent-2: #3d7fc4;
  --accent-deep: #24568f;

  /* 金色点缀（角标、装饰线、强调） */
  --gold: #e8cf94;
  --gold-2: #c9a962;
  --gold-dim: rgba(232, 207, 148, 0.35);

  --danger: #ef6b7a;
  --warn: #f0b661;
  --ok: #5fd3a6;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 26px;

  --shadow-1: 0 2px 10px rgba(0, 0, 0, 0.38);
  --shadow-2: 0 8px 30px rgba(0, 0, 0, 0.48);
  --shadow-glow: 0 0 26px rgba(108, 184, 240, 0.22);

  --sidebar-w: 248px;
  --topbar-h: 62px;

  --ease: cubic-bezier(0.22, 0.68, 0.36, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC",
    "HarmonyOS Sans SC", "Segoe UI", system-ui, sans-serif;
  font-size: 13.5px;
  color: var(--text-0);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  user-select: none;
  cursor: default;
}

/* 背景：深海舞台光 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1100px 620px at 14% -10%, rgba(52, 112, 196, 0.34), transparent 62%),
    radial-gradient(900px 520px at 92% 2%, rgba(70, 92, 186, 0.26), transparent 60%),
    radial-gradient(1000px 700px at 50% 108%, rgba(30, 78, 140, 0.34), transparent 65%),
    linear-gradient(178deg, #0a1730 0%, #071124 48%, #050c1c 100%);
  z-index: -2;
  pointer-events: none;
}

/* 细密水波纹 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    repeating-linear-gradient(115deg,
      rgba(140, 196, 255, 0.026) 0px,
      rgba(140, 196, 255, 0.026) 1px,
      transparent 1px,
      transparent 7px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.7;
}

/* 顶部金色微光，呼应参考图的舞台灯 */
body::before,
.stage-glow {
  pointer-events: none;
}

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(120, 170, 230, 0.24);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(120, 170, 230, 0.44); background-clip: padding-box; }

/* ---------- 布局骨架 ---------- */
#app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ---------- 侧边栏 ---------- */
.sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  overflow: hidden;
  isolation: isolate;
  background-color: #060e20;
  /* 整条侧栏铺芙宁娜全身立绘，用蒙版压暗到文字可读 */
  background-image: url('/img/furina-sidebar.jpg');
  background-repeat: no-repeat;
  background-position: center top;
  background-size: 100% 100%;
}

/* 蒙版：品牌区透出人物，往下逐渐压暗 */
.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(6, 16, 38, 0.06) 0%,
    rgba(6, 16, 38, 0.20) 7%,
    rgba(6, 16, 38, 0.48) 13%,
    rgba(6, 15, 35, 0.70) 19%,
    rgba(5, 13, 30, 0.78) 40%,
    rgba(5, 12, 28, 0.86) 68%,
    rgba(5, 12, 28, 0.94) 100%);
  z-index: -1;
  pointer-events: none;
}

.sidebar::after {
  content: "";
  position: absolute;
  top: 0; right: -1px; bottom: 0;
  width: 1px;
  background: linear-gradient(180deg,
    transparent,
    rgba(232, 207, 148, 0.42) 10%,
    rgba(108, 184, 240, 0.52) 50%,
    rgba(232, 207, 148, 0.26) 90%,
    transparent);
  opacity: 0.75;
  pointer-events: none;
}

/* 品牌行：小圆头像 + miHoYo logo + 名称，一行排开 */
.brand {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 15px 13px 13px;
  background: linear-gradient(180deg, rgba(6, 16, 38, 0.62), rgba(6, 14, 32, 0.80));
  border-bottom: 1px solid rgba(232, 207, 148, 0.16);
  backdrop-filter: blur(3px);
}

.brand-mark {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(232, 207, 148, 0.62);
  box-shadow:
    0 0 0 2px rgba(6, 14, 32, 0.80),
    0 0 12px rgba(108, 184, 240, 0.55);
}

/* miHoYo 标识：小尺寸贴在名字左边 */
.brand-mihoyo {
  height: 9px;
  width: auto;
  flex-shrink: 0;
  opacity: 0.88;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.7));
  margin-top: 1px;
}

.brand-text {
  line-height: 1.15;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.brand-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
  background: linear-gradient(100deg, #ffffff 8%, #d6e9ff 55%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-sub {
  font-size: 8.5px;
  color: rgba(232, 207, 148, 0.78);
  letter-spacing: 1.4px;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 导航 */
.nav {
  padding: 6px 10px 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
  position: relative;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--r-md);
  color: rgba(212, 231, 252, 0.90);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.16s var(--ease);
  position: relative;
  border: 1px solid rgba(120, 170, 230, 0.10);
  background: rgba(9, 22, 46, 0.62);
  backdrop-filter: blur(4px);
}

.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.92; }

.nav-item:hover {
  background: rgba(28, 62, 112, 0.80);
  color: #ffffff;
  border-color: rgba(140, 190, 250, 0.30);
}

.nav-item.active {
  background: linear-gradient(95deg, rgba(62, 128, 202, 0.78), rgba(28, 62, 112, 0.62));
  color: #ffffff;
  border-color: rgba(146, 198, 255, 0.52);
  box-shadow:
    inset 0 0 18px rgba(108, 184, 240, 0.18),
    0 2px 12px rgba(0, 0, 0, 0.34);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--gold), var(--accent));
  box-shadow: 0 0 10px rgba(232, 207, 148, 0.7);
}

.nav-badge {
  margin-left: auto;
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 99px;
  background: rgba(232, 207, 148, 0.22);
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.side-section {
  padding: 13px 16px 5px;
  font-size: 10px;
  letter-spacing: 1.6px;
  color: rgba(232, 207, 148, 0.66);
  text-transform: uppercase;
  flex-shrink: 0;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
}

.game-list {
  padding: 0 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  flex-shrink: 0;
}

.game-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background 0.15s var(--ease);
  border: 1px solid rgba(120, 170, 230, 0.08);
  background: rgba(9, 22, 46, 0.52);
  backdrop-filter: blur(4px);
}

.game-row:hover {
  background: rgba(32, 66, 116, 0.78);
  border-color: rgba(140, 190, 250, 0.22);
}

.game-row.off { opacity: 0.48; }

.game-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
  background: currentColor;
}

.game-name {
  font-size: 12.5px;
  color: rgba(226, 240, 255, 0.94);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-count {
  font-size: 10.5px;
  color: rgba(184, 208, 234, 0.72);
  font-variant-numeric: tabular-nums;
}

.sidebar-foot {
  margin-top: auto;
  padding: 12px 14px;
  border-top: 1px solid rgba(140, 190, 250, 0.16);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(5, 12, 28, 0.72), rgba(4, 10, 24, 0.94));
  backdrop-filter: blur(6px);
}

.side-stat {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: rgba(166, 194, 224, 0.88);
}
.side-stat b {
  color: var(--text-0);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---------- 主区 ---------- */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.topbar {
  height: var(--topbar-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(11, 24, 48, 0.80), rgba(7, 16, 34, 0.64));
  backdrop-filter: blur(12px);
  position: relative;
}

/* 顶栏底部一条金色细线，呼应参考图的描边 */
.topbar::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(232, 207, 148, 0.26) 22%,
    rgba(232, 207, 148, 0.26) 78%,
    transparent);
  pointer-events: none;
}

.page-title {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: 0.4px;
  white-space: nowrap;
  background: linear-gradient(100deg, #ffffff, #cfe6ff 60%, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.page-sub {
  font-size: 11.5px;
  color: var(--text-3);
  white-space: nowrap;
}

.topbar-spacer { flex: 1; }

.content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 20px 28px;
  min-height: 0;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 13px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-hi);
  background: rgba(60, 120, 190, 0.12);
  color: var(--text-1);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  white-space: nowrap;
  user-select: none;
}

.btn svg { width: 14px; height: 14px; }

.btn:hover {
  background: rgba(80, 145, 220, 0.22);
  color: #ffffff;
  border-color: rgba(146, 196, 255, 0.52);
  transform: translateY(-1px);
}

.btn:active { transform: translateY(0); }

.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(100deg, #2f6fae, #5ba8e4);
  color: #04101f;
  border-color: transparent;
  font-weight: 650;
  box-shadow: 0 3px 14px rgba(91, 168, 228, 0.30);
}
.btn-primary:hover {
  background: linear-gradient(100deg, #4a90cf, #7cc4f5);
  color: #04101f;
  box-shadow: 0 5px 20px rgba(108, 184, 240, 0.45);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-2);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.055);
  color: var(--text-0);
  border-color: transparent;
}

.btn-danger {
  border-color: rgba(255, 107, 107, 0.4);
  background: rgba(255, 107, 107, 0.1);
  color: #ffa8a8;
}
.btn-danger:hover {
  background: rgba(255, 107, 107, 0.2);
  border-color: rgba(255, 107, 107, 0.7);
  color: #ffd0d0;
}

.btn-sm { height: 26px; padding: 0 9px; font-size: 11.5px; border-radius: 6px; }
.btn-sm svg { width: 12px; height: 12px; }

.icon-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { background: rgba(255, 255, 255, 0.06); color: var(--text-0); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--bg-glass);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-1);
}

.card-pad { padding: 16px 18px; }

.card-title {
  font-size: 13px;
  font-weight: 650;
  color: var(--text-1);
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
}

.card-title::before {
  content: "";
  width: 3px;
  height: 13px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 8px rgba(108, 184, 240, 0.6);
}

/* ---------- 工具类 ---------- */
.row { display: flex; align-items: center; gap: 10px; }
.col { display: flex; flex-direction: column; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.hidden { display: none !important; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.muted { color: var(--text-3); }
.tiny { font-size: 11px; }
.small { font-size: 12px; }

/* ---------- 输入 ---------- */
.input, .select, .textarea {
  height: 32px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-hi);
  background: rgba(4, 12, 22, 0.65);
  color: var(--text-0);
  font-family: inherit;
  font-size: 12.5px;
  outline: none;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
  user-select: text;
}

.input:focus, .select:focus, .textarea:focus {
  border-color: rgba(108, 184, 240, 0.65);
  box-shadow: 0 0 0 3px rgba(108, 184, 240, 0.12);
}

.textarea { height: auto; padding: 8px 10px; resize: vertical; min-height: 60px; line-height: 1.5; }

.select {
  appearance: none;
  padding-right: 26px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%237e96b0' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 11px;
  cursor: pointer;
}
.select option { background: #0d1c30; color: var(--text-0); }

input[type="datetime-local"].input,
input[type="date"].input { cursor: pointer; }

input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.7) sepia(0.3) saturate(3) hue-rotate(160deg);
  cursor: pointer;
}

/* ---------- 标签 / 徽章 ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 21px;
  padding: 0 8px;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 11px;
  border-radius: 99px;
  font-size: 11.5px;
  border: 1px solid var(--line-hi);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s var(--ease);
  white-space: nowrap;
}
.pill:hover { color: var(--text-0); border-color: rgba(108, 184, 240, 0.4); }
.pill.on {
  background: rgba(108, 184, 240, 0.16);
  border-color: rgba(108, 184, 240, 0.5);
  color: #dceeff;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- 空状态 ---------- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 56px 20px;
  color: var(--text-3);
  text-align: center;
}
.empty svg { width: 54px; height: 54px; opacity: 0.35; }
.empty-title { font-size: 14px; color: var(--text-2); }
.empty-desc { font-size: 12px; line-height: 1.7; max-width: 340px; }

/* ---------- 动画 ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.42; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer {
  0% { background-position: -220% 0; }
  100% { background-position: 220% 0; }
}

.fade-up { animation: fadeUp 0.28s var(--ease) both; }

.spinner {
  width: 15px; height: 15px;
  border: 2px solid rgba(108, 184, 240, 0.22);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  flex-shrink: 0;
}

/* ---------- Toast ---------- */
#toast-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  z-index: 9000;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 220px;
  max-width: 380px;
  padding: 11px 14px;
  border-radius: var(--r-md);
  background: var(--bg-glass-hi);
  border: 1px solid var(--line-hi);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-2);
  font-size: 12.5px;
  color: var(--text-0);
  display: flex;
  align-items: flex-start;
  gap: 9px;
  animation: fadeUp 0.24s var(--ease) both;
  line-height: 1.5;
}

.toast.out { animation: fadeIn 0.2s var(--ease) reverse both; }
.toast-icon { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.toast.ok { border-color: rgba(74, 222, 128, 0.42); }
.toast.ok .toast-icon { color: var(--ok); }
.toast.err { border-color: rgba(255, 107, 107, 0.42); }
.toast.err .toast-icon { color: var(--danger); }
.toast.info .toast-icon { color: var(--accent); }

