/* ============================================================
   密文 MiWen · 现代化蓝白主题
   ============================================================ */

:root {
    --blue-50:  #eff6ff;
    --blue-100: #dbeafe;
    --blue-200: #bfdbfe;
    --blue-400: #60a5fa;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --blue-700: #1d4ed8;
    --ink:      #0f1f3d;
    --ink-2:    #42526e;
    --muted:    #64748b;
    --line:     #e2eaf7;
    --bg:       #f4f8ff;
    --white:    #ffffff;
    --green:    #10b981;
    --amber:    #f59e0b;
    --red:      #ef4444;
    --radius:   16px;
    --radius-sm: 10px;
    --shadow:   0 10px 40px -12px rgba(37, 99, 235, .18), 0 2px 8px -2px rgba(15, 31, 61, .06);
    --shadow-lg: 0 24px 70px -20px rgba(37, 99, 235, .28), 0 6px 16px -6px rgba(15, 31, 61, .08);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Hiragino Kaku Gothic ProN",
        "Noto Sans CJK SC", "Noto Sans JP", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(1200px 500px at 80% -10%, rgba(59, 130, 246, .10), transparent 60%),
        radial-gradient(900px 420px at -10% 8%, rgba(37, 99, 235, .08), transparent 55%),
        var(--bg);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
.container { width: min(1080px, 92%); margin: 0 auto; }
.container.narrow { width: min(760px, 92%); }

/* ------------------------------------------------------------ 导航 */
.nav {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255, 255, 255, .82);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid rgba(226, 234, 247, .8);
}
.nav-inner { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 30px; height: 30px; filter: drop-shadow(0 4px 10px rgba(37,99,235,.35)); }
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: .5px; display: flex; align-items: baseline; gap: 7px; }
.brand-name em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--blue-600); background: var(--blue-50); padding: 2px 7px; border-radius: 6px; letter-spacing: 1px; }
.nav-links { display: flex; gap: 26px; margin-left: 8px; }
.nav-links a { color: var(--ink-2); font-size: 14.5px; font-weight: 500; transition: color .15s; }
.nav-links a:hover { color: var(--blue-600); }

