/* ============================================================
 * style.css —— 仙逆·修仙录 界面样式
 * 设计语言：墨色山水 + 鎏金 / 碧玉 点缀，专业前端级响应式布局。
 * ============================================================ */

:root {
  --bg-0: #0a0e14;
  --bg-1: #11161f;
  --bg-2: #161d29;
  --panel: rgba(22, 29, 41, 0.72);
  --panel-line: rgba(201, 162, 74, 0.22);
  --gold: #d4af37;
  --gold-soft: #c9a24a;
  --jade: #4fd1c5;
  --blue: #5b9cf0;
  --red: #ff7a59;
  --purple: #b97bff;
  --text: #e8e3d6;
  --text-dim: #9aa3b2;
  --radius: 14px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --kai: "Ma Shan Zheng", "STKaiti", "KaiTi", var(--serif);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--serif);
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 15% -10%, #1b2536 0%, transparent 55%),
    radial-gradient(1000px 600px at 110% 10%, #241a2e 0%, transparent 50%),
    linear-gradient(160deg, var(--bg-0), var(--bg-1) 60%, var(--bg-2));
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* 背景光晕与颗粒质感 */
.bg-aura {
  position: fixed; inset: -20% -10% auto -10%; height: 60%;
  background: radial-gradient(closest-side, rgba(212, 175, 55, 0.16), transparent 70%);
  filter: blur(20px); animation: drift 16s ease-in-out infinite alternate;
  pointer-events: none; z-index: 0;
}
.bg-grain {
  position: fixed; inset: 0; opacity: 0.05; pointer-events: none; z-index: 0;
  background-image: radial-gradient(rgba(255,255,255,0.7) 1px, transparent 1px);
  background-size: 4px 4px;
}
@keyframes drift { from { transform: translateX(-4%); } to { transform: translateX(6%); } }

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--panel-line);
  backdrop-filter: blur(8px);
  background: linear-gradient(180deg, rgba(10,14,20,0.6), transparent);
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-seal {
  width: 46px; height: 46px; display: grid; place-items: center;
  font-family: var(--kai); font-size: 26px; color: #1a1208;
  background: linear-gradient(145deg, #f0d27a, var(--gold));
  border-radius: 12px; box-shadow: 0 0 18px rgba(212,175,55,0.5);
}
.brand-text {
  font-family: var(--kai); font-size: 30px; letter-spacing: 4px;
  background: linear-gradient(90deg, #f3dd95, var(--gold), #f3dd95);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.player { display: flex; align-items: center; gap: 10px; }
.player-label { color: var(--text-dim); font-size: 14px; }
.player-input {
  background: rgba(0,0,0,0.3); border: 1px solid var(--panel-line);
  color: var(--text); padding: 8px 12px; border-radius: 10px;
  font-family: var(--serif); font-size: 15px; width: 120px; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.player-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212,175,55,.15); }

/* ---------------- 布局 ---------------- */
.layout {
  position: relative; z-index: 2;
  display: grid; gap: 20px; padding: 24px;
  grid-template-columns: 320px 1fr 380px;
  max-width: 1380px; margin: 0 auto; align-items: start;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

/* ---------------- 境界卡片 ---------------- */
.realm-card {
  text-align: center; padding: 22px 16px;
  border-radius: 12px; margin-bottom: 18px;
  background:
    radial-gradient(120% 120% at 50% 0%, rgba(212,175,55,0.12), transparent 60%),
    rgba(0,0,0,0.25);
  border: 1px solid rgba(212,175,55,0.18);
}
.realm-step {
  display: inline-block; font-size: 13px; color: var(--jade);
  letter-spacing: 2px; padding: 2px 12px; border: 1px solid rgba(79,209,197,.4);
  border-radius: 999px; margin-bottom: 8px;
}
.realm-name {
  font-family: var(--kai); font-size: 52px; letter-spacing: 6px;
  background: linear-gradient(180deg, #fff4cf, var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 30px rgba(212,175,55,0.25);
}
.realm-desc { color: var(--text-dim); font-size: 13px; line-height: 1.7; margin: 12px 4px 16px; }

.progress {
  height: 12px; border-radius: 999px; overflow: hidden;
  background: rgba(0,0,0,0.45); border: 1px solid rgba(255,255,255,0.06);
}
.progress-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--jade), var(--gold));
  box-shadow: 0 0 14px rgba(212,175,55,0.6);
  transition: width .6s cubic-bezier(.2,.8,.2,1);
}
.progress-row {
  display: flex; justify-content: space-between; margin-top: 8px;
  font-size: 13px; color: var(--text-dim);
}
#progress-text { color: var(--gold-soft); }

/* ---------------- 属性网格 ---------------- */
.stats-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px;
}
.stat {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-radius: 10px;
  background: rgba(0,0,0,0.28); border: 1px solid rgba(255,255,255,0.05);
}
.stat-label { color: var(--text-dim); font-size: 14px; }
.stat-val { font-size: 18px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.stat-stone .stat-val { color: var(--gold); }

.rate-line {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: 13px; color: var(--text-dim);
  padding-top: 12px; border-top: 1px dashed rgba(255,255,255,0.08);
}
.rate-line b { color: var(--jade); font-size: 15px; }

.sect-line {
  margin-top: 12px; padding: 10px 14px; border-radius: 10px;
  background: rgba(212,175,55,0.07); border: 1px solid rgba(212,175,55,0.18);
  font-size: 14px; color: var(--text-dim); text-align: center;
}
.sect-line b { color: var(--gold); font-size: 15px; }

/* ---------------- 中部修行动作 ---------------- */
.section-title {
  font-family: var(--kai); font-size: 30px; letter-spacing: 6px; text-align: center;
  color: var(--gold-soft); margin-bottom: 18px;
}
.actions { display: grid; gap: 12px; }
.break-info { font-size: 13px; color: var(--text-dim); text-align: center; min-height: 18px; }

/* 历练状态区 */
.travel-box {
  margin-top: 16px; padding: 14px 16px; border-radius: 12px;
  background: rgba(0,0,0,0.28); border: 1px solid rgba(79,209,197,0.25);
}
.travel-row { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 10px; }
.travel-row span { color: var(--text-dim); }
.travel-row b { color: var(--text); }
.travel-progress { height: 8px; }
.travel-progress .progress-fill { background: linear-gradient(90deg, var(--jade), var(--blue)); }

/* 分页 */
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; }
.pager-info { font-size: 13px; color: var(--text-dim); }
.pager .btn-sm { padding: 6px 14px; font-size: 13px; }

