/* src/styles.css — 26岁·真彩世界模拟器 视觉风格 */
/* 深色主题 · 手机端友好单列 · 都市现实克制细腻 */

:root {
  --bg: #15161a;
  --bg-soft: #1c1e24;
  --card: #1e2026;
  --card-hover: #262930;
  --border: #2c2f38;
  --text: #e8e8ea;
  --text-dim: #9a9aa2;
  --text-faint: #6a6c74;
  --accent: #c9a86a;

  /* 色块语义 */
  --c-stage: #8b6f47;    /* 🟤 阶段/城市/重大节点 */
  --c-gain: #4caf50;     /* 🟢 获得/恢复/可用 */
  --c-info: #3a7bd5;     /* 🔵 已确认 */
  --c-warn: #d4a017;     /* 🟡 怀疑/未确认/风险 */
  --c-loss: #e55353;     /* 🔴 损失/逾期/危险 */
  --c-rel: #9c5fbf;      /* 🟣 人物关系/身份变化 */
  --c-aux: #7a7a82;      /* ⚪ 辅助状态 */

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,0.35);
}

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

html, body {
  height: 100%;
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

#app {
  height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 560px;
  margin: 0 auto;
}

/* ---------- 视图切换 ---------- */
.view { display: none; flex: 1; overflow-y: auto; }
.view.active { display: flex; flex-direction: column; }

/* ---------- 顶部栏 ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
  flex-shrink: 0;
}
.topbar .title { font-size: 15px; font-weight: 600; letter-spacing: .5px; }
.topbar .actions { display: flex; gap: 8px; }
.icon-btn {
  background: transparent; border: 1px solid var(--border);
  color: var(--text-dim); border-radius: var(--radius-sm);
  padding: 4px 10px; cursor: pointer; font-size: 13px;
  transition: all .15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); }

/* ---------- 启动流程 ---------- */
.start-wrap { padding: 28px 20px 40px; }
.start-wrap .logo {
  text-align: center; margin: 12px 0 28px;
}
.start-wrap .logo .big {
  font-size: 26px; font-weight: 700; letter-spacing: 1px;
}
.start-wrap .logo .sub {
  color: var(--text-dim); font-size: 13px; margin-top: 6px;
}

.section-label {
  color: var(--accent); font-size: 13px; font-weight: 600;
  margin: 22px 0 10px; letter-spacing: .5px;
}
.intro-line {
  color: var(--text-dim); font-size: 14px; margin-bottom: 14px;
}

/* 模式 / 时间 / 身份选项卡 */
.option-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all .15s;
}
.option-card:hover { background: var(--card-hover); border-color: var(--accent); }
.option-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.option-card .oc-head {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; margin-bottom: 6px;
}
.option-card .oc-head .emoji { font-size: 17px; }
.option-card .oc-head .tag {
  font-size: 11px; color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0 6px; border-radius: 4px; margin-left: auto;
}
.option-card .oc-desc { color: var(--text-dim); font-size: 13px; line-height: 1.6; }

/* 表单 */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block; font-size: 13px; color: var(--text-dim);
  margin-bottom: 6px;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%; background: var(--card); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 14px; font-family: inherit;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none; border-color: var(--accent);
}
.form-group textarea { resize: vertical; min-height: 60px; }

