:root {
    --primary:#4a88f7;
    --primary-strong:#2563eb;
    --cyan:#1ccdf9;
    --text:#333;
    --muted:#666;
    --line:#e5e7eb;
    --soft-blue:#eff6ff;
}

* { box-sizing:border-box; }
html { min-width:320px; }
body {
    margin:0;
    padding:0;
    color:var(--text);
    background:#fff;
    font-family:-apple-system,BlinkMacSystemFont,"Microsoft YaHei",sans-serif;
    -webkit-font-smoothing:antialiased;
}

button,input { font:inherit; }
button,a { -webkit-tap-highlight-color:transparent; }
[hidden] { display:none!important; }

.site-header {
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:25px 50px;
}
.logo {
    display:flex;
    align-items:center;
    color:#000;
    text-decoration:none;
    font-size:18px;
    font-weight:900;
}
.logo-icon {
    margin-right:10px;
    color:var(--primary-strong);
    font-size:22px;
    line-height:1;
}
.header-actions { display:flex; align-items:center; gap:10px; }
.nav-link {
    color:#666;
    text-decoration:none;
    font-size:15px;
    font-weight:700;
    transition:.2s;
}
.nav-link:hover { color:var(--primary-strong); }
.nav-exchange {
    min-height:38px;
    display:inline-flex;
    align-items:center;
    padding:0 15px;
    border:1px solid #bfdbfe;
    border-radius:10px;
    color:var(--primary-strong);
    background:var(--soft-blue);
    font-size:14px;
    font-weight:800;
}

.container {
    width:100%;
    max-width:950px;
    margin:50px auto 0;
    padding:0 20px;
    text-align:center;
}
.main-title {
    margin:0 0 15px;
    color:var(--primary);
    font-size:46px;
    font-weight:700;
    letter-spacing:1px;
}
.main-sub {
    margin-bottom:42px;
    color:#444;
    font-size:20px;
    font-weight:700;
}

