:root {
  --bg: #f4f7fb; --card: #fff; --ink: #14213d; --muted: #718096;
  --line: #e2e8f0; --primary: #2563eb; --primary-dark: #174fc5;
  --shadow: 0 12px 32px rgba(31, 48, 78, .08); --radius: 16px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background-color: var(--bg); background-image: url("../assets/images/site-background.png"); background-position: center top; background-size: cover; background-repeat: no-repeat; background-attachment: fixed; font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }
.site-header { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.header-inner { width: min(1120px, calc(100% - 40px)); height: 68px; margin: auto; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; gap: 10px; align-items: center; color: var(--ink); font-size: 19px; font-weight: 800; text-decoration: none; }
.brand-mark { color: var(--primary); font-size: 26px; transform: rotate(-8deg); }
nav { display: flex; gap: 28px; }
.nav-button { padding: 8px 0; color: var(--primary); background: transparent; border: 0; font-weight: 650; }
.nav-button:hover { color: var(--primary-dark); }
.page-shell { width: min(1000px, calc(100% - 40px)); margin: 24px auto; }
.step-card { background: var(--card); border: 1px solid rgba(226,232,240,.9); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px; margin-bottom: 20px; }
.step-heading, .section-bar { display: flex; align-items: center; }
.section-bar { justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.step-heading { gap: 13px; }
.step-index { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 11px; display: grid; place-items: center; color: #fff; background: var(--primary); font-size: 18px; font-weight: 800; box-shadow: 0 6px 14px rgba(37,99,235,.22); }
h2 { font-size: 21px; margin: 0 0 3px; } .step-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.raw-input { width: 100%; height: 54px; margin-top: 22px; padding: 0 18px; color: #17233c; background: #fbfdff; border: 1px solid #cbd5e1; border-radius: 10px; outline: none; font-family: Consolas, "Microsoft YaHei", monospace; font-size: 16px; transition: .2s; }
.raw-input::placeholder { color: #a0aec0; opacity: 1; }
.raw-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.actions { display: flex; gap: 12px; margin-top: 18px; }
.button { border-radius: 9px; padding: 11px 22px; border: 1px solid var(--primary); font-weight: 700; }
.button-primary { color: #fff; background: var(--primary); box-shadow: 0 7px 15px rgba(37,99,235,.2); }
.button-primary:hover { background: var(--primary-dark); }
.button-secondary { color: var(--primary); background: #fff; }
.copy-btn { flex: 0 0 auto; color: var(--primary); background: #f8fbff; border: 1px solid #a9c5ff; border-radius: 8px; padding: 8px 13px; font-weight: 650; }
.copy-btn::before { content: "▣"; margin-right: 6px; }
.hash-output { display: block; padding: 17px 20px; overflow-wrap: anywhere; color: #dbeafe; background: #16243a; border-radius: 10px; font-family: Consolas, monospace; line-height: 1.65; }
.empty-output { color: #8fa0b7; text-align: center; }
.hex-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.hex-item { display: flex; justify-content: space-between; padding: 11px 15px; border: 1px solid var(--line); border-radius: 8px; background: #fbfdff; }
.hex-item strong { color: var(--primary); } .hex-item code { font-size: 15px; }
.empty-panel { min-height: 90px; place-items: center; color: var(--muted); background: #fafcff; border: 1px dashed #cbd5e1; border-radius: 10px; }
.hex-grid.empty-panel { grid-template-columns: 1fr; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; text-align: center; }
th { background: #f1f5f9; font-weight: 700; } th, td { padding: 12px 16px; border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: 0; } tbody tr:nth-child(even) { background: #fafcff; }
tbody tr:hover { background: #eff6ff; } td:nth-child(3), td:nth-child(4) { font-family: Consolas, monospace; }
.rank-top { color: var(--primary); font-weight: 800; }
.empty-row { height: 100px; color: var(--muted); }
.result-card { background: linear-gradient(135deg, #fff, #f3f8ff); border-color: #d5e4fb; }
.result-card h3 { color: var(--primary); text-align: center; margin: 2px 0 22px; font-size: 20px; }
.result-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 11px; }
.result-item { min-width: 0; text-align: center; }
.number-tile { aspect-ratio: 1; display: grid; place-items: center; border-radius: 9px; color: #fff; font-size: clamp(20px, 2.5vw, 30px); font-weight: 900; box-shadow: inset 0 -4px 0 rgba(0,0,0,.12), 0 7px 15px rgba(31,41,55,.12); }
.result-item small { display: block; margin-top: 10px; white-space: nowrap; font-weight: 650; font-size: 12px; }
.number-1 { background:#1688d4}.number-2 {background:#f3d600;color:#3f3a00}.number-3 {background:#10aa2d}.number-4 {background:#f36c0a}.number-5 {background:#454545}.number-6 {background:#5632e8}.number-7 {background:#aaa;color:#fff}.number-8 {background:#f0220b}.number-9 {background:#19bac7}.number-10 {background:#9b130d}
.result-placeholder { grid-column: 1/-1; margin: 0; padding: 42px; border: 1px dashed #bfd2ee; border-radius: 10px; color: var(--muted); text-align: center; }
.toast { position: fixed; z-index: 100; top: clamp(88px, 12vh, 140px); left: 50%; width: max-content; max-width: calc(100vw - 32px); padding: 13px 20px; color: #fff; background: #be123c; border-radius: 10px; box-shadow: 0 14px 34px rgba(15,23,42,.22); font-size: 14px; font-weight: 650; line-height: 1.5; text-align: center; white-space: nowrap; opacity: 0; transform: translate(-50%, -12px); transition: opacity .2s ease, transform .2s ease; }
.toast.success { background: #16803d; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
footer { padding: 24px 20px 38px; color: #94a3b8; text-align: center; font-size: 13px; }
.rules-dialog { width: min(720px, calc(100% - 32px)); max-height: min(82vh, 820px); padding: 0; color: var(--ink); background: #fff; border: 0; border-radius: 16px; box-shadow: 0 28px 80px rgba(15,23,42,.28); }
.rules-dialog::backdrop { background: rgba(15,23,42,.52); backdrop-filter: blur(3px); }
.dialog-header { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); }
.dialog-header p { margin: 0 0 3px; color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.dialog-header h2 { font-size: 22px; }
.dialog-close { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; color: #64748b; background: #f1f5f9; border: 0; border-radius: 10px; font-size: 25px; line-height: 1; }
.dialog-close:hover { color: var(--ink); background: #e2e8f0; }
.dialog-body { padding: 22px 24px 28px; }
.dialog-body section + section { margin-top: 24px; padding-top: 23px; border-top: 1px solid var(--line); }
.dialog-body h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 17px; }
.dialog-body h3 span { width: 26px; height: 26px; display: grid; place-items: center; color: #fff; background: var(--primary); border-radius: 8px; font-size: 13px; }
.dialog-body p { margin: 0; color: #526079; font-size: 14px; line-height: 1.8; }
.rule-example { margin-top: 12px; padding: 12px 14px; overflow-wrap: anywhere; color: #42516a; background: #f6f9fd; border: 1px solid #e3ebf5; border-radius: 9px; font-size: 13px; line-height: 1.8; }
.rule-example b { color: var(--ink); }
.rule-example code { color: #164eaa; font-family: Consolas, monospace; }
.rule-columns { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 18px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (prefers-reduced-motion: no-preference) {
  .step-card { animation: rise .45s ease both; } .step-card:nth-of-type(3) { animation-delay: .04s; } .step-card:nth-of-type(4) { animation-delay: .08s; }
  @keyframes rise { from { opacity: 0; transform: translateY(8px); } }
}