/* 主按钮 */
.btn {
  width: 100%; background: var(--accent); color: #1a1208;
  border: none; border-radius: var(--radius-sm);
  padding: 13px; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: all .15s; margin-top: 8px;
}
.btn:hover { filter: brightness(1.1); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.secondary {
  background: transparent; color: var(--text-dim);
  border: 1px solid var(--border);
}
.btn.secondary:hover { color: var(--text); border-color: var(--accent); }
.btn.danger { background: var(--c-loss); color: #fff; }

/* ---------- 游戏主界面 ---------- */
.game-view { display: none; flex-direction: column; height: 100vh; }
.game-view.active { display: flex; }

/* HUD */
.hud {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  font-size: 12px; line-height: 1.6;
  flex-shrink: 0;
}
.hud .hud-line { color: var(--text-dim); }
.hud .hud-line b { color: var(--text); font-weight: 600; }
.hud .hud-line .warn { color: var(--c-loss); }
.hud .hud-line .due { color: var(--c-warn); }

/* 叙事区 */
.narrative {
  flex: 1; overflow-y: auto;
  padding: 18px 18px 8px;
}
.narrative .turn {
  margin-bottom: 22px;
  animation: fadeIn .4s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }

.narrative .turn-text {
  font-size: 15px; line-height: 1.85; color: var(--text);
}
.narrative .turn-text p { margin-bottom: 10px; }
.narrative .turn-text b { color: #fff; }
.narrative .turn-text hr {
  border: none; border-top: 1px solid var(--border); margin: 14px 0;
}
.narrative .turn-text .player-action {
  background: rgba(201,168,106,.1);
  border-left: 3px solid var(--accent);
  padding: 8px 12px; margin: 10px 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 14px; color: var(--text-dim);
}
.narrative .turn-text .player-action b { color: var(--accent); }

/* 状态卡 */
.status-card {
  border-radius: var(--radius-sm);
  padding: 10px 12px; margin: 8px 0;
  font-size: 13px; line-height: 1.6;
  border-left: 3px solid;
}
.status-card .sc-title { font-weight: 600; margin-bottom: 3px; }
.status-card .sc-body { color: var(--text-dim); font-size: 12.5px; }
.sc-stage  { background: rgba(139,111,71,.12); border-color: var(--c-stage); }
.sc-gain   { background: rgba(76,175,80,.10);  border-color: var(--c-gain); }
.sc-info   { background: rgba(58,123,213,.10); border-color: var(--c-info); }
.sc-warn   { background: rgba(212,160,23,.10); border-color: var(--c-warn); }
.sc-loss   { background: rgba(229,83,83,.10);  border-color: var(--c-loss); }
.sc-rel    { background: rgba(156,95,191,.10); border-color: var(--c-rel); }
.sc-aux    { background: rgba(122,122,130,.10);border-color: var(--c-aux); }
.sc-rel .sc-title b { color: var(--c-rel); }

/* 参考行动 */
.actions-prompt { color: var(--accent); font-size: 13px; margin: 14px 0 8px; }
.action-list { margin-bottom: 12px; }
.action-btn {
  display: block; width: 100%; text-align: left;
  background: var(--card); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius-sm);
  padding: 11px 14px; margin-bottom: 7px; cursor: pointer;
  font-size: 14px; transition: all .15s; font-family: inherit;
}
.action-btn:hover { background: var(--card-hover); border-color: var(--accent); }
.action-btn .num { color: var(--accent); margin-right: 8px; font-weight: 600; }

/* 输入区 */
.input-bar {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 10px 12px;
  flex-shrink: 0;
  display: flex; gap: 8px; align-items: flex-end;
}
.input-bar textarea {
  flex: 1; resize: none; min-height: 44px; max-height: 120px;
  background: var(--card); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 14px; font-family: inherit; line-height: 1.5;
}
.input-bar textarea:focus { outline: none; border-color: var(--accent); }
.input-bar button {
  background: var(--accent); color: #1a1208; border: none;
  border-radius: var(--radius-sm); padding: 0 16px; height: 44px;
  font-weight: 600; cursor: pointer; transition: all .15s;
}
.input-bar button:disabled { opacity: .4; cursor: not-allowed; }

/* 加载态 */
.loading-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); margin-right: 6px;
  animation: pulse 1s infinite;
}
@keyframes pulse { 0%,100% { opacity: .3; } 50% { opacity: 1; } }
.thinking {
  color: var(--text-dim); font-size: 13px; padding: 8px 0;
  display: flex; align-items: center;
}

/* ---------- 设置面板 ---------- */
.panel {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: none; z-index: 50; align-items: center; justify-content: center;
}
.panel.active { display: flex; }
.panel .sheet {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); width: 92%; max-width: 480px;
  max-height: 86vh; overflow-y: auto; padding: 22px;
  box-shadow: var(--shadow);
}
.panel .sheet h2 { font-size: 17px; margin-bottom: 16px; }
.panel .sheet .close-row {
  display: flex; justify-content: flex-end; margin-top: 12px; gap: 8px;
}
.panel .sheet .close-row .btn { width: auto; padding: 9px 18px; margin-top: 0; }

.hint { font-size: 12px; color: var(--text-faint); margin-top: 4px; }
.preset-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.preset-chip {
  background: var(--card); border: 1px solid var(--border);
  color: var(--text-dim); border-radius: 20px; padding: 5px 12px;
  font-size: 12px; cursor: pointer; transition: all .15s;
}
.preset-chip:hover { color: var(--text); border-color: var(--accent); }

/* ---------- 存档面板 ---------- */
.save-item {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 8px;
}
.save-item .si-name { font-weight: 600; margin-bottom: 4px; }
.save-item .si-meta { color: var(--text-dim); font-size: 12px; line-height: 1.5; }
.save-item .si-ops { display: flex; gap: 8px; margin-top: 8px; }
.save-item .si-ops button {
  background: transparent; border: 1px solid var(--border);
  color: var(--text-dim); border-radius: 6px; padding: 4px 10px;
  font-size: 12px; cursor: pointer;
}
.save-item .si-ops button:hover { color: var(--text); border-color: var(--accent); }
.save-item .si-ops button.del:hover { color: var(--c-loss); border-color: var(--c-loss); }

.empty { color: var(--text-faint); text-align: center; padding: 30px 0; font-size: 13px; }

/* 存档文本导出 */
.export-box {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px;
  font-family: "Consolas", monospace; font-size: 12px;
  color: var(--text-dim); white-space: pre-wrap; word-break: break-all;
  max-height: 50vh; overflow-y: auto; line-height: 1.5;
}

/* 滚动条 */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }
