* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
}

.app-container {
    max-width: 600px;
    margin: 0 auto;
    background-color: #f5f5f5;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Header */
.header {
    background-color: #0066ff;
    color: #fff;
    padding: 18px 15px 20px;
    position: relative;
    height: 180px;
}

.back-btn {
    position: absolute;
    top: 16px;
    left: 15px;
    cursor: pointer;
}

.header .title {
    font-size: 20px;
    font-weight: bold;
    text-align: left;
    position: absolute;
    top: 58px;
    left: 15px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.header .title .brand-logo {
    height: 34px;
    width: auto;
    display: inline-block;
    object-fit: contain;
    vertical-align: middle;
}

.header .title span {
    margin-top: 5px;
    font-size: 16px;
    font-weight: normal;
    opacity: 0.8;
    line-height: 1;
}

.header .icons svg {
    margin-left: 10px;
}
.header .icons {
    position: absolute;
    top: 16px;
    right: 15px;
    display: flex;
}

/* Pages */
.page {
    display: none;
    padding: 0 15px;
    margin-top: -60px;
}
.page.active {
    display: block;
}

/* Card */
.card {
    background-color: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    position: relative;
}

.card-top-link {
    text-align: right;
    font-size: 12px;
    color: #999;
    margin-bottom: 10px;
}

.card-title {
    text-align: center;
    font-size: 14px;
    color: #666;
}

.amount-display {
    text-align: center;
    font-size: 36px;
    font-weight: bold;
    color: #0066ff;
    margin: 10px 0;
    letter-spacing: 2px;
}

.card-subtitle {
    text-align: center;
    font-size: 12px;
    color: #999;
    margin-bottom: 20px;
}

/* Plate Input Area */
.plate-input-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.plate-box {
    width: 32px;
    height: 40px;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    font-weight: bold;
    position: relative;
    background: #fff;
}
.fixed-prefix {
    background: #eef4ff;
    color: #0066ff;
    border-color: #bfd6ff;
}
.plate-box.active {
    border-color: #0066ff;
    box-shadow: 0 0 0 2px rgba(0,102,255,0.2);
}

.plate-dot {
    font-size: 20px;
    color: #999;
}

.new-energy-box {
    border: 1px dashed #4caf50;
    color: #4caf50;
    background: #f0fdf4;
}

.ne-text {
    font-size: 10px;
    writing-mode: vertical-lr;
    transform: scale(0.8);
}

/* Primary Button */
.btn-primary {
    width: 100%;
    background-color: #0066ff;
    color: #fff;
    border: none;
    border-radius: 25px;
    padding: 15px 0;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    position: relative;
}

.btn-primary.disabled {
    background-color: #a0c4ff;
    pointer-events: none;
}

.hand-cursor {
    position: absolute;
    width: 30px;
    height: 30px;
    right: 30%;
    bottom: -15px;
    display: none;
    animation: bounce 1s infinite alternate;
}

@keyframes bounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(-10px); }
}

/* Bottom Links */
.bottom-links {
    margin-top: 20px;
}

.chat-banner {
    background: #fff;
    border-radius: 20px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    font-size: 12px;
    margin-bottom: 20px;
}
.chat-banner img { width: 24px; height: 24px; margin-right: 10px; }
.chat-banner a { margin-left: auto; color: #0066ff; text-decoration: none; }

.faq-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}
.faq-item {
    background: #fff;
    padding: 12px;
    text-align: center;
    border-radius: 8px;
    font-size: 13px;
    color: #0066ff;
}

.footer-text {
    text-align: center;
    font-size: 10px;
    color: #ccc;
    margin-bottom: 20px;
}

/* Modals & Overlay */
.overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    z-index: 100;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 12px;
    width: 85%;
    max-width: 400px;
    z-index: 101;
    display: none;
    padding: 20px;
}

.modal.bottom-sheet {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    max-width: none;
    border-radius: 24px 24px 0 0;
    transform: translateY(100%);
    transition: transform 0.26s ease;
    padding: 14px 14px calc(16px + env(safe-area-inset-bottom, 0px));
}
.agreement-modal.bottom-sheet {
    border-radius: 18px 18px 0 0;
    padding: 0 0 calc(14px + env(safe-area-inset-bottom, 0px));
    max-height: 92vh;
    overflow-y: auto;
}
.modal.bottom-sheet.show {
    transform: translateY(0);
}
.sheet-handle {
    width: 38px;
    height: 4px;
    border-radius: 2px;
    background: #d9dee3;
    margin: 0 auto 10px;
}
.sheet-title {
    text-align: center;
    color: #1f2329;
    font-size: 16px;
    margin-bottom: 12px;
}

.phone-modal input {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 20px;
}

