:root {
  --bg: #0a0a0f;
  --card: #14141c;
  --card-border: #26263a;
  --text: #e8e8f0;
  --muted: #8a8aa0;
  --neon: #00e5ff;
  --neon-2: #ff2bd6;
  --field: #1c1c28;
  --field-border: #32324a;
}

html { scroll-behavior: smooth; }
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Source Han Sans SC', '思源黑体', 'Noto Sans CJK SC', 'Microsoft YaHei', '微软雅黑', -apple-system, 'Helvetica Neue', 'Segoe UI', sans-serif;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(255,43,214,0.10), transparent 60%),
    radial-gradient(1000px 500px at -10% 110%, rgba(0,229,255,0.10), transparent 60%),
    var(--bg);
  color: var(--text); padding: 18px; font-size: 15.2px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.container { width: 100%; max-width: 1100px; margin: 0 auto; }
h1 {
  font-size: 28px; font-weight: 700; letter-spacing: -0.01em;
  color: var(--text); margin-bottom: 2px;
  text-shadow: 0 0 12px rgba(0,229,255,0.35);
}
.subtitle { color: var(--muted); font-size: 14.5px; margin-bottom: 14px; }

.card {
  background: var(--card); border-radius: 12px; padding: 16px 20px;
  margin-bottom: 12px; box-shadow: 0 0 0 1px rgba(0,229,255,0.05), 0 8px 24px rgba(0,0,0,0.4);
  border: 1px solid var(--card-border);
}
.card-title {
  font-size: 16.5px; font-weight: 600; color: var(--neon);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: 12px; text-shadow: 0 0 8px rgba(0,229,255,0.4);
}

