*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0a0a0f; --bg2: #12121a; --bg3: #1a1a28;
  --surface: #1e1e2e; --surface2: #252538;
  --border: #2a2a40; --text: #e0dfe4; --text2: #9896a8;
  --accent: #e63946; --accent2: #ff6b6b;
  --gold: #ffd700; --gold2: #ffaa00;
  --blue: #4cc9f0; --purple: #7b2ff7;
  --green: #06d6a0; --orange: #ff9f1c;
  --font: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-jp: 'Noto Serif JP', 'Yu Mincho', serif;
}

html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); overflow-x: hidden; line-height: 1.7; }

#particles { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }

/* Sidebar */
#sidebar {
  position: fixed; left: 0; top: 0; width: 220px; height: 100vh;
  background: linear-gradient(180deg, #0d0d15, #151520);
  border-right: 1px solid var(--border); z-index: 100;
  display: flex; flex-direction: column; padding: 24px 0;
}
.logo { text-align: center; padding: 0 20px 24px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.logo-icon { font-size: 28px; }
.logo-text { font-family: var(--font-jp); font-size: 22px; font-weight: 700; color: var(--gold); margin-left: 8px; letter-spacing: 4px; }
#sidebar ul { list-style: none; padding: 0 12px; }
#sidebar li { margin-bottom: 4px; }
.nav-link {
  display: block; padding: 10px 16px; color: var(--text2); text-decoration: none;
  border-radius: 8px; font-size: 14px; transition: all 0.25s; position: relative;
}
.nav-link:hover { color: var(--text); background: var(--surface); }
.nav-link.active { color: var(--gold); background: rgba(255,215,0,0.08); }
.nav-link.active::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 60%; background: var(--gold); border-radius: 0 3px 3px 0;
}

/* Main */
#content { margin-left: 220px; min-height: 100vh; position: relative; z-index: 1; }
.section { padding: 80px 60px; min-height: 100vh; opacity: 0; transform: translateY(30px); transition: opacity 0.6s, transform 0.6s; }
.section.visible { opacity: 1; transform: translateY(0); }

/* Hero */
.hero-section {
  display: flex; align-items: center; justify-content: center; text-align: center;
  background: radial-gradient(ellipse at center, rgba(230,57,70,0.08), transparent 70%);
  min-height: 100vh; opacity: 1; transform: none;
}
.hero-title { font-family: var(--font-jp); font-size: 80px; font-weight: 900; line-height: 1.2; letter-spacing: 12px; }
.char, .subtitle-char { display: inline-block; opacity: 0; transform: translateY(40px); animation: charIn 0.6s forwards; animation-delay: calc(var(--i) * 0.12s + 0.3s); }
.char { color: var(--gold); text-shadow: 0 0 40px rgba(255,215,0,0.4); }
.subtitle-char { color: var(--accent); text-shadow: 0 0 40px rgba(230,57,70,0.4); font-size: 64px; }
@keyframes charIn { to { opacity: 1; transform: translateY(0); } }
.hero-desc { margin-top: 24px; font-size: 18px; color: var(--text2); letter-spacing: 2px; opacity: 0; animation: fadeIn 0.8s 1.2s forwards; }
.cta-btn {
  display: inline-block; margin-top: 40px; padding: 14px 40px;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff;
  text-decoration: none; border-radius: 50px; font-size: 16px; font-weight: 600;
  letter-spacing: 2px; transition: all 0.3s; opacity: 0; animation: fadeIn 0.8s 1.5s forwards;
  box-shadow: 0 4px 20px rgba(230,57,70,0.3);
}
.cta-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(230,57,70,0.5); }
@keyframes fadeIn { to { opacity: 1; } }

/* Section Titles */
.section-title { font-family: var(--font-jp); font-size: 36px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 16px; }
.title-deco {
  display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--accent), var(--gold2)); border-radius: 12px;
  font-size: 20px; color: #fff; font-weight: 900;
}
.section-desc { color: var(--text2); font-size: 15px; margin-bottom: 40px; }

