:root { --bg: #e8f5e9; --cell-bg: #f1f8e9; --primary: #4caf50; --dark: #1b5e20; --cell-size: 44px; --gap: 2px; }
* { margin:0; padding:0; box-sizing:border-box; user-select: none; -webkit-tap-highlight-color: transparent; }
body { font-family:'Segoe UI','PingFang SC',system-ui,sans-serif; background:linear-gradient(145deg,#dcedc8 0%,#a5d6a7 100%); min-height:100vh; display:flex; justify-content:center; align-items:center; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.app-container { width:100%; max-width:720px; background:rgba(255,255,255,0.85); backdrop-filter:blur(25px); border-radius:40px; padding:20px; box-shadow:0 30px 50px rgba(0,30,0,0.3); border:1px solid rgba(100,160,100,0.6); color:#2e3b2e; position:relative; }
.home-screen,.game-screen,.select-screen,.level-screen { display:none; }
.home-screen.active,.game-screen.active,.select-screen.active,.level-screen.active { display:block; }
.home-header { display:flex; align-items:center; gap:12px; margin-bottom:16px; flex-wrap:wrap; }
.avatar { width:42px; height:42px; border-radius:50%; background:radial-gradient(circle at 30% 30%,#81c784,#2e7d32); display:flex; align-items:center; justify-content:center; font-size:1.8rem; border:2px solid #fff; box-shadow:0 3px 8px rgba(0,0,0,0.2); cursor:pointer; }
.equipment-row { display:flex; flex-direction:column; align-items:center; gap:2px; }
.equip-badge,.equip-title { font-size:0.75rem; font-weight:bold; white-space:nowrap; cursor:pointer; background:none; border:none; padding:2px 4px; }
.player-name { font-size:0.95rem; font-weight:700; color:#1b5e20; cursor:pointer; }
.clear-btn-top { position:absolute; top:0; right:0; background:none; border:none; font-size:0.9rem; cursor:pointer; color:#999; padding:4px 8px; border-radius:20px; }
.clear-btn-top:hover { color:#e57373; }
.back-btn-top-left { position:absolute; top:5px; left:10px; z-index:10; background:rgba(255,255,255,0.9); border:2px solid #81c784; color:#2e7d32; border-radius:20px; padding:4px 12px; font-size:0.85rem; font-weight:bold; cursor:pointer; }
.home-title { text-align:center; font-size:2rem; font-weight:900; background:linear-gradient(180deg,#2e7d32,#1b5e20); -webkit-background-clip:text; -webkit-text-fill-color:transparent; margin-bottom:10px; }
.big-btn { background:linear-gradient(180deg,#66bb6a,#43a047); border:none; padding:10px 20px; border-radius:40px; font-weight:700; font-size:0.95rem; color:white; cursor:pointer; margin:4px; box-shadow:0 6px 12px rgba(0,60,0,0.2); transition:0.15s; display:inline-flex; align-items:center; gap:6px; }
.big-btn:active { transform:scale(0.96); }
.big-btn.small { padding:6px 14px; font-size:0.8rem; }
.big-btn.danger { background:linear-gradient(180deg,#ef9a9a,#e57373); }
.big-btn:disabled { opacity:0.45; cursor:not-allowed; transform:none; }
.mode-select { display:flex; gap:12px; justify-content:center; margin-top:15px; flex-wrap:wrap; }
.game-header { display:flex; justify-content:space-between; align-items:center; background:#e8f5e9; border-radius:40px; padding:8px 15px; margin-bottom:10px; border:1px solid #81c784; flex-wrap:wrap; gap:6px; }
.timer { font-size:1.6rem; font-weight:800; color:#2e7d32; }
.sudoku-grid { display:grid; gap:var(--gap); background:#1e1e1e; padding:3px; border-radius:14px; justify-content:center; margin:10px auto; width:fit-content; }
.cell { background:var(--cell-bg); aspect-ratio:1; width:var(--cell-size); display:flex; align-items:center; justify-content:center; font-size:calc(var(--cell-size)*0.5); font-weight:700; color:#33691e; border-radius:5px; cursor:pointer; transition:0.12s; }
.cell.fixed { color:#558b2f; background:#dcedc8; cursor:default; }
.cell.selected { box-shadow:0 0 0 3px #43a047; background:#c8e6c9; z-index:2; }
/* 高亮同行、同列、同宫 */
.cell.highlight-row, .cell.highlight-col, .cell.highlight-box { background:#dcedc8; }
.cell.error { background:#ffcdd2; color:#b71c1c; }
.number-pad { display:flex; justify-content:center; gap:8px; margin:12px 0; flex-wrap:wrap; }
.num-btn { background:#81c784; border:none; color:white; font-size:1.4rem; width:48px; height:48px; border-radius:16px; font-weight:bold; cursor:pointer; box-shadow:0 4px 10px rgba(0,40,0,0.2); }
.num-btn:active { background:#2e7d32; transform:scale(0.92); }
.tools { display:flex; justify-content:center; gap:8px; margin:8px 0; }
.tool-btn { background:#fff; border:2px solid #81c784; color:#2e7d32; padding:8px 14px; border-radius:25px; display:flex; align-items:center; gap:5px; cursor:pointer; font-weight:700; box-shadow:0 3px 6px rgba(0,0,0,0.1); }
.tool-btn:disabled { opacity:0.4; cursor:not-allowed; }
.game-bottom-bar { display:flex; justify-content:space-between; align-items:center; margin-top:8px; }
.pause-btn-corner { background:#fff; border:2px solid #43a047; font-size:1.4rem; border-radius:50%; width:48px; height:48px; display:flex; align-items:center; justify-content:center; cursor:pointer; }
.modal { position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.45); backdrop-filter:blur(8px); display:flex; align-items:center; justify-content:center; z-index:200; }
.modal-content { background:#f1f8e9; padding:22px; border-radius:30px; max-width:700px; width:90%; max-height:82vh; overflow-y:auto; border:2px solid #81c784; box-shadow:0 25px 50px rgba(0,0,0,0.4); position:relative; }
.modal-close-btn { position:absolute; top:10px; right:15px; background:none; border:none; font-size:1.8rem; cursor:pointer; color:#888; line-height:1; z-index:5; }
.modal-close-btn:hover { color:#e57373; }
.tab-bar { display:flex; gap:4px; margin-bottom:12px; }
.tab-btn { flex:1; padding:8px; border-radius:20px; border:2px solid #81c784; background:#fff; color:#2e7d32; font-weight:700; cursor:pointer; text-align:center; }
.tab-btn.active { background:#4caf50; color:#fff; border-color:#2e7d32; }
.sort-bar { display:flex; gap:8px; margin:12px 0; justify-content:center; flex-wrap:wrap; }
.sort-btn { background:#e8f5e9; border:2px solid #81c784; }
.sort-btn.active { background:#4caf50; color:white; }
.progress-bar { height:8px; background:#cfd8dc; border-radius:10px; margin:4px 0; overflow:hidden; }
.progress-fill { height:100%; background:linear-gradient(90deg,#66bb6a,#2e7d32); border-radius:10px; }
.avatar-grid { display:flex; flex-wrap:wrap; gap:8px; justify-content:center; margin:10px 0; }
.avatar-option { width:44px; height:44px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:1.7rem; cursor:pointer; border:3px solid transparent; background:#e8f5e9; transition:0.15s; }
.avatar-option.selected { border-color:#2e7d32; background:#c8e6c9; transform:scale(1.1); }
.list-item { display:flex; flex-direction:column; padding:8px 12px; background:#fff; border-radius:12px; margin:6px 0; }
.list-item .row { display:flex; justify-content:space-between; align-items:center; }
.list-item .cond { font-size:0.7rem; color:#666; margin-top:2px; }
.list-item .time { font-size:0.7rem; color:#999; }
.title-text,.badge-text { background:none; border:none; font-weight:bold; padding:2px 4px; white-space:nowrap; display:inline-block; }
.reward-toast { position:fixed; top:30px; left:50%; transform:translateX(-50%); background:#2e7d32; color:#fff; padding:15px 30px; border-radius:30px; font-size:1.2rem; font-weight:bold; z-index:300; box-shadow:0 10px 20px rgba(0,0,0,0.3); opacity:1; transition:opacity 0.5s; pointer-events:none; }
.reward-toast.fade-out { opacity:0; }
.level-pagination { display:flex; justify-content:center; align-items:center; gap:12px; margin:10px 0; }
.level-grid { display:flex; flex-wrap:wrap; gap:10px; justify-content:center; max-height:60vh; overflow-y:auto; padding:6px; }
.level-btn { width:55px; height:55px; border-radius:14px; border:2px solid #81c784; background:#fff; color:#2e7d32; font-weight:bold; font-size:0.9rem; cursor:pointer; display:flex; align-items:center; justify-content:center; transition:0.15s; position:relative; }
.level-btn.locked { background:#e0e0e0; color:#aaa; border-color:#ccc; cursor:not-allowed; }
.level-btn.completed { background:#c8e6c9; }
.level-btn .lock-icon { position:absolute; font-size:1.2rem; }
.star-container { display:flex; gap:4px; justify-content:center; margin:8px 0; }
.star { font-size:1.8rem; color:#ffd700; }
.star.empty { color:#ccc; }
.difficulty-select { background:#f1f8e9; border:2px solid #81c784; border-radius:24px; padding:4px 12px; font-size:0.8rem; font-weight:bold; color:#2e7d32; cursor:pointer; outline:none; transition:0.2s; }
.sound-toggle { background:#fff; border:2px solid #81c784; border-radius:30px; padding:4px 12px; font-size:0.8rem; font-weight:bold; cursor:pointer; margin-left:8px; display:inline-flex; align-items:center; gap:5px; }
.rank-table { width:100%; border-collapse: collapse; font-size:0.8rem; }
.rank-table th, .rank-table td { padding:8px 4px; text-align:center; border-bottom:1px solid #c8e6c9; }
.rank-table th { background:#c8e6c9; color:#1b5e20; }
.rank-avatar { font-size:1.3rem; margin-right:5px; vertical-align:middle; }
.pagination { display:flex; justify-content:center; gap:12px; margin-top:15px; align-items:center; }