/* Agreement Modal */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid #f0f1f3;
    margin-bottom: 0;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2;
}
.modal-header h3 { font-size: 17px; font-weight: 600; letter-spacing: 0.5px; }
.close-modal { font-size: 34px; color: #111; cursor: pointer; line-height: 0.9; }

.modal-body {
    padding: 16px 18px 0;
}
.highlight-amount { color: #1f7cff; font-weight: 700; font-size: 30px; }
.small-text { font-size: 13px; color: #979ba1; line-height: 1.45; }

.quota-box {
    background: #f7f7f8;
    border-radius: 14px;
    padding: 14px 14px 12px;
}
.quota-line {
    font-size: 15px;
    font-weight: 600;
    color: #1f2329;
    margin-bottom: 6px;
}
.quota-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 2px;
}
.quota-bank {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid #eee;
    font-size: 15px;
    color: #8f9499;
}
.tag-group {
    display: flex;
    align-items: center;
    gap: 10px;
}
.status-tag {
    border: 1px solid #ddd;
    background: #f8f8f8;
    color: #1f2329;
    border-radius: 10px;
    min-width: 92px;
    height: 36px;
    font-size: 15px;
    cursor: pointer;
    position: relative;
}
.status-tag.active {
    border-color: #94c5ff;
    color: #0a6fff;
    background: #fff;
}
.status-tag.active::after {
    content: "✓";
    position: absolute;
    right: 0;
    bottom: 0;
    width: 18px;
    height: 18px;
    background: #0a6fff;
    color: #fff;
    font-size: 12px;
    border-radius: 6px 0 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
#confirm-plate {
    font-size: 16px;
    color: #7f848b;
    letter-spacing: 1px;
}
#confirm-phone {
    font-size: 16px;
    color: #1f2329;
    letter-spacing: 1px;
}

.agreement-box {
    background: #fff;
    padding: 14px 0 0;
    border-radius: 0;
    margin: 0;
    border-bottom: 1px solid #eee;
}
.agreement-box h4 {
    margin-bottom: 10px;
    color: #1f2329;
    font-size: 16px;
    text-align: center;
    font-weight: 700;
}
.warn-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
}
.warn-content {
    font-size: 14px;
    line-height: 1.5;
    color: #2d3238;
    margin-bottom: 12px;
}
.agree-links {
    border-top: 1px solid #eee;
    padding-top: 10px;
}
.link-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}
.agree-links a {
    color: #2e333a;
    text-decoration: none;
    font-size: 13px;
}
.agree-links .link-muted {
    color: #b0b4ba;
}
.link-ext {
    color: #5e646b;
    font-size: 13px;
    white-space: nowrap;
}
#btn-agree-submit {
    margin-top: 14px;
    height: 52px;
    border-radius: 30px;
    font-size: 18px;
    font-weight: 500;
}

/* Review Page */
.review-content {
    text-align: center;
    padding: 165px 24px 40px;
    background: #fff;
    min-height: calc(100vh - 58px);
}
.review-icon { margin-bottom: 22px; }
.review-icon svg circle { fill: #4a7dff; stroke: #4a7dff; }
.review-icon svg polyline { stroke: #fff; stroke-width: 2.6; }
.review-content h2 { color: #0066ff; margin-bottom: 58px; font-size: 24px; line-height: 1.1; font-weight: 500; }
.review-content p { color: #4b525a; font-size: 20px; margin-bottom: 120px; line-height: 1.25; }
.review-page {
    padding: 0;
    margin-top: 0;
    background: #fff;
}
.review-page .btn-primary {
    width: 58%;
    margin: 0 auto;
    font-size: 16px;
    border-radius: 40px;
    padding: 13px 0;
}

/* Review mode header (match screenshot) */
.app-container.is-review .header {
    height: 58px;
    padding: 0 12px;
    border-bottom: 1px solid #2b8cff;
}
.app-container.is-review .header .title {
    display: none;
}
.app-container.is-review .back-btn {
    top: 16px;
    left: 12px;
}
.app-container.is-review .header .icons {
    top: 16px;
    right: 12px;
}

/* Keyboard */
.keyboard-container {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #eef2f5;
    padding: 12px 10px calc(12px + env(safe-area-inset-bottom, 0px));
    z-index: 102;
    display: none;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    overflow: hidden;
}
.keyboard-container.show {
    display: block;
    transform: translateY(0);
}

.kb-row {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
    gap: 6px;
    width: 100%;
}

.kb-key {
    background: #fff;
    border-radius: 7px;
    border: 1px solid #e4e7ea;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.15);
    flex: 0 0 auto;
    width: 100%;
    height: clamp(44px, 11vw, 64px);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: clamp(14px, 5.2vw, 26px);
    line-height: 1;
    font-weight: 400;
    cursor: pointer;
    user-select: none;
    color: #232a31;
}
.kb-key:active { background: #f6f8fa; }

.kb-key.disabled {
    color: #d1d5d9;
    cursor: not-allowed;
}

.kb-key.action {
    max-width: none;
    height: clamp(52px, 13vw, 72px);
    font-size: clamp(16px, 4.6vw, 30px);
    font-weight: 400;
    color: #98a0a8;
    background: #e1e5e8;
    width: auto;
}

.kb-key.action-left {
    flex: 1.2;
}

.kb-key.action-center {
    flex: 2.4;
}

.kb-key.action-center.primary {
    background: #1175ff;
    color: #fff;
}

.kb-key.action-right {
    flex: 1.2;
    font-size: clamp(20px, 5.4vw, 30px);
    color: #2a343d;
}

.kb-row.row-10 .kb-key { width: calc((100% - 9 * 6px) / 10); }
.kb-row.row-9 .kb-key { width: calc((100% - 8 * 6px) / 9); }
.kb-row.row-6 {
    justify-content: flex-start;
}
.kb-row.row-6 .kb-key {
    width: calc((100% - 9 * 6px) / 10);
}

.kb-row.action-row {
    gap: 10px;
}