/* AI Advisor */
.ai-container { max-width: 800px; }
.ai-chat {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 24px; max-height: 500px; overflow-y: auto; margin-bottom: 16px;
  display: flex; flex-direction: column; gap: 16px;
}
.ai-message { display: flex; gap: 12px; animation: msgIn 0.3s ease; }
.ai-message.user-msg { flex-direction: row-reverse; }
@keyframes msgIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.msg-avatar {
  width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center;
  justify-content: center; font-size: 20px; flex-shrink: 0;
}
.ai-msg .msg-avatar { background: linear-gradient(135deg, var(--purple), var(--blue)); }
.user-msg .msg-avatar { background: linear-gradient(135deg, var(--accent), var(--gold2)); }
.msg-body { flex: 1; max-width: calc(100% - 60px); }
.msg-content {
  padding: 14px 18px; border-radius: 12px; font-size: 14px; line-height: 1.8;
  white-space: pre-wrap; word-break: break-word;
}
.ai-msg .msg-content { background: var(--bg2); border: 1px solid var(--border); }
.user-msg .msg-content { background: rgba(230,57,70,0.12); border: 1px solid rgba(230,57,70,0.2); text-align: right; }

.ai-quick-asks { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.quick-btn {
  padding: 8px 16px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; color: var(--text2); font-size: 13px; cursor: pointer; transition: all 0.25s;
}
.quick-btn:hover { border-color: var(--gold); color: var(--gold); background: rgba(255,215,0,0.05); }

.ai-input-form { display: flex; gap: 12px; }
#aiInput {
  flex: 1; padding: 14px 20px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; color: var(--text); font-size: 15px; outline: none; transition: border-color 0.25s;
  font-family: var(--font);
}
#aiInput:focus { border-color: var(--gold); }
#aiInput::placeholder { color: var(--text2); }
#aiSend {
  width: 50px; height: 50px; border-radius: 12px; border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff;
  font-size: 18px; cursor: pointer; transition: all 0.25s; display: flex; align-items: center; justify-content: center;
}
#aiSend:hover { transform: scale(1.05); box-shadow: 0 4px 16px rgba(230,57,70,0.4); }
#aiSend:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.typing-dots { display: inline-flex; gap: 4px; padding: 8px 0; }
.typing-dots span {
  width: 8px; height: 8px; background: var(--text2); border-radius: 50%;
  animation: dotPulse 1.2s infinite; opacity: 0.4;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotPulse { 0%, 80%, 100% { opacity: 0.4; transform: scale(1); } 40% { opacity: 1; transform: scale(1.2); } }

.ai-analyze-btn {
  width: 100%; padding: 14px; margin-top: 12px; background: linear-gradient(135deg, var(--purple), var(--blue));
  border: none; border-radius: 12px; color: #fff; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all 0.3s; font-family: var(--font);
}
.ai-analyze-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(123,47,247,0.4); }

/* Damage Grid */
.damage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 24px; margin-bottom: 40px; }
.damage-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; transition: transform 0.3s, box-shadow 0.3s; }
.damage-card:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0,0,0,0.4); }
.card-header { padding: 20px 24px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--border); }
.card-panel .card-header { background: linear-gradient(135deg, rgba(76,201,240,0.1), transparent); }
.card-atk .card-header { background: linear-gradient(135deg, rgba(230,57,70,0.15), transparent); }
.card-indep .card-header { background: linear-gradient(135deg, rgba(255,159,28,0.15), transparent); }
.card-boost .card-header { background: linear-gradient(135deg, rgba(123,47,247,0.15), transparent); }
.card-vuln .card-header { background: linear-gradient(135deg, rgba(6,214,160,0.15), transparent); }
.card-icon { font-size: 24px; }
.card-header h3 { font-size: 18px; font-weight: 700; }
.card-body { padding: 20px 24px; }
.sub-section { margin-bottom: 16px; }
.sub-section h4 { font-size: 14px; color: var(--gold); margin-bottom: 8px; letter-spacing: 1px; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini-table tr { border-bottom: 1px solid rgba(255,255,255,0.05); }
.mini-table td { padding: 6px 0; }
.mini-table td:first-child { color: var(--blue); width: 80px; font-weight: 600; }
.note-text { font-size: 13px; color: var(--text2); line-height: 1.6; }
.note-text.small { font-size: 12px; margin-top: 6px; }
.note-text.warn { color: var(--orange); font-weight: 500; margin-bottom: 12px; }
.buff-tag { display: inline-block; padding: 4px 12px; background: rgba(255,215,0,0.1); border: 1px solid rgba(255,215,0,0.2); border-radius: 20px; font-size: 13px; color: var(--gold); }
.buff-tag .val { font-weight: 700; margin-left: 4px; }
.buff-list { display: flex; flex-direction: column; gap: 6px; }
.buff-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: rgba(255,255,255,0.02); border-radius: 8px; font-size: 13px; transition: background 0.2s; }
.buff-item:hover { background: rgba(255,255,255,0.05); }
.buff-name { flex: 1; }
.buff-val { font-weight: 700; color: var(--blue); min-width: 60px; text-align: right; }
.buff-val.hot { color: var(--accent2); }
.buff-note { font-size: 11px; color: var(--text2); }