.lang-switch { margin-left: auto; position: relative; }
.lang-btn {
    display: inline-flex; align-items: center; gap: 7px;
    background: var(--white); border: 1px solid var(--line);
    border-radius: 999px; padding: 7px 13px; font-size: 13.5px; color: var(--ink-2);
    transition: border-color .15s, box-shadow .15s;
}
.lang-btn:hover { border-color: var(--blue-300, #93c5fd); box-shadow: 0 2px 8px rgba(37,99,235,.12); }
.lang-menu {
    position: absolute; right: 0; top: calc(100% + 8px); min-width: 150px;
    background: var(--white); border: 1px solid var(--line); border-radius: 12px;
    box-shadow: var(--shadow-lg); padding: 6px; list-style: none;
    opacity: 0; visibility: hidden; transform: translateY(-4px); transition: all .18s ease;
}
.lang-switch.open .lang-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-menu a { display: block; padding: 8px 12px; border-radius: 8px; font-size: 14px; color: var(--ink-2); }
.lang-menu a:hover { background: var(--blue-50); color: var(--blue-700); }
.lang-menu a.active { background: var(--blue-600); color: #fff; font-weight: 600; }

/* ------------------------------------------------------------ Hero */
.hero { position: relative; padding: 96px 0 84px; overflow: hidden; }
.hero-glow {
    position: absolute; inset: -120px 0 auto; height: 480px; pointer-events: none;
    background: radial-gradient(520px 260px at 50% 0%, rgba(59,130,246,.16), transparent 70%);
}
.hero-inner { position: relative; text-align: center; }
.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--white); border: 1px solid var(--blue-100);
    color: var(--blue-700); font-size: 13px; font-weight: 600;
    padding: 7px 16px; border-radius: 999px; box-shadow: 0 4px 14px rgba(37,99,235,.10);
}
.hero-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(16,185,129,.15); }
.hero-title {
    margin: 26px auto 18px; max-width: 760px;
    font-size: clamp(38px, 6vw, 62px); line-height: 1.12; font-weight: 850; letter-spacing: 1px;
    background: linear-gradient(120deg, #1e3a8a 0%, var(--blue-600) 45%, var(--blue-400) 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { max-width: 720px; margin: 0 auto; color: var(--ink-2); font-size: 17px; }
.hero-actions { margin-top: 36px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-stats { margin-top: 44px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; list-style: none; }
.hero-stats li {
    background: rgba(255,255,255,.7); border: 1px solid var(--line);
    border-radius: 999px; padding: 8px 18px; font-size: 13.5px; color: var(--ink-2); font-weight: 500;
    box-shadow: 0 2px 10px rgba(15,31,61,.04);
}

/* ------------------------------------------------------------ 按钮 */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border-radius: 12px; border: 1px solid transparent;
    font-weight: 650; font-size: 15px; padding: 11px 22px;
    transition: transform .12s ease, box-shadow .15s ease, background .15s, border-color .15s;
    user-select: none; white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-lg { padding: 14px 30px; font-size: 16px; border-radius: 14px; }
.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 9px; }
.btn-primary {
    background: linear-gradient(135deg, var(--blue-500), var(--blue-600));
    color: #fff; box-shadow: 0 10px 24px -8px rgba(37,99,235,.55);
}
.btn-primary:hover { box-shadow: 0 14px 30px -8px rgba(37,99,235,.65); background: linear-gradient(135deg, #2f7cf5, var(--blue-700)); }
.btn-primary:disabled { opacity: .65; cursor: not-allowed; box-shadow: none; }
.btn-ghost { background: var(--white); color: var(--blue-700); border-color: var(--blue-200); }
.btn-ghost:hover { background: var(--blue-50); border-color: var(--blue-400); }
.btn-light { background: var(--white); color: var(--blue-700); border-color: var(--line); box-shadow: 0 2px 8px rgba(15,31,61,.06); }
.btn-light:hover { border-color: var(--blue-400); color: var(--blue-600); }
.btn-block { width: 100%; }

/* ------------------------------------------------------------ 区块 */
.section { padding: 72px 0; }
.section-tint {
    background: linear-gradient(180deg, rgba(239,246,255,.75), rgba(244,248,255,.2));
    border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.section-head { text-align: center; margin-bottom: 42px; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 34px); font-weight: 800; letter-spacing: .5px; }
.section-head p { color: var(--muted); margin-top: 10px; font-size: 15.5px; }

.card {
    background: var(--white); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow);
}

/* ------------------------------------------------------------ 工作台 */
.workbench { padding: 26px; max-width: 860px; margin: 0 auto; }
.tabs { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); margin: -4px -4px 24px; padding: 0 4px; position: relative; }
.tab {
    border: 0; background: none; padding: 12px 22px; font-size: 15.5px; font-weight: 650;
    color: var(--muted); border-bottom: 2.5px solid transparent; margin-bottom: -1px;
    transition: color .15s, border-color .15s;
}
.tab.active { color: var(--blue-600); border-bottom-color: var(--blue-600); }
.tab:hover:not(.active) { color: var(--blue-500); }
.alg-badge {
    margin-left: auto; font-size: 12px; color: var(--blue-700); background: var(--blue-50);
    border: 1px solid var(--blue-100); padding: 5px 11px; border-radius: 999px; font-weight: 600;
}
.panel[hidden] { display: none; }

.field { margin-bottom: 20px; }
.field > label, .field .switch-title { display: block; font-weight: 650; font-size: 14px; margin-bottom: 8px; color: var(--ink); }
textarea, input[type="text"], input[type="password"], select {
    width: 100%; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
    padding: 12px 14px; font-size: 14.5px; color: var(--ink); background: #fbfdff;
    font-family: inherit; transition: border-color .15s, box-shadow .15s, background .15s;
    outline: none; resize: vertical;
}
textarea:focus, input:focus, select:focus {
    border-color: var(--blue-500); background: #fff;
    box-shadow: 0 0 0 4px rgba(59,130,246,.14);
}
textarea[readonly] { background: var(--blue-50); color: var(--ink); }
.field-meta { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-top: 6px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.input-group { position: relative; }
.input-group input { padding-right: 46px; }
.icon-btn {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    width: 34px; height: 34px; border: 0; background: none; color: var(--muted);
    border-radius: 8px; display: grid; place-items: center;
}
.icon-btn:hover { color: var(--blue-600); background: var(--blue-50); }

.hint { font-size: 12.5px; color: var(--muted); margin-top: 7px; line-height: 1.55; }
.hint.warn { color: #b45309; }
.link-btn { border: 0; background: none; color: var(--blue-600); font-size: 12.5px; font-weight: 650; padding: 0; }
.link-btn:hover { text-decoration: underline; }

/* 强度条 */
.strength { height: 6px; border-radius: 99px; background: var(--line); margin-top: 9px; overflow: hidden; }
.strength-bar { height: 100%; width: 0; border-radius: 99px; transition: width .25s, background .25s; background: var(--red); }
.strength-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 5px; font-size: 12.5px; color: var(--muted); min-height: 18px; }

/* 分段选择 */
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1.5px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: #fbfdff; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label {
    text-align: center; padding: 11px 6px; font-size: 14px; font-weight: 650; color: var(--muted);
    border-right: 1px solid var(--line); cursor: pointer; transition: background .15s, color .15s;
}
.segmented label:last-child { border-right: 0; }
.segmented label:hover { color: var(--blue-600); }
.segmented input:checked + label { background: linear-gradient(135deg, var(--blue-500), var(--blue-600)); color: #fff; }
.segmented input:focus-visible + label { box-shadow: inset 0 0 0 3px rgba(59,130,246,.35); }

/* 开关（label.switch-row 提升特异性，避免被 .field > label 的 display:block 覆盖） */
.switches { display: flex; flex-direction: column; gap: 14px; }
label.switch-row, .switch-row { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; margin: 0; }
.switch-row.top { margin-top: 30px; }
.switch-row > span:first-child { flex: 1; min-width: 0; }
.switch { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-ui {
    flex: 0 0 auto; width: 44px; height: 24px; border-radius: 999px; background: #c7d6ec;
    position: relative; transition: background .18s; margin-top: 2px;
}
.switch-ui::after {
    content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
    border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.2);
    transition: transform .18s;
}
.switch:checked + .switch-ui { background: linear-gradient(135deg, var(--blue-500), var(--blue-600)); }
.switch:checked + .switch-ui::after { transform: translateX(20px); }
.switch:focus-visible + .switch-ui { box-shadow: 0 0 0 4px rgba(59,130,246,.2); }

.share-opts { background: var(--blue-50); border: 1px dashed var(--blue-200); border-radius: var(--radius-sm); padding: 6px 18px 0; margin-bottom: 20px; }

/* 结果 */
.result { margin-top: 24px; padding-top: 22px; border-top: 1px dashed var(--line); animation: rise .3s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.result-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.result-head label { margin: 0; }
.meta { font-size: 12.5px; color: var(--blue-700); background: var(--blue-50); border: 1px solid var(--blue-100); padding: 3px 10px; border-radius: 999px; font-weight: 600; }
.result-box { position: relative; display: flex; gap: 10px; align-items: stretch; }
.result-box textarea, .result-box input { font-family: ui-monospace, "SFMono-Regular", Consolas, "Cascadia Code", monospace; font-size: 13px; line-height: 1.6; }
.result-box .copy-btn { flex: 0 0 auto; align-self: flex-start; }
.notice {
    background: #fffbeb; border: 1px solid #fde68a; color: #92400e;
    border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13.5px; margin-bottom: 18px;
}
.notice.error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.notice.success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }

/* ------------------------------------------------------------ 安全卡片 */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature { padding: 26px 24px; transition: transform .2s ease, box-shadow .2s ease; }
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.feature-icon {
    width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--blue-500), var(--blue-600)); color: #fff;
    box-shadow: 0 8px 18px -6px rgba(37,99,235,.5); margin-bottom: 16px;
}
.feature-icon.icon-key    { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.feature-icon.icon-layers { background: linear-gradient(135deg, #60a5fa, #2563eb); }
.feature-icon.icon-eye    { background: linear-gradient(135deg, #38bdf8, #0284c7); }
.feature-icon.icon-clock  { background: linear-gradient(135deg, #818cf8, #4f46e5); }
.feature-icon.icon-code   { background: linear-gradient(135deg, #2563eb, #1e3a8a); }
.feature h3 { font-size: 16.5px; margin-bottom: 8px; }
.feature p { font-size: 14px; color: var(--ink-2); }

/* ------------------------------------------------------------ 步骤 */
.steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; counter-reset: step; }
.step { position: relative; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 20px 22px; box-shadow: 0 2px 10px rgba(15,31,61,.04); }
.step-num {
    width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
    background: var(--blue-50); color: var(--blue-700); font-weight: 800; font-size: 17px;
    border: 1px solid var(--blue-100); margin-bottom: 14px;
}
.step h3 { font-size: 15.5px; margin-bottom: 6px; }
.step p { font-size: 13.5px; color: var(--ink-2); }

/* ------------------------------------------------------------ FAQ */
.faq-list { display: flex; flex-direction: column; gap: 12px; }
.faq { padding: 0; overflow: hidden; }
.faq summary {
    list-style: none; cursor: pointer; padding: 18px 22px; font-weight: 650; font-size: 15.5px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq-icon { width: 10px; height: 10px; border-right: 2px solid var(--blue-600); border-bottom: 2px solid var(--blue-600); transform: rotate(45deg); transition: transform .2s; flex: 0 0 auto; margin-top: -4px; }
.faq[open] .faq-icon { transform: rotate(-135deg); margin-top: 2px; }
.faq p { padding: 0 22px 20px; color: var(--ink-2); font-size: 14.5px; }
.faq[open] { box-shadow: var(--shadow-lg); border-color: var(--blue-200); }

/* ------------------------------------------------------------ 页脚 */
.footer { border-top: 1px solid var(--line); background: var(--white); padding: 30px 0; margin-top: 20px; }
.footer-inner { text-align: center; color: var(--muted); font-size: 13.5px; }
.footer-brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }

/* ------------------------------------------------------------ Toast */
.toast-wrap { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
.toast {
    background: #0f1f3d; color: #fff; padding: 12px 20px; border-radius: 12px; font-size: 14px;
    box-shadow: 0 16px 40px rgba(15,31,61,.35); animation: toast-in .25s ease; max-width: 90vw;
}
.toast.error { background: #991b1b; }
.toast.success { background: #065f46; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------ 响应式 */
@media (max-width: 960px) {
    .nav-links { display: none; }
}
@media (max-width: 900px) {
    .card-grid { grid-template-columns: repeat(2, 1fr); }
    .steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
    .grid-2 { grid-template-columns: 1fr; }
    .switch-row.top { margin-top: 0; }
}
@media (max-width: 680px) {
    .card-grid { grid-template-columns: 1fr; }
    .steps { grid-template-columns: 1fr; }
    .hero { padding: 64px 0 56px; }
    .section { padding: 54px 0; }
    .workbench { padding: 18px; }
    .alg-badge { display: none; }
    .result-box { flex-direction: column; }
    .result-box .copy-btn { width: 100%; }
    .brand-name em { display: none; }
}
