/* Lenmory Y1 Flasher — 样式 */
:root {
  --bg: #fafaf8;
  --bg-alt: #f0ede8;
  --text: #2c2c2c;
  --text-light: #666;
  --text-muted: #999;
  --primary: #3d3427;
  --primary-hover: #5a4e3c;
  --accent: #c8a86e;
  --accent-light: #e8d5b0;
  --border: #ddd8d0;
  --card-bg: #fff;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", "Fira Code", "Consolas", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250,250,248,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1000px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 56px;
}
.nav-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; }
.nav-logo { font-size: 22px; }
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a {
  text-decoration: none; color: var(--text-light); font-size: 14px;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }

/* 语言切换（图标 + 当前语言，不抢视觉焦点） */
.lang-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-light);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.lang-btn:hover { border-color: var(--accent-light); color: var(--text); background: #fffdf9; }
.lang-btn .lang-icon { font-size: 13px; line-height: 1; }

/* Hero */
.hero {
  max-width: 1000px; margin: 0 auto;
  display: flex; align-items: center; gap: 48px;
  padding: 80px 24px 60px;
}
.hero-content { flex: 1; }
.hero h1 { font-size: 42px; line-height: 1.2; letter-spacing: -0.5px; }
.hero-sub { color: var(--accent); font-weight: 400; font-size: 0.72em; letter-spacing: 0; }
.hero-desc { margin: 20px 0 28px; font-size: 17px; color: var(--text-light); line-height: 1.8; }
.hero-note { margin-top: 12px; font-size: 13px; color: var(--text-muted); }

.hero-visual { flex-shrink: 0; }

/* Device mock */
.device-mock {
  width: 200px; height: 280px;
  background: var(--primary);
  border-radius: 20px;
  padding: 16px;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.device-screen {
  flex: 1;
  background: #e8e4dc;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.device-text {
  font-size: 28px; font-weight: 700; color: var(--primary);
  text-align: center; line-height: 1.3; opacity: 0.4;
}
.device-btns {
  display: flex; justify-content: center; gap: 16px;
  padding: 12px 0 4px;
}
.device-btn {
  width: 10px; height: 10px;
  background: rgba(255,255,255,0.3);
  border-radius: 50%;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 24px;
  border: none; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 15px; font-weight: 600;
  cursor: pointer; text-decoration: none;
  transition: all 0.2s;
}
.btn-primary {
  background: var(--primary); color: #fff;
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.btn-lg { padding: 14px 36px; font-size: 17px; border-radius: var(--radius); }
.btn-xl { padding: 18px 48px; font-size: 18px; border-radius: var(--radius); font-weight: 700; }
.btn-icon { font-size: 18px; }
.btn-ghost {
  background: transparent;
  color: var(--text-light);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--bg-alt);
  color: var(--text);
  transform: none;
  box-shadow: none;
}
.btn:disabled,
.btn[disabled] {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn-primary:disabled:hover { background: var(--primary); }
.btn-ghost:disabled:hover { background: transparent; color: var(--text-light); }

/* 烧录区域 */
.flash-area {
  text-align: center;
  padding: 16px 0;
}
.flash-cta {
  padding: 24px 0;
}
.flash-hint {
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-muted);
}
.hint-icon { margin-right: 4px; }

/* ── 烧录面板 ───────────────────────────────────────────────────────── */
.flash-panel {
  margin-top: 24px;
  padding: 24px 28px 22px;
  text-align: left;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.panel-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.panel-title strong { font-size: 20px; }
.panel-fw-ver { font-size: 14px; color: var(--text-muted); }
.panel-close {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border: none; background: transparent;
  color: var(--text-muted);
  font-size: 24px; line-height: 1;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.2s, color 0.2s;
}
.panel-close:hover { background: var(--bg-alt); color: var(--text); }

/* 阶段指示 */
.stages {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 10px 22px;
  list-style: none;
  margin: 20px 0 18px;
}
.stages li {
  display: flex; align-items: center; gap: 7px;
  font-size: 14px; color: var(--text-muted);
  transition: color 0.2s;
}
.stage-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s, box-shadow 0.2s;
}
.stages li.is-active { color: var(--text); font-weight: 600; }
.stages li.is-active .stage-dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(200, 168, 110, 0.22);
}
.stages li.is-done { color: var(--text-light); }
.stages li.is-done .stage-dot { background: #7d9a63; }

/* 进度条 */
.progress { margin-bottom: 20px; }
.progress-track {
  height: 8px;
  background: var(--bg-alt);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.25s ease;
}
.progress-meta {
  display: flex; justify-content: space-between;
  margin-top: 8px;
  font-size: 13px; color: var(--text-light);
}

/* 设备信息 */
.device-info {
  display: flex; gap: 32px; flex-wrap: wrap;
  padding: 12px 16px;
  margin-bottom: 20px;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  font-size: 14px;
}
.device-info-item { display: flex; gap: 8px; }
.device-info .k { color: var(--text-muted); }
.device-info .v { font-family: var(--mono); color: var(--text); }

/* 面板区块 */
.panel-block { margin-bottom: 22px; }
.panel-block h4 {
  font-size: 14px; font-weight: 600;
  color: var(--text-light);
  margin-bottom: 10px;
}

/* 固件内容表 */
.parts-table { overflow-x: auto; }
.parts-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.parts-table th {
  text-align: left;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
}
.parts-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-light);
}
.parts-table tr:last-child td { border-bottom: none; }
.parts-table .num { text-align: right; }
.parts-table .mono { font-family: var(--mono); }

/* 数据影响说明 */
.wipe-note {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-light);
}
.wipe-note strong { color: var(--text); }

/* 操作区 */
.panel-actions {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}