/* Formula */
.formula-box { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 32px; margin-top: 32px; }
.formula-box h3 { font-size: 20px; margin-bottom: 20px; }
.formula { text-align: center; padding: 24px; background: var(--bg2); border-radius: 12px; margin-bottom: 20px; }
.formula code { font-size: 22px; font-weight: 700; color: var(--gold); letter-spacing: 2px; }
.formula-notes p { font-size: 14px; color: var(--text2); margin-bottom: 6px; padding-left: 8px; }
.highlight { color: var(--accent2); font-weight: 700; }
.warn-text { color: var(--accent); }

/* Calculator */
.calc-container { display: grid; grid-template-columns: 1fr 340px; gap: 32px; margin-top: 32px; }
.calc-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.calc-group { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.calc-group h4 { font-size: 14px; color: var(--gold); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.calc-check { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13px; color: var(--text2); cursor: pointer; transition: color 0.2s; }
.calc-check:hover { color: var(--text); }
.calc-check input { accent-color: var(--accent); width: 16px; height: 16px; }
.calc-result { position: sticky; top: 40px; align-self: start; }
.result-display { background: linear-gradient(135deg, var(--surface), var(--bg3)); border: 1px solid var(--border); border-radius: 16px; padding: 32px; text-align: center; margin-bottom: 16px; }
.result-label { font-size: 14px; color: var(--text2); margin-bottom: 8px; }
.result-value { font-size: 56px; font-weight: 900; color: var(--gold); text-shadow: 0 0 30px rgba(255,215,0,0.3); transition: all 0.3s; }
.result-percent { font-size: 24px; color: var(--accent2); font-weight: 700; margin-top: 4px; }
.result-breakdown { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; font-size: 12px; color: var(--text2); line-height: 1.8; }

/* Chart */
.chart-tabs { display: flex; gap: 8px; margin-bottom: 24px; margin-top: 32px; }
.chart-tab { padding: 10px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; color: var(--text2); font-size: 14px; cursor: pointer; transition: all 0.25s; }
.chart-tab:hover { border-color: var(--gold); color: var(--text); }
.chart-tab.active { background: rgba(255,215,0,0.1); border-color: var(--gold); color: var(--gold); }
.chart-container { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 24px; height: 400px; }
.chart-advice { margin-top: 16px; padding: 16px 20px; background: rgba(255,159,28,0.08); border: 1px solid rgba(255,159,28,0.2); border-radius: 12px; font-size: 14px; color: var(--orange); }

/* Duration */
.duration-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-top: 32px; }
.duration-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 24px; }
.duration-panel h3 { font-size: 18px; margin-bottom: 20px; }
.duration-bars { display: flex; flex-direction: column; gap: 12px; }
.dur-item { display: flex; align-items: center; gap: 12px; }
.dur-label { width: 140px; font-size: 13px; color: var(--text2); text-align: right; flex-shrink: 0; }
.dur-bar-wrap { flex: 1; height: 28px; background: var(--bg2); border-radius: 14px; overflow: hidden; }
.dur-bar { height: 100%; border-radius: 14px; display: flex; align-items: center; justify-content: flex-end; padding-right: 12px; font-size: 12px; font-weight: 700; color: #fff; width: 0; transition: width 1.2s cubic-bezier(0.22,1,0.36,1); }
.dur-bar.buff-bar { background: linear-gradient(90deg, var(--accent), var(--gold2)); }
.dur-bar.debuff-bar { background: linear-gradient(90deg, var(--purple), var(--blue)); }
.dur-note { font-size: 11px; color: var(--text2); width: 120px; flex-shrink: 0; }

/* Boss Plan */
.plan-cards { display: flex; flex-direction: column; gap: 24px; margin-top: 32px; }
.plan-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 32px; position: relative; overflow: hidden; }
.plan-card.extreme { border-color: rgba(230,57,70,0.3); }
.plan-card.extreme::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--accent), var(--gold)); }
.plan-card.safe { border-color: rgba(6,214,160,0.3); }
.plan-card.safe::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--green), var(--blue)); }
.plan-badge { display: inline-block; padding: 4px 16px; background: rgba(230,57,70,0.15); color: var(--accent2); border-radius: 20px; font-size: 12px; font-weight: 700; margin-bottom: 12px; }
.plan-badge.safe-badge { background: rgba(6,214,160,0.15); color: var(--green); }
.plan-card h3 { font-size: 16px; color: var(--text2); margin-bottom: 20px; }
.plan-flow { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.flow-step { padding: 8px 16px; background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; font-size: 14px; font-weight: 600; transition: all 0.3s; }
.flow-step:hover { border-color: var(--gold); background: rgba(255,215,0,0.08); }
.highlight-step { border-color: var(--accent); color: var(--accent2); background: rgba(230,57,70,0.08); }
.flow-arrow { color: var(--gold); font-size: 18px; font-weight: 700; }

/* Notes */
.notes-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; margin-top: 32px; }
.note-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 24px; transition: transform 0.3s, box-shadow 0.3s; }
.note-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
.note-card h4 { font-size: 16px; margin-bottom: 12px; color: var(--gold); }
.note-card ul { list-style: none; }
.note-card li { font-size: 13px; color: var(--text2); padding: 4px 0 4px 16px; position: relative; line-height: 1.7; }
.note-card li::before { content: '·'; position: absolute; left: 0; color: var(--accent); font-weight: 700; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* Responsive */
@media (max-width: 1200px) { .calc-container { grid-template-columns: 1fr; } .calc-result { position: static; } }
@media (max-width: 900px) {
  #sidebar { transform: translateX(-100%); }
  #content { margin-left: 0; }
  .section { padding: 60px 24px; }
  .hero-title { font-size: 48px; }
  .subtitle-char { font-size: 40px; }
  .damage-grid, .duration-grid { grid-template-columns: 1fr; }
  .calc-panel { grid-template-columns: 1fr; }
}


/* Multiply/Add Relation Table */
.multiply-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 24px; margin-top: 32px; }
.multiply-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.multiply-card-multi .card-header { background: linear-gradient(135deg, rgba(230,57,70,0.15), transparent); }
.multiply-card-add .card-header { background: linear-gradient(135deg, rgba(76,201,240,0.15), transparent); }
.multiply-card-special .card-header { background: linear-gradient(135deg, rgba(255,215,0,0.15), transparent); }
.relation-list { display: flex; flex-direction: column; gap: 8px; }
.relation-item {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  background: rgba(255,255,255,0.02); border-radius: 8px; font-size: 13px;
  transition: background 0.2s, transform 0.2s;
}
.relation-item:hover { background: rgba(255,255,255,0.05); transform: translateX(4px); }
.rel-a { font-weight: 700; color: var(--gold); min-width: 80px; }
.rel-op { font-weight: 900; font-size: 16px; width: 24px; text-align: center; }
.relation-item.multi .rel-op { color: var(--accent2); }
.relation-item.add .rel-op { color: var(--blue); }
.relation-item.special .rel-op { color: var(--gold); }
.rel-b { flex: 1; color: var(--text); }
.rel-proof { font-size: 11px; color: var(--text2); min-width: 80px; text-align: right; }

