/* =========================================================================
   HMI Studio — components.css
   Buttons, badges, code block, editor mockup, cards, timeline
   ========================================================================= */

/* ---------------- Buttons ---------------- */
.btn {
  --btn-bg: var(--brand-600);
  display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-weight: 600;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease), color .2s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--btn-bg); color: #fff; box-shadow: 0 10px 24px -10px rgba(37,99,235,.7); }
.btn--primary:hover { background: var(--brand-700); color: #fff; box-shadow: 0 14px 30px -10px rgba(37,99,235,.8); }
.btn--ghost { background: transparent; color: var(--brand-700); border-color: var(--brand-200); }
.btn--ghost:hover { background: var(--brand-50); color: var(--brand-700); }
.btn--dark { background: var(--ink-900); color: #fff; }
.btn--dark:hover { background: var(--ink-800); color: #fff; }
.btn--lg { padding: 14px 28px; font-size: 1.02rem; }
.btn svg { width: 18px; height: 18px; }

/* ---------------- Badges / pills ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .82rem; font-weight: 600;
  padding: 6px 13px; border-radius: 999px;
  background: var(--brand-50); color: var(--brand-700);
  border: 1px solid var(--brand-100);
}
.badge--accent { background: #fff7ed; color: var(--accent-600); border-color: #fed7aa; }
.badge--green  { background: #ecfdf5; color: var(--success); border-color: #a7f3d0; }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ---------------- Code block ---------------- */
.code-block {
  background: var(--ink-900);
  color: #e2e8f0;
  border-radius: var(--radius);
  padding: 18px 20px;
  font-family: var(--font-mono);
  font-size: .9rem;
  line-height: 1.7;
  overflow-x: auto;
  position: relative;
}
.code-block .c { color: #64748b; }
.code-block .k { color: #93c5fd; }
.code-block .s { color: #fcd34d; }
.copy-btn {
  position: absolute; top: 10px; right: 10px;
  background: rgba(255,255,255,.1); color: #cbd5e1;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px; padding: 5px 11px; font-size: .78rem; cursor: pointer;
  transition: background .2s var(--ease);
}
.copy-btn:hover { background: rgba(255,255,255,.2); color: #fff; }

/* ---------------- Download card ---------------- */
.dl-card {
  background: var(--surface);
  border: 1px solid var(--ink-100);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-sm);
}
.dl-card .dl-top { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.dl-logo { width: 56px; height: 56px; border-radius: 14px; background: linear-gradient(135deg,var(--brand-500),var(--brand-700)); display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.4rem; }
.dl-logo-img { width: 56px; height: 56px; border-radius: 14px; object-fit: contain; background: var(--brand-50); padding: 5px; border: 1px solid var(--brand-100); }
.dl-meta { font-size: .92rem; color: var(--ink-500); }
.dl-meta strong { color: var(--ink-900); font-size: 1.1rem; }
.spec-list { display: grid; gap: 10px; margin: 18px 0 22px; }
.spec-list div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--ink-100); font-size: .94rem; }
.spec-list div span:first-child { color: var(--ink-500); }
.spec-list div span:last-child { color: var(--ink-800); font-weight: 600; text-align: right; }

/* ---------------- Steps / timeline ---------------- */
.steps { display: grid; gap: 18px; counter-reset: step; }
.step {
  display: grid; grid-template-columns: 44px 1fr; gap: 16px; align-items: start;
  background: var(--surface); border: 1px solid var(--ink-100);
  border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow-sm);
}
.step::before {
  counter-increment: step; content: counter(step);
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--brand-50); color: var(--brand-700); font-weight: 800; font-size: 1.2rem;
}
.step h3 { margin: 4px 0 6px; font-size: 1.08rem; }
.step p { margin: 0; color: var(--ink-500); font-size: .94rem; }

/* ---------------- Doc / prose ---------------- */
.prose { max-width: 760px; }
.prose h2 { margin-top: 38px; }
.prose h3 { margin-top: 26px; }
.prose code { font-size: .88em; }
.prose ul.ticks { display: grid; gap: 10px; margin: 14px 0; }
.prose ul.ticks li { padding-left: 28px; position: relative; color: var(--ink-600); }
.prose ul.ticks li::before {
  content: ""; position: absolute; left: 0; top: 9px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--brand-500) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") center / 10px no-repeat;
}
.callout {
  border-left: 4px solid var(--brand-500);
  background: var(--brand-50);
  padding: 16px 18px; border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--ink-700); font-size: .95rem; margin: 18px 0;
}
.callout--warn { border-color: var(--accent-500); background: #fff7ed; }

/* =========================================================================
   Editor mockup — signature product visual (pure HTML/CSS)
   ========================================================================= */
.editor-mockup {
  border-radius: var(--radius-lg);
  background: #0f172a;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
}
.em-titlebar {
  height: 38px; display: flex; align-items: center; gap: 8px;
  padding: 0 14px; background: #111a2e; border-bottom: 1px solid rgba(255,255,255,.06);
}
.em-dot { width: 11px; height: 11px; border-radius: 50%; }
.em-dot.r { background: #ff5f57; } .em-dot.y { background: #febc2e; } .em-dot.g { background: #28c840; }
.em-title { margin-left: 10px; color: #94a3b8; font-size: .82rem; font-weight: 600; }
.em-body { display: grid; grid-template-columns: 132px 1fr 160px; min-height: 340px; }
.em-col { padding: 14px; }
.em-toolbox { background: #0b1220; border-right: 1px solid rgba(255,255,255,.06); }
.em-toolbox .em-group { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: #475569; margin: 12px 0 8px; }
.em-tool {
  display: flex; align-items: center; gap: 8px;
  font-size: .8rem; color: #cbd5e1; padding: 7px 9px; border-radius: 8px; margin-bottom: 4px;
  background: rgba(255,255,255,.03); border: 1px solid transparent;
}
.em-tool:hover { border-color: rgba(96,165,250,.4); }
.em-tool i { width: 14px; height: 14px; border-radius: 4px; background: linear-gradient(135deg,#60a5fa,#2563eb); display: inline-block; }

.em-canvas {
  position: relative;
  background:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px),
    #0d1626;
  background-size: 22px 22px;
}
.em-control {
  position: absolute; border-radius: 7px; font-size: .72rem; color: #e2e8f0;
  border: 1px solid rgba(96,165,250,.55); background: rgba(37,99,235,.18);
  display: flex; align-items: center; justify-content: center; text-align: center;
  box-shadow: 0 0 0 1px rgba(37,99,235,.25);
}
.em-control.sel { border-color: var(--accent-400); box-shadow: 0 0 0 1px var(--accent-400), 0 0 16px -2px rgba(245,158,11,.6); }
.em-c-text   { left: 26px;  top: 22px;  width: 64px;  height: 22px; background: rgba(148,163,184,.18); border-color: rgba(148,163,184,.5); }
.em-c-gauge { left: 30px;  top: 64px;  width: 92px;  height: 92px; border-radius: 50%; background: radial-gradient(circle at 50% 60%, rgba(16,185,129,.4), rgba(16,185,129,.08)); border-color: #34d399; }
.em-c-tab   { left: 26px;  top: 178px; width: 210px; height: 96px; flex-direction: column; align-items: stretch; padding: 0; overflow: hidden; }
.em-c-tab .tabbar { display: flex; background: rgba(255,255,255,.06); border-bottom: 1px solid rgba(255,255,255,.12); }
.em-c-tab .tabbar span { flex: 1; font-size: .66rem; text-align: center; padding: 4px 0; color: #cbd5e1; }
.em-c-tab .tabbar span.on { color: #fff; background: rgba(96,165,250,.25); }
.em-c-tab .tabbody { flex: 1; }
.em-c-btn   { left: 250px; top: 26px;  width: 84px;  height: 30px; background: linear-gradient(135deg,#2563eb,#1d4ed8); border-color: #60a5fa; border-radius: 999px; font-weight: 700; }
.em-c-chart { left: 250px; top: 76px;  width: 150px; height: 100px; background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.5); align-items: flex-end; gap: 5px; padding: 10px; }
.em-c-chart i { flex: 1; background: linear-gradient(180deg,#fbbf24,#d97706); border-radius: 3px 3px 0 0; display: block; }

.em-props { background: #0b1220; border-left: 1px solid rgba(255,255,255,.06); font-size: .76rem; }
.em-props .em-group { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: #475569; margin: 10px 0 6px; }
.em-prop { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; color: #94a3b8; }
.em-prop b { color: #e2e8f0; font-weight: 600; font-family: var(--font-mono); }
.em-prop.on b { color: var(--accent-400); }
.em-tag { color: var(--accent-400); font-weight: 700; }

/* device frame wrapper for mockup */
.device { filter: drop-shadow(0 30px 60px rgba(15,23,42,.25)); }

/* =========================================================================
   Download page — changelog timeline & version history table
   ========================================================================= */

/* ---- Changelog (更新记录) ---- */
.changelog { position: relative; margin: 8px 0 0; padding-left: 26px; }
.changelog::before {
  content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px;
  width: 2px; background: linear-gradient(var(--brand-300), var(--brand-100));
}
.cl-item { position: relative; padding: 0 0 30px 6px; }
.cl-item::before {
  content: ""; position: absolute; left: -26px; top: 5px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--brand-500);
  box-shadow: 0 0 0 4px var(--brand-50);
}
.cl-item.is-latest::before { background: var(--brand-500); border-color: var(--brand-700); }
.cl-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.cl-version { font-size: 1.18rem; font-weight: 800; color: var(--ink-900); font-family: var(--font-mono); }
.cl-date { font-size: .88rem; color: var(--ink-400); }
.cl-tag {
  font-size: .74rem; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  letter-spacing: .02em;
}
.cl-tag--new     { background: var(--brand-50);   color: var(--brand-700); border: 1px solid var(--brand-100); }
.cl-tag--feature { background: #ecfdf5;          color: var(--success);   border: 1px solid #a7f3d0; }
.cl-tag--fix     { background: #fff7ed;          color: var(--accent-600);border: 1px solid #fed7aa; }
.cl-body { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.cl-body li { position: relative; padding-left: 22px; color: var(--ink-600); font-size: .95rem; }
.cl-body li::before {
  content: ""; position: absolute; left: 4px; top: 9px;
  width: 7px; height: 7px; border-radius: 2px; background: var(--brand-400);
}
.cl-body li.fix::before { background: var(--accent-500); }

/* ---- Version history table (历史版本) ---- */
.ver-table {
  width: 100%; border-collapse: collapse; font-size: .94rem;
  background: var(--surface); border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--ink-100); box-shadow: var(--shadow-sm);
}
.ver-table thead th {
  text-align: left; padding: 14px 18px; font-size: .82rem; font-weight: 700;
  color: var(--ink-500); text-transform: uppercase; letter-spacing: .04em;
  background: var(--ink-50); border-bottom: 1px solid var(--ink-100);
}
.ver-table tbody td { padding: 15px 18px; border-bottom: 1px solid var(--ink-100); color: var(--ink-700); vertical-align: middle; }
.ver-table tbody tr:last-child td { border-bottom: 0; }
.ver-table tbody tr:hover { background: var(--brand-50); }
.ver-table .v-num { font-family: var(--font-mono); font-weight: 800; color: var(--ink-900); }
.ver-table .v-current { display: inline-block; margin-left: 8px; font-size: .7rem; font-weight: 700; color: var(--success); background: #ecfdf5; border: 1px solid #a7f3d0; padding: 2px 8px; border-radius: 999px; }
.ver-table .v-old { display: inline-block; margin-left: 8px; font-size: .7rem; font-weight: 700; color: var(--ink-400); background: var(--ink-100); border: 1px solid var(--ink-200); padding: 2px 8px; border-radius: 999px; }
.ver-table .v-type { font-weight: 600; }
.ver-table .btn--ghost { padding: 8px 16px; font-size: .85rem; }
.ver-table .v-na { color: var(--ink-400); font-size: .85rem; }