.input-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px 16px;
}
.input-group { display: flex; flex-direction: column; gap: 4px; }
.input-group label { font-size: 13.5px; font-weight: 500; color: var(--muted); }
.input-group label[for="bonusAS"] { color: var(--neon); }
.input-group label[for="haste"] { color: #ffd23f; }
.input-group label[for="baseHaste"] { color: #a78bfa; }
.input-group input, .input-group select {
  font-family: inherit; font-size: 14.8px; color: var(--text);
  background: var(--field); border: 1px solid var(--field-border); border-radius: 6px;
  padding: 7px 11px; transition: all 0.15s ease; width: 100%;
}
.input-group input:focus, .input-group select:focus {
  outline: none; border-color: var(--neon);
  box-shadow: 0 0 0 3px rgba(0,229,255,0.20), 0 0 12px rgba(0,229,255,0.25);
}
.input-group input[type=range] {
  height: 18px; margin-top: 4px;
}
.input-group select {
  appearance: none;
  background: var(--field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2300e5ff'/%3E%3C/svg%3E") no-repeat right 12px center;
  cursor: pointer;
}

.btn {
  background: linear-gradient(135deg, var(--neon), var(--neon-2));
  color: #0a0a0f; border: none; border-radius: 24px;
  padding: 10px 36px; font-size: 16px; font-weight: 600; cursor: pointer;
  transition: all 0.15s ease; margin-top: 8px;
  box-shadow: 0 0 14px rgba(0,229,255,0.4), 0 0 22px rgba(255,43,214,0.25);
}
.btn:hover { filter: brightness(1.1); }

.preset-row { display: flex; align-items: stretch; gap: 14px; flex-wrap: wrap; }
.preset-row .preset-left { flex: 0 0 auto; display: flex; align-items: center; }
.preset-row #presetSelect {
  font-family: inherit; font-size: 16px; font-weight: 600; color: var(--text);
  background: var(--field); border: 2px solid var(--neon); border-radius: 8px;
  padding: 10px 40px 10px 14px; cursor: pointer; min-width: 240px;
  box-shadow: 0 0 14px rgba(0,229,255,0.30);
  appearance: none;
  background: var(--field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M0 0l6 8 6-8z' fill='%2300e5ff'/%3E%3C/svg%3E") no-repeat right 14px center;
  transition: all 0.2s ease;
}
.preset-row #presetSelect:focus {
  outline: none; border-color: var(--neon-2);
  box-shadow: 0 0 0 4px rgba(255,43,214,0.25), 0 0 20px rgba(0,229,255,0.40);
}
.preset-desc {
  flex: 1 1 200px; background: var(--field); border: 1px solid var(--card-border);
  border-radius: 8px; padding: 9px 14px; font-size: 13.8px; line-height: 1.65;
  color: var(--muted);
}
.preset-desc .line { display: block; }
.preset-desc .line + .line { margin-top: 4px; }
.preset-desc .line-main { color: var(--text); font-weight: 600; }
.preset-desc .line-label { color: var(--muted); }
.preset-desc .hl { color: var(--neon); }
.preset-desc .hl2 { color: #ffd23f; }
.preset-desc .hl3 { color: #a78bfa; }
.preset-desc .tag-rune { display: inline-block; background: rgba(255,43,214,0.15); color: var(--neon-2); padding: 0 8px; border-radius: 4px; font-size: 12px; margin-right: 4px; }
.preset-desc .tag-item { display: inline-block; background: rgba(0,229,255,0.12); color: var(--neon); padding: 0 8px; border-radius: 4px; font-size: 12px; margin-right: 4px; }

.result-hero {
  display: flex; align-items: center; flex-wrap: wrap; gap: 16px 24px;
  background: linear-gradient(135deg, var(--field) 0%, var(--card) 100%);
  border: 1px solid var(--card-border); border-radius: 12px;
  padding: 16px 20px; margin-bottom: 14px;
  position: relative; overflow: hidden;
}
.result-hero::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--neon), var(--neon-2));
  opacity: 0.5;
}
.hero-left { display: flex; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px 16px; }
.hero-stat { display: flex; align-items: baseline; gap: 6px; }
.hero-number { font-size: 46px; font-weight: 800; line-height: 1; letter-spacing: -0.03em; color: var(--text); }
.hero-label { font-size: 16px; color: var(--muted); }
.hero-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.hero-time { font-size: 17px; font-weight: 600; white-space: nowrap; }
.hero-right { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 20px; margin-left: auto; text-align: right; }
.hero-r-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.hero-r-value { font-size: 19px; font-weight: 700; line-height: 1.3; }
.hero-r-sub { font-size: 16px; font-weight: 700; line-height: 1.25; margin-bottom: 3px; }
.badge-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 13px; border-radius: 20px; font-size: 13.8px; font-weight: 600;
  border: 1px solid;
}
.badge-hit { background: rgba(44,255,154,0.10); color: #2cff9a; border-color: rgba(44,255,154,0.5); }
.badge-swing { background: rgba(255,210,63,0.10); color: #ffd23f; border-color: rgba(255,210,63,0.5); }
.badge-none { background: rgba(255,77,109,0.10); color: #ff4d6d; border-color: rgba(255,77,109,0.5); }

.result-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.result-item {
  background: var(--field); border: 1px solid var(--card-border); border-radius: 8px;
  padding: 10px 12px;
}
.result-item .label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 2px; }
.result-item .value { font-size: 19px; font-weight: 700; }
.result-item .value.sm { font-size: 14.5px; }
.result-item .detail { font-size: 12px; color: var(--muted); margin-top: 2px; }
.green-text { color: #2cff9a; }
.gold-text { color: #ffd23f; }
.cyan-text { color: var(--neon); }
.red-text { color: #ff4d6d; }

.layout-main { display: flex; gap: 14px; align-items: flex-start; }
.sidebar { flex: 0 0 420px; min-width: 0; }
.sidebar .card { margin-bottom: 0; }
.sidebar-title {
  font-size: 26px; font-weight: 800; line-height: 1.3;
  color: var(--neon); margin-bottom: 16px;
  text-shadow: 0 0 14px rgba(0,229,255,0.4);
  text-align: center;
}
.content-main { flex: 1; min-width: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
@media (max-width: 900px) {
  .layout-main { flex-direction: column; }
  .sidebar { flex: none; width: 100%; }
  .content-main { width: 100%; }
  .sidebar-title { font-size: 24px; text-align: center; }
  .sidebar .card .preset-row { flex-direction: column; }
  .sidebar .preset-row #presetSelect { min-width: 0; width: 100%; }
}
@media (max-width: 768px) {
  .input-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-number { font-size: 40px; }
  .hero-right { margin-left: 0; text-align: center; justify-content: center; }
  .result-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .input-grid { grid-template-columns: 1fr; }
  body { padding: 12px; }
  .card { padding: 14px 16px; }
  .result-hero { flex-direction: column; align-items: center; text-align: center; }
  .hero-left { align-items: center; }
  .hero-meta { justify-content: center; }
  .hero-right { justify-content: center; }
  .result-grid { grid-template-columns: 1fr; }
}