
:root {
    --bg: #f3f5fb;
    --card: #ffffff;
    --line: #e6e9f2;
    --txt: #1c2333;
    --sub: #6b7280;
    --brand: #5b5bd6;
    --brand-2: #7c3aed;
    --brand-soft: #f0effc;
    --accent: #f59e0b;
    --ok: #16a34a;
    --bad: #e11d48;
}

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

body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(180deg, #e9ecfa 0%, var(--bg) 300px);
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
    color: var(--txt);
}

.container {
    max-width: 780px;
    margin: 0 auto;
    padding: 22px 16px 80px;
}


.popup-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}
.popup-content {
    background-color: white;
    border-radius: 14px;
    padding: 28px;
    max-width: 480px;
    width: 92%;
    max-height: 82%;
    overflow-y: auto;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.28);
}
.popup-content h3 { color: var(--txt); margin-bottom: 16px; font-size: 19px; }
.popup-message { margin-bottom: 22px; text-align: justify; line-height: 1.7; }
.popup-message p { margin-bottom: 12px; color: #444b5c; font-size: 13px; }
.popup-button {
    padding: 10px 34px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: opacity .2s;
}
.popup-button:hover { opacity: .88; }


.topbar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}
.brand { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.brand-line { display: flex; align-items: center; justify-content: center; gap: 10px; }
.brand h1 {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    font-size: 21px;
    letter-spacing: .3px;
    color: var(--txt);
}
.brand-dot {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    box-shadow: 0 0 0 4px rgba(124, 58, 237, .13);
}
.app-ver { font-size: 11px; color: var(--sub); font-weight: 400; }
[hidden] { display: none !important; }
.top-actions { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }

.link-button {
    display: inline-block;
    padding: 7px 16px;
    background: var(--card);
    color: var(--brand);
    text-decoration: none;
    border-radius: 8px;
    font-size: 13px;
    border: 1px solid var(--line);
    box-shadow: 0 2px 8px rgba(28, 35, 51, .05);
    transition: all .2s;
}
.link-button:hover { border-color: var(--brand); color: var(--brand-2); }


.watermark-container {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 9990;
    overflow: hidden;
}
.watermark-diagonal {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    background-color: rgba(255, 77, 79, .10);
    color: rgba(230, 45, 55, .32);
    padding: 10px 42px;
    font-size: 15px;
    font-weight: bold;
    white-space: nowrap;
    border-radius: 4px;
    border: 1px solid rgba(240, 80, 90, .18);
}


.wizard { position: relative; z-index: 2; }

.steps { display: flex; gap: 8px; margin-bottom: 18px; }
.step-bar {
    flex: 1;
    height: 5px;
    border-radius: 3px;
    background: #dcdef0;
    transition: background .4s;
}
.step-bar.on { background: linear-gradient(90deg, var(--brand), var(--brand-2)); }

#stepPick { margin-top: 14px; }

.step-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.step-head .step-no {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--brand-2);
    background: var(--brand-soft);
    border-radius: 6px;
    padding: 3px 8px;
}
.step-head h2 { font-size: 17px; }
.step-head .step-sub { font-size: 12px; color: var(--sub); }


.wz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}
.wz-group {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0 -2px;
}
.wz-group-name { font-size: 12px; font-weight: 700; color: var(--sub); letter-spacing: 1px; }
.wz-group-count { font-size: 10px; color: #a6adc2; }
.wz-group::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}

.car-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    text-align: center;
    border: 1.5px solid var(--line);
    border-radius: 14px;
    background: var(--card);
    padding: 10px 10px 14px;
    cursor: pointer;
    transition: all .18s ease;
    font-family: inherit;
}
.car-card:hover {
    border-color: #c9cdea;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(28, 35, 51, .07);
}
.car-card.selected {
    border-color: var(--brand);
    background: #f7f6ff;
    box-shadow: 0 4px 14px rgba(91, 91, 214, .18);
}