.steps {
    display:flex;
    align-items:center;
    justify-content:center;
    margin-bottom:52px;
}
.step {
    min-width:130px;
    display:flex;
    flex-direction:column;
    align-items:center;
    padding:15px 35px;
    border:1px solid #d1d5db;
    border-radius:8px;
    background:#fff;
    transition:.2s;
}
.step.active { border-color:#7eaaff; }
.s-num {
    width:28px;
    height:28px;
    display:flex;
    align-items:center;
    justify-content:center;
    margin-bottom:8px;
    border-radius:50%;
    color:#fff;
    background:#9ca3af;
    font-size:15px;
    font-weight:700;
}
.s-txt { color:#4b5563; font-size:15px; font-weight:700; white-space:nowrap; }
.step.active .s-num { background:var(--primary); }
.step.active .s-txt { color:var(--primary); }
.s-line { width:40px; height:1px; flex-shrink:0; margin:0 15px; background:#9ca3af; }

.exchange-card {
    width:100%;
    max-width:600px;
    margin:0 auto;
    padding:40px;
    border:1px solid var(--line);
    border-radius:12px;
    background:#fff;
    box-shadow:0 10px 30px rgba(0,0,0,.03);
    text-align:left;
}
.card-head {
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:18px;
    margin-bottom:22px;
    padding-bottom:18px;
    border-bottom:1px solid #f1f1f1;
}
.card-head h2 { margin:0; color:#000; font-size:18px; }
.card-head p { margin:7px 0 0; color:var(--muted); font-size:13px; line-height:1.6; }
.secure-badge {
    min-height:32px;
    display:inline-flex;
    flex:0 0 auto;
    align-items:center;
    gap:7px;
    padding:0 11px;
    border:1px solid #bfdbfe;
    border-radius:20px;
    color:var(--primary-strong);
    background:var(--soft-blue);
    font-size:11px;
    font-weight:800;
}
.secure-badge i { width:7px; height:7px; border-radius:50%; background:var(--primary); }
form > label:first-child { display:block; margin-bottom:15px; color:#000; font-size:16px; font-weight:900; }
#oldCdk {
    width:100%;
    min-height:60px;
    padding:20px;
    border:1px solid #7eaaff;
    border-radius:8px;
    outline:none;
    color:#333;
    background:#fff;
    font-family:ui-monospace,SFMono-Regular,Consolas,monospace;
    font-size:16px;
    transition:.2s;
}
#oldCdk:focus { border-color:var(--primary); box-shadow:0 0 0 2px rgba(74,136,247,.1); }
.confirm-row {
    display:flex;
    align-items:flex-start;
    gap:10px;
    margin:16px 0 0;
    padding:13px 14px;
    border:1px solid #fde68a;
    border-radius:8px;
    color:#b45309;
    background:#fffbeb;
    cursor:pointer;
    font-size:12px;
    font-weight:700;
    line-height:1.65;
}
.confirm-row input { flex:0 0 auto; margin:3px 0 0; accent-color:var(--primary-strong); }
.submit-button {
    width:100%;
    min-height:58px;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:10px;
    margin-top:25px;
    padding:18px;
    border:0;
    border-radius:8px;
    color:#fff;
    background:linear-gradient(90deg,var(--cyan),#1574fc);
    cursor:pointer;
    font-size:18px;
    font-weight:700;
    transition:.2s;
}
.submit-button:hover:not(:disabled) { opacity:.9; }
.submit-button:disabled { cursor:not-allowed; opacity:.58; }
.submit-button b { font-size:20px; }
.form-message { display:none; margin-top:15px; padding:15px; border-radius:8px; font-size:14px; font-weight:700; line-height:1.55; }
.form-message.show { display:block; }
.form-message.info { color:#1e40af; border:1px solid #bfdbfe; background:var(--soft-blue); }
.form-message.error { color:#991b1b; border:1px solid #fecaca; background:#fef2f2; }

.result-view { text-align:center; }
.success-icon {
    width:58px;
    height:58px;
    display:flex;
    align-items:center;
    justify-content:center;
    margin:0 auto 16px;
    border-radius:50%;
    color:#fff;
    background:#10b981;
    font-size:27px;
    font-weight:900;
}
.result-view h2 { margin:0; color:#111; font-size:23px; }
.result-view > p { margin:9px 0 16px; color:var(--muted); font-size:14px; line-height:1.65; }
.plan-badge { display:inline-flex; margin-bottom:12px; padding:6px 12px; border-radius:20px; color:var(--primary-strong); background:var(--soft-blue); font-size:12px; font-weight:800; }
.result-view code {
    display:block;
    padding:18px 14px;
    border:1px solid #7eaaff;
    border-radius:8px;
    color:#111;
    background:#fafafa;
    font-family:ui-monospace,SFMono-Regular,Consolas,monospace;
    font-size:17px;
    font-weight:800;
    letter-spacing:.03em;
    overflow-wrap:anywhere;
    user-select:all;
}
.copy-button,
.back-button {
    width:100%;
    min-height:50px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:8px;
    font-size:15px;
    font-weight:700;
}
.copy-button { margin-top:12px; border:1px solid var(--primary); color:var(--primary); background:#fff; cursor:pointer; }
.copy-button:hover { background:var(--soft-blue); }
.back-button { margin-top:12px; color:#fff; background:linear-gradient(90deg,var(--cyan),#1574fc); text-decoration:none; }
.save-warning { margin-top:14px; padding:13px 14px; border:1px solid #fde68a; border-radius:8px; color:#b45309; background:#fffbeb; font-size:12px; line-height:1.65; text-align:left; }

.rule-list {
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:15px;
    margin:52px 0 0;
}
.rule-list article {
    display:flex;
    align-items:flex-start;
    gap:12px;
    padding:18px;
    border:1px solid var(--line);
    border-radius:10px;
    background:#fafafa;
    text-align:left;
}
.rule-list article > span {
    width:31px;
    height:31px;
    display:flex;
    flex:0 0 auto;
    align-items:center;
    justify-content:center;
    border-radius:50%;
    color:#fff;
    background:var(--primary);
    font-size:10px;
    font-weight:800;
}
.rule-list strong { display:block; color:#111; font-size:14px; }
.rule-list p { margin:5px 0 0; color:var(--muted); font-size:12px; line-height:1.6; }
.privacy-note {
    max-width:600px;
    display:flex;
    align-items:flex-start;
    gap:10px;
    margin:24px auto 0;
    padding:12px 14px;
    border:1px solid #bfdbfe;
    border-radius:8px;
    color:#1e40af;
    background:var(--soft-blue);
    font-size:12px;
    line-height:1.65;
    text-align:left;
}
.privacy-note strong { flex:0 0 auto; }

footer { margin-top:70px; padding:0 18px 40px; color:#666; font-size:14px; text-align:center; }

a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline:3px solid rgba(37,99,235,.35);
    outline-offset:3px;
}

@media (max-width:768px) {
    .site-header { padding:15px 20px; }
    .header-actions { gap:6px; }
    .nav-link { font-size:12px; }
    .nav-exchange { min-height:34px; padding:0 10px; font-size:12px; }
    .container { margin-top:30px; }
    .main-title { font-size:28px; }
    .main-sub { margin-bottom:30px; font-size:15px; }
    .steps { justify-content:space-between; gap:5px; margin-bottom:38px; }
    .step { min-width:0; flex:1; padding:12px 7px; text-align:center; }
    .s-line { width:15px; margin:0; }
    .s-num { width:24px; height:24px; margin-bottom:5px; font-size:13px; }
    .s-txt { font-size:12px; }
    .exchange-card { padding:20px; }
    .card-head { align-items:center; }
    .card-head h2 { font-size:17px; }
    .card-head p { font-size:12px; }
    .secure-badge { min-height:30px; padding:0 9px; font-size:10px; }
    #oldCdk { min-height:52px; padding:15px; font-size:15px; }
    .submit-button { min-height:52px; margin-top:20px; padding:15px; font-size:16px; }
    .rule-list { grid-template-columns:1fr; gap:8px; margin-top:38px; }
    .rule-list article { padding:14px; }
    footer { margin-top:50px; }
}

@media (max-width:390px) {
    .site-header { padding-right:14px; padding-left:14px; }
    .logo { font-size:16px; }
    .logo-icon { margin-right:7px; font-size:20px; }
    .nav-link { font-size:11px; }
    .nav-exchange { padding:0 8px; font-size:11px; }
    .container { padding:0 14px; }
    .card-head { gap:10px; }
    .secure-badge { padding:0 8px; }
}

@media (prefers-reduced-motion:reduce) {
    *,*::before,*::after {
        scroll-behavior:auto!important;
        animation-duration:.01ms!important;
        animation-iteration-count:1!important;
        transition-duration:.01ms!important;
    }
}