/* 状态提示 */
.alert {
  margin-top: 16px;
  padding: 14px 18px;
  border-left: 3px solid;
  border-radius: var(--radius-sm);
  font-size: 14px;
}
.alert p { margin-top: 6px; font-size: 13px; line-height: 1.7; }
.alert-success { background: #f1f6ea; border-color: #7d9a63; color: #455d33; }
.alert-error { background: #fbf0ec; border-color: #c0724a; color: #7d3f22; }
.alert-warn { background: #fdf6e8; border-color: #d0a34e; color: #7a5a1f; }

/* 环境检查提示 */
.env-alert {
  max-width: 760px;
  margin: 0 auto 28px;
  padding: 16px 20px;
  text-align: left;
  background: #fbf0ec;
  border-left: 3px solid #c0724a;
  border-radius: var(--radius-sm);
  color: #7d3f22;
  font-size: 14px;
}
.env-alert p { margin-top: 6px; font-size: 13px; }

/* 不可用的固件卡片 */
.fw-card.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.45);
}
.fw-card.is-disabled:hover { border-color: var(--border); box-shadow: none; }
.fw-unavailable { margin-top: 12px; font-size: 12.5px; color: #a15a3a; }

/* 烧录进行中，禁掉会打断流程的交互 */
body.is-flashing .fw-card { pointer-events: none; }
body.is-flashing .panel-close { opacity: 0.35; pointer-events: none; }

[hidden] { display: none !important; }

/* Sections */
.section {
  max-width: 1000px; margin: 0 auto;
  padding: 60px 24px;
}
.section h2 {
  font-size: 28px; margin-bottom: 12px;
  letter-spacing: -0.3px;
}
.section-desc {
  color: var(--text-light); font-size: 16px;
  margin-bottom: 32px;
}
.section-alt {
  background: var(--bg-alt);
  max-width: none;
}
.section-alt > * { max-width: 1000px; margin-left: auto; margin-right: auto; }

/* Firmware cards */
.firmware-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(258px, 1fr));
  gap: 20px; margin-bottom: 32px;
}
.fw-card {
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.fw-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.fw-card.selected {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}
.fw-card.selected::after {
  content: "✓";
  position: absolute; top: 16px; right: 16px;
  width: 28px; height: 28px;
  background: var(--primary); color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
}
.fw-badge {
  display: inline-block;
  padding: 3px 10px;
  background: var(--accent-light);
  color: var(--primary);
  border-radius: 20px;
  font-size: 12px; font-weight: 600;
  margin-bottom: 12px;
}
.fw-badge-alt { background: #dde8f0; }
.fw-card h3 { font-size: 22px; margin-bottom: 8px; }
.fw-desc { color: var(--text-light); font-size: 14px; margin-bottom: 16px; }
.fw-features {
  list-style: none;
  margin-bottom: 16px;
}
.fw-features li {
  padding: 4px 0 4px 20px;
  position: relative;
  font-size: 14px; color: var(--text-light);
}
.fw-features li::before {
  content: "•";
  position: absolute; left: 6px;
  color: var(--accent); font-weight: 700;
}
.fw-meta {
  display: flex; gap: 16px;
  font-size: 13px; color: var(--text-muted);
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* Flash action — 已合并到 flash-area */

/* Flash log */
.flash-log {
  margin-top: 22px;
  background: #1e1e1e;
  border-radius: var(--radius);
  overflow: hidden;
}
.flash-log summary {
  padding: 12px 20px;
  background: #2a2a2a;
  color: #ccc;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.flash-log summary::-webkit-details-marker { display: none; }
.flash-log summary::after {
  content: "▾";
  float: right;
  color: #888;
  transition: transform 0.2s;
}
.flash-log[open] summary::after { transform: rotate(180deg); }
.flash-log pre {
  margin: 0;
  padding: 16px 20px;
  max-height: 340px;
  overflow-y: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-all;
}
.log-line { color: #b9b9b9; }
.log-line.log-detail { color: #7f7f7f; }
.log-line.log-info { color: #cfe3f5; }
.log-line.log-success { color: #9fd88f; }
.log-line.log-error { color: #f0a08a; }

/* Steps */
.steps {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.step {
  text-align: center;
}
.step-num {
  width: 48px; height: 48px;
  background: var(--primary); color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700;
  margin: 0 auto 16px;
}
.step-body h3 { font-size: 16px; margin-bottom: 8px; }
.step-body p { font-size: 14px; color: var(--text-light); line-height: 1.7; }

/* FAQ */
.faq-list {
  max-width: 720px;
}
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  overflow: hidden;
}
.faq-item summary {
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  list-style: none;
  position: relative;
  transition: background 0.2s;
}
.faq-item summary:hover { background: var(--bg-alt); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute; right: 20px;
  font-size: 18px; color: var(--text-muted);
}
.faq-item[open] summary::after { content: "−"; }
.faq-item p {
  padding: 0 20px 16px;
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.8;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
}
.footer-inner {
  max-width: 1000px; margin: 0 auto;
  text-align: center;
}
.footer-brand {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 700; font-size: 16px;
  margin-bottom: 8px;
}
.footer-note { color: var(--text-muted); font-size: 13px; }
.footer-copy { color: var(--text-muted); font-size: 12px; margin-top: 8px; }

/* Responsive */
@media (max-width: 768px) {
  .hero { flex-direction: column; text-align: center; padding-top: 40px; }
  .hero h1 { font-size: 32px; }
  .firmware-cards { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .nav-links { gap: 16px; }
}
@media (max-width: 480px) {
  .steps { grid-template-columns: 1fr; }
  .nav-links a { font-size: 13px; }
}
