* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; background: #1a1410; color: #e8dcc0; font-family: "Microsoft YaHei", "PingFang SC", "SimSun", serif; overflow: hidden; }
#app { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.screen { width: 1088px; max-width: 100vw; height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.hidden { display: none !important; }

.btn { background: linear-gradient(#5a4632, #3d2f22); color: #e8dcc0; border: 1px solid #8a6f4d; border-radius: 4px; padding: 6px 14px; font-size: 14px; cursor: pointer; font-family: inherit; }
.btn:hover { background: linear-gradient(#6b5540, #4a3a2a); border-color: #c9a86a; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.big { display: block; width: 240px; margin: 10px auto; padding: 12px; font-size: 18px; }
.btn.primary { background: linear-gradient(#7a3b2a, #5a2a1e); border-color: #d08a5a; }
.btn.primary:hover { background: linear-gradient(#8f4a35, #6b3526); }
.btn.small { padding: 2px 8px; font-size: 12px; }

/* 标题 */
#screen-title { background: radial-gradient(ellipse at center, #2c211a 0%, #14100c 70%); }
.title-box { text-align: center; }
.title-box h1 { font-size: 84px; letter-spacing: 24px; color: #d8b46a; text-shadow: 0 4px 12px #000, 0 0 40px rgba(216,180,106,.35); font-family: "SimSun", serif; }
.subtitle { color: #9a8a6a; margin: 12px 0 36px; letter-spacing: 6px; }
.hint { margin-top: 40px; color: #6a5c46; font-size: 12px; }

/* 设置画面 */
#screen-setup h2 { color: #d8b46a; margin-bottom: 18px; letter-spacing: 8px; }
.setup-list { display: flex; flex-direction: column; gap: 10px; width: 640px; max-height: 62vh; overflow-y: auto; margin-bottom: 16px; }
.setup-item { background: #241c14; border: 1px solid #5a4632; border-radius: 6px; padding: 12px 16px; cursor: pointer; text-align: left; }
.setup-item:hover { border-color: #c9a86a; background: #2e2418; }
.setup-item h3 { color: #e8c88a; font-size: 16px; margin-bottom: 4px; }
.setup-item p { color: #9a8a6a; font-size: 12px; line-height: 1.5; }
.setup-item .tag { display: inline-block; background: #3d2f22; color: #c9a86a; font-size: 11px; padding: 1px 8px; border-radius: 8px; margin-right: 6px; }

/* 战略画面：左日志 / 中地图 / 右城池面板 三栏布局 */
#screen-map { justify-content: flex-start; width: 100vw; max-width: 100vw; }
#topbar { width: 100%; display: flex; align-items: center; gap: 10px; padding: 6px 12px; background: #241c14; border-bottom: 1px solid #5a4632; font-size: 14px; }
#topbar .spacer { flex: 1; }
#tb-date { color: #e8c88a; font-weight: bold; }
#tb-faction { font-weight: bold; }
#tb-info { color: #9a8a6a; font-size: 12px; }
#map-wrap { flex: 1; display: flex; align-items: stretch; justify-content: center; gap: 10px; width: 100%; min-height: 0; padding: 10px 12px; overflow-x: auto; }
#map-canvas { background: #0e1a24; border: 1px solid #5a4632; cursor: pointer; align-self: center; flex: 0 0 auto; }
#log-panel { width: 300px; flex: 0 0 300px; overflow-y: auto; background: rgba(20,16,12,0.92); border: 1px solid #5a4632; border-radius: 6px; padding: 8px 10px; font-size: 12px; color: #c8b896; line-height: 1.6; }
#log-panel .log-item { border-bottom: 1px solid rgba(90,70,50,0.3); padding: 2px 0; }
#log-panel .log-item.think { color: #8ab8d8; }
#side-panel { width: 300px; flex: 0 0 300px; overflow-y: auto; background: rgba(28,21,14,0.96); border: 1px solid #8a6f4d; border-radius: 6px; padding: 12px; font-size: 13px; }
#side-panel h3 { color: #e8c88a; font-size: 17px; margin-bottom: 6px; }
#side-panel .panel-tip { color: #6a5c46; text-align: center; padding: 24px 8px; line-height: 1.8; }
#side-panel .stat-row { display: flex; justify-content: space-between; padding: 2px 0; color: #c8b896; }
#side-panel .stat-row b { color: #e8dcc0; font-weight: normal; }
#side-panel .gen-row { padding: 3px 6px; margin: 2px 0; background: #2e2418; border-radius: 3px; display: flex; justify-content: space-between; }
#side-panel .gen-row .gstats { color: #9a8a6a; font-size: 11px; }
#side-panel .gen-row .lv { color: #7ac0d8; font-size: 11px; }
#side-panel .gen-sub { color: #8a7a5c; font-size: 11px; padding: 0 6px 2px; margin-top: -1px; display: flex; justify-content: space-between; }
#side-panel .gen-sub .exp-label { color: #6a9ab0; }
#side-panel .exp-bar { height: 4px; background: #14100c; border-radius: 2px; margin: 0 6px 5px; overflow: hidden; }
#side-panel .exp-fill { height: 100%; background: linear-gradient(90deg, #4a8ac2, #7ac0d8); }
#side-panel .gen-row.captive { border-left: 3px solid #c23b3b; }
#side-panel .captive-btns { display: flex; gap: 4px; padding: 0 0 6px 6px; }
#side-panel .cmd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
#side-panel .sec-title { color: #c9a86a; border-bottom: 1px solid #5a4632; margin: 10px 0 4px; padding-bottom: 2px; font-size: 13px; }

/* 战斗画面 */
#screen-battle { justify-content: flex-start; padding-top: 8px; }
#battle-canvas { background: #22301e; border: 1px solid #5a4632; }
#battle-cmd { display: flex; gap: 8px; padding: 8px; background: #241c14; border: 1px solid #5a4632; border-radius: 6px; margin-top: 8px; }
#battle-log { width: 1056px; max-width: 96vw; height: 84px; overflow-y: auto; background: #14100c; border: 1px solid #3d2f22; border-radius: 4px; margin-top: 8px; padding: 6px 10px; font-size: 12px; color: #c8b896; line-height: 1.6; }

/* 弹窗 */
#modal { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 99; }
#modal-box { background: #241c14; border: 1px solid #8a6f4d; border-radius: 8px; padding: 20px; min-width: 380px; max-width: 640px; max-height: 80vh; overflow-y: auto; }
#modal-box h3 { color: #e8c88a; margin-bottom: 12px; }
#modal-box .row { margin: 8px 0; display: flex; align-items: center; gap: 8px; font-size: 14px; }
#modal-box label { width: 90px; color: #c9a86a; }
#modal-box input[type=text], #modal-box input[type=password] { flex: 1; background: #14100c; border: 1px solid #5a4632; color: #e8dcc0; padding: 6px 8px; border-radius: 4px; font-family: inherit; }
#modal-box .btn-row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
#modal-box .pick-list { display: flex; flex-direction: column; gap: 4px; max-height: 46vh; overflow-y: auto; }
#modal-box .pick-item { padding: 6px 10px; background: #2e2418; border: 1px solid #3d2f22; border-radius: 4px; cursor: pointer; display: flex; justify-content: space-between; font-size: 13px; }
#modal-box .pick-item:hover { border-color: #c9a86a; }
#modal-box .pick-item.sel { border-color: #d8b46a; background: #3d2f1e; }
#modal-box .note { color: #9a8a6a; font-size: 12px; line-height: 1.6; }

/* 滑杆调拨 */
#modal-box .slider-row { gap: 10px; }
#modal-box .slider-row input[type=range] { flex: 1; accent-color: #c9a86a; height: 22px; cursor: pointer; }
#modal-box .slider-row .num { width: 78px; background: #14100c; border: 1px solid #5a4632; color: #e8dcc0; padding: 4px 6px; border-radius: 4px; font-family: inherit; text-align: right; }
#modal-box .squad-preview { min-height: 18px; margin-top: 4px; color: #c9b58a; }

/* 游戏说明 */
#modal-box .help-body { max-width: 560px; font-size: 13px; color: #c8b896; line-height: 1.7; }
#modal-box .help-body .help-h { color: #d8b46a; margin-top: 10px; font-weight: bold; }
#modal-box .help-body b { color: #e8c88a; font-weight: normal; }

.btn.danger { background: linear-gradient(#6b2a22, #4a1d18); border-color: #a05a4a; }
.btn.danger:hover { background: linear-gradient(#7d352b, #5a241e); }
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb { background: #5a4632; border-radius: 4px; }