/* Test Data Table */
.test-data-table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 14px; }
.test-data-table thead { background: var(--bg2); }
.test-data-table th { padding: 12px 16px; text-align: left; color: var(--gold); font-weight: 600; border-bottom: 2px solid var(--border); }
.test-data-table td { padding: 10px 16px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.test-data-table td:nth-child(2), .test-data-table td:nth-child(3) { text-align: right; font-weight: 600; color: var(--blue); }
.test-data-table .hot-row td { color: var(--orange); }
.test-data-table .extreme-row td { color: var(--accent2); font-weight: 700; font-size: 15px; }
.test-data-table tr:hover td { background: rgba(255,255,255,0.03); }

@media (max-width: 900px) {
  .multiply-grid { grid-template-columns: 1fr; }
}


/* Markdown rendered content in AI chat */
.md-body { white-space: normal; }
.md-body p { margin: 0 0 8px; }
.md-body p:last-child { margin-bottom: 0; }
.md-body h1, .md-body h2, .md-body h3, .md-body h4 { color: var(--gold); margin: 12px 0 6px; font-size: 15px; }
.md-body ul, .md-body ol { padding-left: 20px; margin: 6px 0; }
.md-body li { margin-bottom: 4px; }
.md-body code {
  background: rgba(255,215,0,0.1); color: var(--gold); padding: 2px 6px;
  border-radius: 4px; font-size: 13px; font-family: 'SF Mono', 'Fira Code', monospace;
}
.md-body pre { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; margin: 8px 0; overflow-x: auto; }
.md-body pre code { background: none; padding: 0; color: var(--text); }
.md-body strong { color: var(--accent2); font-weight: 700; }
.md-body em { color: var(--blue); }
.md-body blockquote { border-left: 3px solid var(--gold); padding-left: 12px; margin: 8px 0; color: var(--text2); }
.md-body table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 13px; }
.md-body th { background: var(--bg); color: var(--gold); padding: 8px; text-align: left; border-bottom: 2px solid var(--border); }
.md-body td { padding: 6px 8px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.md-body hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.md-body a { color: var(--blue); text-decoration: underline; }


/* ===== 大一统增伤模拟器 ===== */
#damage-sim { padding-top: 60px; }

.sim-result-bar {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(135deg, #0d0d18 0%, #1a1028 50%, #0d0d18 100%);
  border: 1px solid var(--border); border-radius: 20px;
  padding: 24px 32px 16px; margin-bottom: 32px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,215,0,0.1);
}
.sim-result-inner {
  display: flex; align-items: center; justify-content: center; gap: 24px; flex-wrap: wrap;
}
.sim-base-input { text-align: center; }
.sim-base-input label { display: block; font-size: 12px; color: var(--text2); margin-bottom: 4px; }
.sim-base-input input {
  width: 120px; padding: 10px 12px; background: var(--bg2); border: 2px solid var(--border);
  border-radius: 10px; color: var(--gold); font-size: 24px; font-weight: 700;
  text-align: center; outline: none; font-family: var(--font); transition: border-color 0.3s;
}
.sim-base-input input:focus { border-color: var(--gold); }
.sim-arrow { font-size: 28px; color: var(--text2); font-weight: 300; }
.sim-final { text-align: center; }
.sim-final-label { font-size: 12px; color: var(--text2); margin-bottom: 4px; }
.sim-final-value {
  font-size: 52px; font-weight: 900; color: var(--accent2);
  text-shadow: 0 0 40px rgba(230,57,70,0.5), 0 0 80px rgba(230,57,70,0.2);
  transition: all 0.3s; min-width: 160px; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.sim-final-value.glow-gold { color: var(--gold); text-shadow: 0 0 40px rgba(255,215,0,0.6), 0 0 80px rgba(255,215,0,0.3); }
.sim-final-value.glow-extreme { color: #ff4444; text-shadow: 0 0 50px rgba(255,0,0,0.7), 0 0 100px rgba(255,0,0,0.3); animation: pulseGlow 1.5s infinite; }
@keyframes pulseGlow {
  0%, 100% { text-shadow: 0 0 50px rgba(255,0,0,0.7), 0 0 100px rgba(255,0,0,0.3); }
  50% { text-shadow: 0 0 70px rgba(255,0,0,0.9), 0 0 140px rgba(255,0,0,0.5); }
}
.sim-multiplier-box, .sim-pct-box { text-align: center; }
.sim-multi-label, .sim-pct-label { font-size: 12px; color: var(--text2); margin-bottom: 4px; }
.sim-multi-value { font-size: 32px; font-weight: 800; color: var(--gold); }
.sim-pct-value { font-size: 32px; font-weight: 800; color: var(--green); }
.sim-formula-bar {
  margin-top: 12px; padding: 10px 16px; background: var(--bg2); border-radius: 10px;
  font-size: 12px; color: var(--text2); text-align: center; line-height: 1.6;
  font-family: 'SF Mono', 'Fira Code', monospace; word-break: break-all;
}

/* Sim Grid */
.sim-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-bottom: 32px; }
.sim-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; transition: border-color 0.3s; }
.sim-card:hover { border-color: rgba(255,215,0,0.3); }
.sim-card-head {
  padding: 14px 18px; font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--border);
}
.sim-card-head span { font-size: 18px; }
.sim-card-head small { font-size: 11px; color: var(--text2); font-weight: 400; margin-left: auto; }
.sim-card-atk .sim-card-head { background: linear-gradient(135deg, rgba(230,57,70,0.1), transparent); }
.sim-card-indep .sim-card-head { background: linear-gradient(135deg, rgba(255,159,28,0.1), transparent); }
.sim-card-panel .sim-card-head { background: linear-gradient(135deg, rgba(76,201,240,0.1), transparent); }
.sim-card-boost .sim-card-head { background: linear-gradient(135deg, rgba(123,47,247,0.1), transparent); }
.sim-card-vuln .sim-card-head { background: linear-gradient(135deg, rgba(6,214,160,0.1), transparent); }
.sim-card-body { padding: 14px 18px; }
.sim-card-body-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.sim-opt {
  display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13px;
  color: var(--text2); cursor: pointer; transition: color 0.2s;
}
.sim-opt:hover { color: var(--text); }
.sim-opt input[type="checkbox"], .sim-opt input[type="radio"] { accent-color: var(--accent); width: 15px; height: 15px; flex-shrink: 0; }
.sim-opt em { margin-left: auto; font-style: normal; font-weight: 700; color: var(--blue); font-size: 12px; white-space: nowrap; }
.sim-slider-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.sim-slider-row input[type="range"] { flex: 1; accent-color: var(--gold); height: 4px; }
.sim-slider-row select { flex: 1; }
.sim-slider-val { font-size: 14px; font-weight: 700; color: var(--gold); min-width: 50px; text-align: right; }
.sim-hint { font-size: 11px; color: var(--text2); margin-top: 2px; }
.sim-sub-label { font-size: 12px; color: var(--gold); font-weight: 600; margin-bottom: 4px; letter-spacing: 1px; }