/* ---------------- 按钮 ---------------- */
.btn {
  font-family: var(--serif); font-size: 15px; cursor: pointer;
  padding: 12px 18px; border-radius: 11px; border: 1px solid transparent;
  color: var(--text); background: rgba(255,255,255,0.06);
  transition: transform .12s ease, box-shadow .2s, background .2s, border-color .2s;
  user-select: none;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.big { font-size: 17px; padding: 14px 20px; letter-spacing: 2px; }
.btn-sm { padding: 7px 12px; font-size: 13px; }

.btn-gold {
  background: linear-gradient(145deg, #f0d27a, var(--gold));
  color: #1a1208; font-weight: 700;
  box-shadow: 0 6px 20px rgba(212,175,55,0.35);
}
.btn-gold:hover { box-shadow: 0 10px 28px rgba(212,175,55,0.5); }

.btn-blue {
  background: linear-gradient(145deg, #7fb4f5, var(--blue));
  color: #06121f; font-weight: 600;
  box-shadow: 0 6px 18px rgba(91,156,240,0.3);
}
.btn-break {
  background: linear-gradient(145deg, #ff9b78, var(--red));
  color: #2a0f06; font-weight: 700;
  box-shadow: 0 6px 22px rgba(255,122,89,0.4);
}
.btn-break:hover:not(:disabled) { box-shadow: 0 10px 30px rgba(255,122,89,0.55); }
.btn-ghost { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.14); color: var(--text-dim); }
.btn-ghost:hover { color: var(--text); border-color: var(--gold); }

/* ---------------- 纪事日志 ---------------- */
.log { margin-top: 22px; }
.log-title { font-size: 16px; color: var(--gold-soft); margin-bottom: 10px; letter-spacing: 2px; }
.log-list {
  max-height: 320px; overflow-y: auto; padding-right: 6px;
  display: flex; flex-direction: column; gap: 6px;
}
.log-line {
  font-size: 13px; line-height: 1.5; padding: 8px 12px; border-radius: 8px;
  background: rgba(0,0,0,0.25); border-left: 3px solid var(--text-dim); color: var(--text-dim);
}
.log-info { border-left-color: var(--blue); color: #cdd8e6; }
.log-success { border-left-color: var(--jade); color: #c8f3ee; background: rgba(79,209,197,0.08); }
.log-fail { border-left-color: var(--red); color: #ffd2c4; background: rgba(255,122,89,0.08); }
.log-warn { border-left-color: var(--gold); color: #f3e3b0; }
.log-empty { color: var(--text-dim); font-size: 13px; text-align: center; padding: 20px; }
.log-list::-webkit-scrollbar { width: 6px; }
.log-list::-webkit-scrollbar-thumb { background: rgba(212,175,55,0.3); border-radius: 6px; }

/* ---------------- 右侧 Tabs ---------------- */
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tab-btn {
  flex: 1; padding: 10px 6px; font-family: var(--serif); font-size: 14px;
  color: var(--text-dim); background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.08); border-radius: 10px;
  cursor: pointer; transition: all .2s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  color: #1a1208; background: linear-gradient(145deg, #f0d27a, var(--gold));
  font-weight: 700; border-color: transparent;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn .35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------------- 卡片列表 ---------------- */
.card-list { display: grid; gap: 12px; max-height: 70vh; overflow-y: auto; padding-right: 4px; }
.card {
  padding: 14px; border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(0,0,0,0.2));
  border: 1px solid rgba(255,255,255,0.08);
  transition: transform .15s, border-color .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-3px); border-color: var(--panel-line); box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.card-title { font-size: 17px; font-weight: 700; letter-spacing: 1px; }
.rarity { font-size: 12px; padding: 1px 9px; border: 1px solid; border-radius: 999px; }
.card-desc { font-size: 13px; color: var(--text-dim); line-height: 1.6; margin-bottom: 8px; }
.card-meta { font-size: 12px; color: var(--jade); margin-bottom: 10px; }
.card-actions { display: flex; align-items: center; gap: 10px; }
.card-actions .btn { padding: 7px 14px; font-size: 13px; }
.learned { font-size: 12px; color: var(--jade); }
.lock { font-size: 12px; color: var(--text-dim); }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translate(-50%, 20px);
  z-index: 50; padding: 12px 22px; border-radius: 12px;
  background: rgba(20,26,38,0.95); color: var(--text); font-size: 14px;
  border: 1px solid var(--panel-line); box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: all .3s ease; max-width: 80vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-success { border-color: var(--jade); color: #c8f3ee; }
.toast-fail { border-color: var(--red); color: #ffd2c4; }
.toast-warn { border-color: var(--gold); color: #f3e3b0; }
.toast-info { border-color: var(--blue); }

/* ---------------- 弹窗 ---------------- */
.modal {
  position: fixed; inset: 0; z-index: 60; display: none;
  align-items: center; justify-content: center;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(3px);
}
.modal.show { display: flex; animation: fadeIn .25s ease; }
.modal-box {
  width: min(420px, 90vw); padding: 26px;
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--panel-line); border-radius: 16px; box-shadow: var(--shadow);
  text-align: center;
}
.modal-box h3 { font-family: var(--kai); font-size: 26px; color: var(--gold); margin-bottom: 14px; letter-spacing: 2px; }
.modal-box p { color: var(--text-dim); font-size: 14px; line-height: 1.8; margin: 6px 0; }
.modal-box .muted { font-size: 12px; color: var(--red); }
.modal-actions { display: flex; gap: 12px; margin-top: 18px; }
.modal-actions .btn { flex: 1; }

/* ---------------- 页脚 ---------------- */
.footer {
  position: relative; z-index: 2; text-align: center;
  color: var(--text-dim); font-size: 12px; padding: 26px 16px 36px;
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 1080px) {
  .layout { grid-template-columns: 1fr; max-width: 720px; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 560px) {
  .topbar { flex-direction: column; gap: 12px; padding: 14px; }
  .layout { padding: 14px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .realm-name { font-size: 42px; }
  .section-title { font-size: 24px; }
  .brand-text { font-size: 24px; }
  .actions .btn.big { font-size: 15px; }
}
