:root {
  color-scheme: light;
  --blue: #246ce4;
  --blue-dark: #1857bf;
  --blue-soft: #f2f7ff;
  --ink: #23334e;
  --muted: #8490a5;
  --body-text: #65748c;
  --line: #e8edf5;
  --green: #30a88b;
  --radius: 18px;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 30px; }
body { margin: 0; color: var(--ink); background: radial-gradient(ellipse at 50% 2%, #eaf2ff 0, transparent 50%), linear-gradient(180deg, #f7faff, #f9fafc 85%); font-size: 14px; line-height: 1.6; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:disabled { cursor: not-allowed; }
button, a, select { touch-action: manipulation; }
button:focus-visible, a:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #9cc0ff; outline-offset: 4px; }
[hidden] { display: none !important; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.page-shell { width: min(1184px, calc(100% - 80px)); margin: 0 auto; }
.site-header { height: 96px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #dfe7f280; }
.brand { display: flex; align-items: center; gap: 11px; font-family: "Avenir Next", "PingFang SC", sans-serif; font-size: 19px; font-weight: 650; letter-spacing: -.5px; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; color: white; background: var(--blue); border-radius: 11px; box-shadow: 0 4px 9px #246ce41a; }
.brand-mark .icon { width: 23px; height: 23px; }
.brand-light { font-size: 16px; font-weight: 500; margin-left: 4px; letter-spacing: .5px; }
.header-links { display: flex; align-items: center; gap: 28px; font-size: 12px; }
.local-badge { display: flex; align-items: center; gap: 7px; color: #678276; }
.status-dot { display: inline-block; width: 6px; height: 6px; background: var(--green); border-radius: 50%; flex-shrink: 0; }
.help-link { color: var(--body-text); }
.help-link:hover, .site-footer a:hover { color: var(--blue); }
.help-link span { margin-left: 4px; }
.hero { text-align: center; padding: 48px 0 40px; animation: reveal .55s ease-out both; }
.hero-label { display: inline-flex; align-items: center; gap: 7px; color: var(--blue); font-size: 12px; font-weight: 500; letter-spacing: 1px; margin-bottom: 12px; }
.hero-label .icon { width: 15px; height: 15px; }
h1 { font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif; margin: 0; font-size: clamp(28px, 3.5vw, 42px); line-height: 1.4; font-weight: 650; letter-spacing: -1.6px; }
h1 span { color: var(--blue); }
.hero p { margin: 14px 0 0; color: var(--body-text); font-size: 14px; letter-spacing: .1px; }
.workspace { display: grid; grid-template-columns: 1.03fr 1fr; gap: 24px; align-items: stretch; animation: reveal .55s .08s ease-out both; }
.panel { min-width: 0; background: #fff; border: 1px solid #e2e9f3; border-radius: var(--radius); box-shadow: 0 6px 24px #24436b04; }
.panel-heading { min-height: 79px; margin: 0 28px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.section-title { display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.section-title h2 { font-size: 16px; font-weight: 600; margin: 0; }
.section-icon { color: var(--blue); display: flex; }
.section-icon .icon { width: 19px; height: 19px; }
.heading-note { color: #98a3b5; font-size: 11px; }
form { padding: 25px 28px 27px; }
.form-section { margin: 0 0 24px; }
.field-label { display: flex; align-items: center; gap: 9px; width: 100%; padding: 0; margin: 0 0 12px; font-size: 13px; font-weight: 600; }
.step { color: #9baac1; font-family: "Avenir Next", sans-serif; font-size: 11px; font-weight: 500; letter-spacing: .3px; }
.email-field { display: flex; align-items: center; gap: 11px; padding: 0 14px; height: 49px; background: #fff; border: 1px solid #dce3ee; border-radius: 8px; transition: border-color .18s, box-shadow .18s; }
.email-field > .icon { color: #9da9bb; width: 18px; height: 18px; }
.email-field:focus-within { border-color: #6d9dec; box-shadow: 0 0 0 3px #246ce40c; }
.email-field.invalid { border-color: #db7676; }
.email-field input { width: 100%; min-width: 0; padding: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px; }
.email-field input::placeholder { color: #a0aabc; }
.email-suffix { color: #8490a5; font-family: "Avenir Next", sans-serif; font-size: 13px; white-space: nowrap; padding-left: 13px; border-left: 1px solid var(--line); }
.field-hint { font-size: 11px; color: #98a3b4; margin: 8px 0 0; line-height: 1.7; }
.field-error { color: #c34f4f; font-size: 11px; line-height: 1.7; margin: 7px 0 0; }
fieldset { border: 0; padding: 0; min-width: 0; }
.selection-count { margin-left: auto; color: var(--muted); font-size: 10px; font-weight: 400; }
.rules-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.rule-card { position: relative; display: flex; flex-direction: column; min-width: 0; padding: 15px 15px 13px; border: 1px solid #e0e6f0; border-radius: 10px; cursor: pointer; background: #fff; transition: border-color .18s, background .18s; }
.rule-card:has(input:checked) { border-color: #aac8f8; background: #f6f9ff; }
.rule-card:hover { border-color: #709fe9; }
.rule-card:has(input:focus-visible) { outline: 3px solid #9cc0ff; outline-offset: 3px; }
.rule-card input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.rule-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.rule-symbol { color: var(--blue); height: 25px; font-family: "Avenir Next", "Trebuchet MS", sans-serif; font-size: 21px; font-weight: 600; line-height: 25px; letter-spacing: -1px; }
.plus-symbol { font-size: 29px; font-weight: 400; }
.case-symbol { font-size: 20px; }
.domain-symbol { font-size: 22px; }
.rule-check { display: grid; place-items: center; width: 16px; height: 16px; border: 1px solid #d5deeb; border-radius: 5px; color: transparent; background: white; }
.rule-check .icon { width: 12px; height: 12px; stroke-width: 2.5; }
.rule-card:has(input:checked) .rule-check { color: white; background: var(--blue); border-color: var(--blue); }
.rule-name { font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.rule-description { color: var(--body-text); font-size: 10px; white-space: nowrap; }
.rule-card code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 9px; color: #7c96bd; font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 10px; letter-spacing: -.2px; }
.generate-section { margin-bottom: 0; }
.generate-controls { display: flex; gap: 12px; }
.select-wrap { position: relative; width: 134px; flex-shrink: 0; }
select { appearance: none; width: 100%; height: 46px; padding: 0 35px 0 15px; border: 1px solid #dce3ee; border-radius: 8px; color: var(--ink); font-size: 12px; background: white; cursor: pointer; }
.select-chevron { pointer-events: none; position: absolute; right: 15px; top: 18px; width: 6px; height: 6px; border-right: 1.5px solid #8490a5; border-bottom: 1.5px solid #8490a5; transform: rotate(45deg); }
.primary-button { flex: 1; display: flex; justify-content: center; align-items: center; gap: 9px; min-height: 46px; padding: 0 18px; color: white; border: 0; border-radius: 8px; background: var(--blue); box-shadow: 0 3px 8px #246ce416; font-size: 13px; font-weight: 500; transition: background .18s, box-shadow .18s; }
.primary-button .icon { width: 17px; height: 17px; }
.primary-button .button-arrow { margin-left: auto; width: 18px; }
.primary-button > .icon:first-child { margin-left: auto; }
.primary-button:hover:not(:disabled) { background: var(--blue-dark); box-shadow: 0 4px 12px #246ce42b; }
.primary-button:disabled { background: #93b6ee; box-shadow: none; }
.results-panel { display: flex; flex-direction: column; }
.result-count { display: inline-grid; place-items: center; min-width: 24px; height: 21px; padding: 0 6px; background: #eff4fc; color: #7189af; border-radius: 6px; font-size: 11px; font-family: "Avenir Next", sans-serif; }
.copy-button { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 10px; border: 1px solid #e1e7f0; border-radius: 7px; color: var(--body-text); background: #fff; font-size: 11px; white-space: nowrap; }
.copy-button .icon { width: 13px; height: 13px; }
.copy-button:disabled { color: #b0b9c9; background: #fbfcfe; }
.copy-button:hover:not(:disabled) { color: var(--blue); border-color: #a9c6f3; background: var(--blue-soft); }
.results-body { position: relative; display: flex; flex: 1; min-height: 430px; }
.empty-state { flex: 1; display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 28px 22px 48px; background-image: radial-gradient(#dce6f380 .7px, transparent .7px); background-size: 15px 15px; background-position: center; }
.mail-illustration { width: 217px; height: 172px; margin-bottom: 20px; }
.mail-illustration svg { width: 100%; height: 100%; }
.empty-state h3 { font-size: 15px; font-weight: 500; color: #5b6e8c; margin: 0 0 10px; letter-spacing: .3px; }
.empty-state p { color: #9aa6b8; text-align: center; font-size: 12px; line-height: 1.9; margin: 0; }
.empty-tag { display: flex; align-items: center; gap: 5px; margin-top: 24px; font-size: 10px; color: #9aa8bd; }
.empty-tag .icon { width: 13px; height: 13px; }
.results-footer { display: flex; align-items: center; gap: 7px; border-top: 1px solid var(--line); margin: 0 28px; padding: 16px 0; color: #8a99ae; font-size: 11px; }
.results-footer .status-dot { width: 5px; height: 5px; }
.results-footer > .icon { width: 15px; height: 15px; margin-left: auto; color: #9faec3; }
.generated-results { display: flex; flex-direction: column; width: 100%; padding: 20px 22px 0; min-width: 0; animation: reveal .3s ease-out both; }
.results-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 13px; padding: 0 6px; color: #8a98ac; font-size: 11px; }
.dedup-badge { display: flex; align-items: center; gap: 4px; color: #4f9b85; font-size: 10px; white-space: nowrap; }
.dedup-badge .icon { width: 12px; height: 12px; }
.results-editor { display: flex; flex: 1; min-height: 310px; height: 350px; max-height: 480px; overflow: hidden; background: #f8faff; border: 1px solid #eaf0f9; border-radius: 9px; }
.line-numbers, .results-textarea { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 11px; line-height: 29px; margin: 0; border: 0; padding-top: 12px; padding-bottom: 12px; }
.line-numbers { flex-shrink: 0; width: 40px; color: #b7c4d8; padding-left: 8px; padding-right: 10px; text-align: right; overflow: hidden; user-select: none; background: #f4f7fc; }
.results-textarea { display: block; flex: 1; min-width: 0; width: 100%; resize: none; padding-left: 12px; padding-right: 12px; color: #4f6c99; background: transparent; scrollbar-color: #cbd9ee transparent; scrollbar-width: thin; }
.results-textarea:focus-visible { outline-offset: -3px; }
.mailbox-summary { display: flex; align-items: center; gap: 7px; margin: 17px 6px; font-size: 10px; color: #98a5b8; min-width: 0; }
.mailbox-summary .icon { width: 13px; height: 13px; }
.mailbox-summary > span { white-space: nowrap; }
.mailbox-summary strong { font-family: "SFMono-Regular", Consolas, monospace; color: #7287a5; font-size: 10px; font-weight: 400; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.result-notice { margin: 12px 6px 0; padding: 10px 12px; border-radius: 7px; background: #fff8e9; color: #9c7939; font-size: 11px; line-height: 1.7; }
.guide { margin-top: 31px; padding: 25px 28px 27px; border-radius: 13px; background: #edf2f870; border: 1px solid #e5ebf580; animation: reveal .55s .16s ease-out both; }
.guide-heading { display: flex; align-items: center; gap: 7px; color: #75859e; margin-bottom: 19px; }
.guide-heading .icon { width: 15px; height: 15px; }
.guide h2 { margin: 0; font-weight: 500; font-size: 12px; }
.guide-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px; }
.guide article { display: flex; align-items: flex-start; gap: 11px; }
.guide-number { font-family: "Avenir Next", sans-serif; color: #9aacc6; font-size: 10px; padding-top: 2px; }
.guide h3 { font-size: 11px; font-weight: 500; margin: 0 0 5px; color: #687d9a; }
.guide p { font-size: 10px; line-height: 1.9; color: #95a1b3; margin: 0; }
.site-footer { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 27px 2px 30px; color: #a0aabd; font-size: 10px; }
.footer-divider { margin: 0 13px; color: #c9d1dc; }
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); padding: 12px 20px; max-width: calc(100% - 32px); border-radius: 10px; background: #263c5b; color: white; box-shadow: 0 8px 25px #102b4b22; font-size: 12px; z-index: 10; text-align: center; }
.noscript-notice { padding: 14px; text-align: center; color: #a34c32; background: #fff0e8; }
@keyframes reveal { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }

@media (min-width: 1450px) { .hero { padding: 60px 0 48px; } }
@media (max-width: 1100px) {
  .page-shell { width: calc(100% - 48px); }
  .workspace { gap: 18px; }
  .panel-heading { margin: 0 22px; }
  form { padding-left: 22px; padding-right: 22px; }
  .heading-note { display: none; }
  .rule-card { padding-left: 12px; padding-right: 12px; }
  .rule-description { font-size: 9px; }
  .rule-card code { font-size: 9px; }
  .results-footer { margin: 0 22px; }
  .guide-grid { gap: 20px; }
}
@media (max-width: 800px) {
  .page-shell { width: min(600px, calc(100% - 32px)); }
  .site-header { height: 76px; }
  .header-links { gap: 18px; }
  .local-badge { font-size: 10px; }
  .help-link { font-size: 11px; }
  .brand { font-size: 17px; gap: 8px; }
  .brand-light { font-size: 13px; }
  .brand-mark { width: 32px; height: 32px; border-radius: 9px; }
  .hero { padding: 35px 8px 30px; }
  h1 { font-size: 31px; letter-spacing: -1px; }
  .hero p { font-size: 12px; max-width: 360px; margin: 12px auto 0; line-height: 1.9; }
  .hero-label { font-size: 10px; }
  .email-field input { font-size: 16px; }
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .heading-note { display: inline; }
  .panel-heading { min-height: 70px; }
  .rule-description { font-size: 10px; }
  .rule-card code { font-size: 10px; }
  .results-body { min-height: 390px; }
  .empty-state { padding-bottom: 35px; }
  .results-editor { height: 330px; flex: none; }
  .generated-results { padding-bottom: 2px; }
  .guide { padding: 22px; margin-top: 22px; }
  .guide-grid { grid-template-columns: 1fr; gap: 19px; }
  .guide p, .guide h3 { font-size: 11px; }
  .site-footer { flex-direction: column; gap: 9px; padding: 24px 0; }
}
@media (max-width: 390px) {
  .page-shell { width: calc(100% - 24px); }
  .local-badge { display: none; }
  .heading-note { font-size: 9px; }
  form { padding-left: 17px; padding-right: 17px; }
  .panel-heading { margin: 0 17px; }
  .rule-card { padding: 12px 10px; }
  .rule-description { font-size: 9px; }
  .rule-card code { font-size: 9px; }
  .rules-grid { gap: 9px; }
  .select-wrap { width: 112px; }
  .primary-button { padding: 0 13px; }
  h1 { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