.car-thumb {
    position: relative;
    width: 100%;
    height: 64px;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    isolation: isolate;
}
.car-thumb-letter {
    font-size: 30px;
    font-weight: 800;
    color: rgba(255, 255, 255, .78);
    letter-spacing: 1px;
    user-select: none;
}
.car-thumb-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.car-name {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
    word-break: break-all;
    color: var(--ink);
}
.car-card.selected .car-name { color: var(--brand-2); }
.tag {
    flex: none;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 20px;
    letter-spacing: .3px;
}
.tag-dyn { background: #fff4e0; color: #b45309; }
.tag-fixed { background: #e8f5ee; color: #15803d; }

.car-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: 0 4px 14px rgba(28, 35, 51, .06);
    flex-wrap: wrap;
}
.sum-name { font-size: 16px; font-weight: 800; color: var(--brand-2); }
.switch-btn {
    margin-left: auto;
    font-size: 12px;
    color: var(--brand);
    background: #fff;
    border: 1px solid var(--brand);
    border-radius: 8px;
    padding: 5px 14px;
    cursor: pointer;
    transition: all .18s;
}
.switch-btn:hover { background: var(--brand-soft); }


.ver-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 2px 2px 6px;
}
.ver-chip {
    flex: 0 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    min-height: 40px;
    padding: 8px 14px;
    border: 1.5px solid var(--line);
    border-radius: 11px;
    background: var(--card);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--txt);
    font-family: inherit;
    transition: all .18s;
}
.ver-chip:hover { border-color: #c9cdea; }
.ver-chip.active {
    border-color: var(--brand-2);
    background: var(--brand-soft);
    color: var(--brand-2);
    box-shadow: inset 0 0 0 1px var(--brand-2);
}

.pwd-area {
    margin-top: 10px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px 16px;
    box-shadow: 0 10px 30px rgba(28, 35, 51, .06);
}
.hour-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 13px;
    font-weight: 600;
    color: var(--sub);
    text-align: center;
    padding-bottom: 14px;
    border-bottom: 1px dashed var(--line);
    margin-bottom: 16px;
}
#nextUpdateTime { color: var(--accent); font-weight: 800; }
.share-copy-btn {
    border: 1px solid var(--brand);
    background: transparent;
    color: var(--brand);
    border-radius: 999px;
    font-size: 12px;
    padding: 3px 14px;
    line-height: 1.6;
    white-space: nowrap;
    cursor: pointer;
    transition: all .2s;
}
.share-copy-btn:hover { background: var(--brand); color: #fff; }

.password-group {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.password-card {
    background: #fbfaff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px 16px 14px;
    animation: rise .3s ease;
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.password-card h2 {
    color: var(--txt);
    margin: 0 0 4px;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.password-card h2::before {
    content: "";
    width: 8px; height: 8px;
    border-radius: 3px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
}
.password-value {
    font-size: 32px;
    color: var(--txt);
    font-weight: 800;
    letter-spacing: 4px;
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    text-align: center;
    padding: 6px 0 4px;
    font-variant-numeric: tabular-nums;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}
#carInstructions {
    margin-top: 6px;
    font-size: 12px;
    color: var(--bad);
    font-weight: 600;
    text-align: center;
}
#adbInstructions {
    margin-top: 6px;
    font-size: 12px;
    color: #6b7a8f;
    text-align: center;
}
#notes { font-size: 12px; color: var(--bad); }


#serialNumberInput {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}
#serialNumberInput input {
    border: 1.5px solid var(--line);
    border-radius: 10px;
    padding: 9px;
    width: 100%;
    max-width: 200px;
    font-size: 16px;
    text-align: center;
    letter-spacing: 4px;
    font-family: inherit;
    outline: none;
    transition: border-color .2s;
}
#serialNumberInput input:focus { border-color: var(--brand); }

.toggle-button, #calculateAdbButton {
    margin-top: 6px;
    padding: 8px 18px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: opacity .2s;
}
.toggle-button:hover, #calculateAdbButton:hover { opacity: .88; }

.update-info {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
    color: var(--sub);
    font-size: 12px;
    text-align: center;
}


.verify-overlay {
    position: fixed; inset: 0; z-index: 999;
    background: rgba(20, 24, 38, .55);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.verify-overlay[hidden] { display: none; }
.verify-modal {
    width: 100%; max-width: 340px;
    background: var(--card); border-radius: 14px; padding: 22px 20px 18px;
    box-shadow: 0 18px 50px rgba(20, 24, 38, .28);
    animation: rise .25s ease;
}
.verify-modal h3 { font-size: 17px; margin-bottom: 8px; }
.verify-modal input {
    width: 100%; border: 1.5px solid var(--line); border-radius: 8px;
    padding: 10px; font-size: 18px; text-align: center; letter-spacing: 6px;
    font-family: inherit; outline: none; transition: border-color .2s;
}
.verify-modal input:focus { border-color: var(--brand); }
.verify-error { margin-top: 8px; font-size: 12px; color: var(--bad); }
.verify-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.vm-btn {
    padding: 8px 20px; border: none; border-radius: 8px; cursor: pointer;
    font-size: 13px; font-family: inherit; color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    transition: opacity .2s;
}
.vm-btn.ghost { background: var(--card); color: var(--brand); border: 1px solid var(--brand); }
.vm-btn:hover { opacity: .88; }
.vm-btn:disabled { opacity: .6; cursor: default; }
.password-value.locked { cursor: pointer; }


.copy-toast {
    position: fixed;
    left: 50%;
    bottom: 20%;
    transform: translate(-50%, 10px);
    background: rgba(28, 35, 51, .88);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 18px;
    border-radius: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
    z-index: 9998;
}
.copy-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}


@media (max-width: 420px) {
    .car-card { padding: 10px 10px 9px; }
    .car-name { font-size: 13px; }
}