/* Breakdown */
.sim-breakdown-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 24px;
}
.sim-breakdown-box h3 { font-size: 18px; margin-bottom: 16px; }
.sim-breakdown-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.sim-bd-item {
  padding: 12px 16px; background: var(--bg2); border-radius: 10px; border-left: 3px solid var(--border);
  transition: border-color 0.3s;
}
.sim-bd-item.active { border-left-color: var(--gold); }
.sim-bd-item .bd-label { font-size: 12px; color: var(--text2); margin-bottom: 4px; }
.sim-bd-item .bd-value { font-size: 20px; font-weight: 700; color: var(--text); }
.sim-bd-item .bd-detail { font-size: 11px; color: var(--text2); margin-top: 4px; word-break: break-all; }

@media (max-width: 900px) {
  .sim-grid { grid-template-columns: 1fr; }
  .sim-result-inner { flex-direction: column; gap: 12px; }
  .sim-final-value { font-size: 40px; }
  .sim-card-body-2col { grid-template-columns: 1fr; }
}


/* Share buttons */
.sim-share-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; justify-content: center; flex-wrap: wrap; }
.sim-share-btn {
  padding: 8px 20px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg2); color: var(--text2); font-size: 13px; cursor: pointer;
  transition: all 0.25s; font-family: var(--font);
}
.sim-share-btn:hover { border-color: var(--gold); color: var(--gold); background: rgba(255,215,0,0.06); }
.sim-share-btn:active { transform: scale(0.97); }
.sim-share-toast {
  font-size: 13px; color: var(--green); opacity: 0; transition: opacity 0.3s;
  pointer-events: none;
}
.sim-share-toast.show { opacity: 1; }

/* Data source */
.sim-source {
  margin-top: 24px; padding: 14px 20px; background: rgba(255,215,0,0.05);
  border: 1px solid rgba(255,215,0,0.15); border-radius: 12px;
  font-size: 13px; color: var(--text2); text-align: center;
}
.sim-source a { color: var(--gold); text-decoration: none; transition: color 0.2s; }
.sim-source a:hover { color: var(--accent2); text-decoration: underline; }


/* Hero source link */
.hero-source {
  margin-top: 16px; font-size: 14px; color: var(--text2);
  opacity: 0; animation: fadeIn 0.8s 1.4s forwards;
}
.hero-source a { color: var(--gold); text-decoration: none; transition: color 0.2s; }
.hero-source a:hover { color: var(--accent2); text-decoration: underline; }
