/* 弈趣 · 楚河汉界 —— 古风界面（美化版） */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "KaiTi", "STKaiti", "Microsoft YaHei", serif;
  background: #1a1008;
  background-image:
    radial-gradient(ellipse at 20% 10%, rgba(120, 70, 30, 0.35), transparent 50%),
    radial-gradient(ellipse at 80% 90%, rgba(90, 55, 25, 0.3), transparent 50%),
    linear-gradient(180deg, #241408, #180d06);
  color: #e8c98a;
  min-height: 100vh;
}
.app { max-width: 1120px; margin: 0 auto; padding: 14px; }
header { text-align: center; padding: 10px 0 14px; }
header h1 {
  font-size: 32px; letter-spacing: 8px; color: #f5dc9e;
  text-shadow: 0 2px 4px rgba(0,0,0,0.7), 0 0 24px rgba(200, 150, 60, 0.25);
  margin-bottom: 12px;
}
.controls { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.controls label { font-size: 14px; color: #d8b878; }
.controls select, .controls button, .learn-controls input, .learn-controls button, .import-area button, .import-area textarea {
  font-family: inherit; font-size: 14px;
  background: linear-gradient(180deg, #9a6638, #6f4220);
  color: #f5e6c8; border: 1px solid #b0854d; border-radius: 8px;
  padding: 7px 14px; cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.12);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
}
.controls select:hover, .controls button:hover, .learn-controls button:hover, .import-area button:hover {
  background: linear-gradient(180deg, #ac7442, #7d4d28);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.15);
}
.controls button:active, .learn-controls button:active, .import-area button:active { transform: translateY(1px); }
.controls button:disabled {
  opacity: 0.45; cursor: not-allowed; transform: none;
  box-shadow: none;
}
.controls button:disabled:hover { background: linear-gradient(180deg, #9a6638, #6f4220); transform: none; }

.main { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.board-wrap { position: relative; }
#board {
  display: block; border-radius: 12px;
  box-shadow: 0 10px 32px rgba(0,0,0,0.65), 0 0 0 3px #4a2e14, 0 0 40px rgba(180, 120, 50, 0.12);
  cursor: pointer; max-width: 100%; height: auto;
}
#status {
  text-align: center; margin-top: 10px; font-size: 17px; color: #f5dc9e;
  min-height: 24px; text-shadow: 0 1px 3px rgba(0,0,0,0.8); letter-spacing: 1px;
}
#message {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: rgba(20, 12, 6, 0.94); color: #ffd98a; border: 1px solid #b0854d;
  border-radius: 12px; padding: 16px 26px; font-size: 15px; max-width: 92%;
  display: none; z-index: 10; box-shadow: 0 6px 24px rgba(0,0,0,0.8);
  animation: fadeIn 0.25s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translate(-50%, -46%); } to { opacity: 1; transform: translate(-50%, -50%); } }

.side { width: 300px; display: flex; flex-direction: column; gap: 14px; }
.panel {
  background: linear-gradient(160deg, #3d2815, #2b1a0c);
  border: 1px solid #6b4a28; border-radius: 12px; padding: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 4px 14px rgba(0,0,0,0.4);
}
.panel h3 {
  color: #f5dc9e; font-size: 16px; margin-bottom: 10px; letter-spacing: 3px;
  border-bottom: 1px solid #6b4a28; padding-bottom: 8px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}
.moves { height: 250px; overflow-y: auto; font-size: 14px; }
.mv-row { display: flex; padding: 3px 8px; border-radius: 6px; cursor: pointer; transition: background 0.12s ease; }
.mv-row:hover { background: rgba(210, 165, 100, 0.16); }
.mv-n { width: 30px; color: #a08050; }
.mv-r { width: 92px; color: #f0c8a0; }
.mv-b { width: 92px; color: #d0d0d0; }
#bookInfo { font-size: 13px; color: #c8a878; margin-bottom: 10px; line-height: 1.6; }
.learn-controls { display: flex; gap: 6px; flex-wrap: wrap; }
.learn-controls input { width: 66px; }
#learnProgress { font-size: 13px; color: #ffd98a; margin-top: 10px; }
.review-panel {
  margin-top: 16px; background: linear-gradient(160deg, #3d2815, #2b1a0c);
  border: 1px solid #6b4a28; border-radius: 12px; padding: 14px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
  animation: fadeInDown 0.3s ease;
}
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.rv-line { font-size: 14px; padding: 4px 6px; color: #e8d0a8; border-bottom: 1px dashed #4a3018; }
.rv-line b { color: #ffd98a; }
.rv-end { color: #a08050; text-align: center; padding: 8px; }
.explain-panel { border-color: #8a6a35; }
.ex-title {
  color: #ffd98a; font-size: 17px; letter-spacing: 2px; margin-bottom: 10px;
  border-bottom: 1px dashed #5a3c1c; padding-bottom: 8px; text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}
.ex-item { font-size: 14px; line-height: 1.7; color: #e8d0a8; padding: 6px 4px; }
.ex-item b { color: #f5dc9e; }
.ex-item + .ex-item { border-top: 1px dashed #4a3018; }
.import-area {
  margin-top: 16px; background: linear-gradient(160deg, #3d2815, #2b1a0c);
  border: 1px solid #6b4a28; border-radius: 12px; padding: 16px;
}
.import-area h3 { color: #f5dc9e; margin-bottom: 10px; }
.import-area p { font-size: 13px; color: #c8a878; margin-bottom: 10px; line-height: 1.7; }
.import-area textarea { width: 100%; resize: vertical; background: #1e1208; }
.import-area div { display: flex; gap: 8px; margin-top: 10px; }

/* 页面底部操作区（导入/导出棋谱） */
.bottom-actions {
  margin-top: 18px; padding: 12px 0 6px;
  display: flex; gap: 10px; justify-content: center;
  border-top: 1px solid rgba(150, 105, 55, 0.35);
}
.bottom-actions button {
  font-family: inherit; font-size: 14px;
  background: linear-gradient(180deg, #8a5a30, #643a1c);
  color: #e8d0a0; border: 1px solid #a97b45; border-radius: 8px;
  padding: 8px 20px; cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.1);
  transition: transform 0.12s ease, background 0.15s ease;
}
.bottom-actions button:hover {
  background: linear-gradient(180deg, #9a6838, #74421e);
  transform: translateY(-1px);
}
.bottom-actions button:active { transform: translateY(1px); }

/* 游戏切换导航链接 */
.nav-link {
  font-family: inherit; font-size: 14px; text-decoration: none;
  background: linear-gradient(180deg, #7a5230, #5a3818);
  color: #f5e6c8; border: 1px solid #a97b45; border-radius: 8px;
  padding: 7px 14px; cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.1);
  transition: transform 0.12s ease, background 0.15s ease;
}
.nav-link:hover {
  background: linear-gradient(180deg, #8c6038, #6a421e);
  transform: translateY(-1px);
}

/* 滚动条 */
.moves::-webkit-scrollbar, .review-panel::-webkit-scrollbar { width: 8px; }
.moves::-webkit-scrollbar-thumb, .review-panel::-webkit-scrollbar-thumb { background: #6b4a28; border-radius: 4px; }
.moves::-webkit-scrollbar-track, .review-panel::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 860px) {
  .main { flex-direction: column; align-items: center; }
  .side { width: 100%; max-width: 540px; }
  .moves { height: 150px; }
  header h1 { font-size: 26px; letter-spacing: 4px; }
}
