/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0f1117;
  --bg-card: #1a1d27;
  --bg-card-alt: #22263a;
  --border: #2e3348;
  --border-light: #3a3f5c;
  --text: #e2e4ed;
  --text-muted: #8b8fa8;
  --text-dim: #5e6380;
  --accent: #f5a623;
  --accent-dim: #c4841a;
  --accent-glow: rgba(245,166,35,0.15);
  --green: #34d399;
  --red: #f87171;
  --blue: #60a5fa;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
}
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
select { font-family: inherit; }

/* ===== Layout ===== */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.site-header { background: var(--bg-card); border-bottom: 1px solid var(--border); padding: 14px 0; position: sticky; top: 0; z-index: 100; }
.nav-wrap { display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 8px; color: var(--accent); font-weight: 700; font-size: 1.15rem; }
.logo:hover { text-decoration: none; }
.logo-icon { color: var(--accent); }
.main-nav { display: flex; gap: 20px; }
.main-nav a { color: var(--text-muted); font-size: 0.9rem; font-weight: 500; }
.main-nav a:hover { color: var(--text); text-decoration: none; }

.main-layout { display: flex; gap: 28px; padding: 28px 20px; flex: 1; max-width: 1200px; margin: 0 auto; width: 100%; }

/* ===== Control Panel ===== */
.control-panel { width: 280px; flex-shrink: 0; }
.panel-sticky { position: sticky; top: 72px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.panel-title { font-size: 1.05rem; font-weight: 600; margin-bottom: 16px; color: var(--accent); }
.field-group { margin-bottom: 14px; }
.field-label { display: block; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 4px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.field-select { width: 100%; background: var(--bg); border: 1px solid var(--border); color: var(--text); padding: 8px 10px; border-radius: var(--radius-sm); font-size: 0.9rem; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%238b8fa8' stroke-width='2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.field-select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.panel-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.btn { padding: 10px 16px; border-radius: var(--radius-sm); font-size: 0.875rem; font-weight: 600; border: 1px solid transparent; transition: all 0.15s; text-align: center; }
.btn-primary { background: var(--accent); color: #1a1a1a; }
.btn-primary:hover { background: var(--accent-dim); }
.btn-secondary { background: var(--bg); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--accent); }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--text-muted); }
.btn-small { padding: 6px 12px; font-size: 0.78rem; }
.save-status { font-size: 0.8rem; color: var(--green); margin-top: 8px; min-height: 1.2em; }

.history-block { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 14px; }
.history-title { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }
.history-list { list-style: none; max-height: 160px; overflow-y: auto; }
.history-list li { padding: 6px 8px; border-radius: var(--radius-sm); font-size: 0.78rem; color: var(--text-muted); cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.history-list li:hover { background: var(--bg-card-alt); color: var(--text); }
.history-list li + li { margin-top: 2px; }
.history-empty { font-size: 0.78rem; color: var(--text-dim); font-style: italic; }

/* ===== Checklist Area ===== */
.checklist-area { flex: 1; min-width: 0; }
.checklist-meta { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 12px; }
.progress-bar { width: 100%; height: 8px; background: var(--bg-card); border-radius: 4px; overflow: hidden; margin-bottom: 6px; }
.progress-fill { height: 100%; background: var(--accent); width: 0%; transition: width 0.3s ease; border-radius: 4px; }
.progress-text { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 20px; }

.checklist-section { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; overflow: hidden; }
.checklist-section-header { padding: 14px 18px; display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.checklist-section-header:hover { background: var(--bg-card-alt); }
.section-toggle { font-size: 1.1rem; color: var(--accent); width: 20px; text-align: center; flex-shrink: 0; }
.section-heading { font-size: 1rem; font-weight: 600; }
.section-count { font-size: 0.78rem; color: var(--text-muted); margin-left: auto; }

.checklist-items { list-style: none; border-top: 1px solid var(--border); }
.checklist-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); transition: background 0.1s; }
.checklist-item:last-child { border-bottom: none; }
.checklist-item:hover { background: var(--bg-card-alt); }
.checklist-item.done .item-text { text-decoration: line-through; color: var(--text-dim); }
.checkbox { width: 20px; height: 20px; border: 2px solid var(--border-light); border-radius: 4px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; margin-top: 2px; transition: all 0.15s; }
.checklist-item.done .checkbox { background: var(--accent); border-color: var(--accent); }
.checklist-item.done .checkbox::after { content: '✓'; color: #1a1a1a; font-size: 0.8rem; font-weight: 700; }
.item-text { font-size: 0.9rem; line-height: 1.5; }
.item-note { display: block; font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.item-tag { display: inline-block; font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; padding: 1px 6px; border-radius: 3px; margin-left: 6px; vertical-align: middle; }
.tag-diy { background: rgba(96,165,250,0.15); color: var(--blue); }
.tag-shop { background: rgba(52,211,153,0.15); color: var(--green); }
.tag-both { background: rgba(245,166,35,0.15); color: var(--accent); }

/* ===== Info Sections ===== */
.scenario-block, .mistakes-block, .rust-block, .tips-block, .accessory-block { margin-top: 32px; }
.section-heading { font-size: 1.15rem; font-weight: 700; margin-bottom: 14px; color: var(--accent); }
.scenario-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.scenario-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.scenario-card h3 { font-size: 1rem; margin-bottom: 10px; }
.scenario-card p { font-size: 0.88rem; color: var(--text-muted); line-height: 1.65; margin-bottom: 8px; }
.scenario-card p:last-child { margin-bottom: 0; }

.mistakes-list { list-style: none; }
.mistakes-list li { padding: 10px 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.88rem; color: var(--text-muted); line-height: 1.6; }
.mistakes-list li + li { margin-top: 8px; }
.mistakes-list li strong { color: var(--text); }

.rust-block p { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 10px; }

.tips-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.tips-table th { text-align: left; padding: 10px 14px; background: var(--bg-card-alt); color: var(--accent); font-weight: 600; border-bottom: 2px solid var(--border); }
.tips-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text-muted); }
.tips-table tr:hover td { background: var(--bg-card-alt); color: var(--text); }

.accessory-block p { font-size: 0.88rem; color: var(--text-muted); line-height: 1.65; margin-bottom: 8px; }
.accessory-block p:last-child { margin-bottom: 0; }

/* ===== Footer ===== */
.site-footer { background: var(--bg-card); border-top: 1px solid var(--border); margin-top: 40px; padding: 28px 0 0; }
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.footer-brand { font-weight: 700; font-size: 1.05rem; color: var(--accent); }
.footer-tagline { font-size: 0.82rem; color: var(--text-muted); margin-top: 4px; }
.footer-heading { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.footer-links { list-style: none; }
.footer-links li + li { margin-top: 4px; }
.footer-links a { font-size: 0.85rem; color: var(--text-muted); }
.footer-links a:hover { color: var(--text); }
.footer-bottom { padding: 14px 0; margin-top: 20px; border-top: 1px solid var(--border); text-align: center; }
.footer-bottom p { font-size: 0.78rem; color: var(--text-dim); }

/* ===== Print ===== */
@media print {
  body { background: #fff; color: #111; font-size: 12px; }
  .site-header, .control-panel, .site-footer, .save-status, .history-block, .panel-actions { display: none !important; }
  .main-layout { display: block; padding: 0; }
  .checklist-section { break-inside: avoid; border: 1px solid #ccc; margin-bottom: 12px; }
  .checklist-section-header { padding: 8px 12px; }
  .checklist-item { padding: 6px 12px; }
  .section-heading, .section-count { color: #111; }
  .scenario-card { break-inside: avoid; border: 1px solid #ccc; }
  .checklist-meta { color: #555; }
  .progress-bar, .progress-text { display: none; }
  .scenario-block, .mistakes-block, .rust-block, .tips-block, .accessory-block { break-inside: avoid; }
  .tips-table th { background: #eee; color: #111; }
  .tips-table td { color: #333; }
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .main-layout { flex-direction: column; }
  .control-panel { width: 100%; position: static; }
  .panel-sticky { position: static; }
  .scenario-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
  .main-nav { gap: 12px; }
  .main-nav a { font-size: 0.82rem; }
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
