/* 表单页 - 过年喜庆 · 红红火火 · 一屏简洁 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --festive-red: #c41e3a;
    --festive-red-dark: #a01830;
    --festive-gold: #d4a017;
    --festive-gold-light: #f5d76e;
    --bg-warm: #fff8f0;
    --bg-cream: #fffbf5;
    --bg-card: #ffffff;
    --text-primary: #2c1810;
    --text-secondary: #5c4033;
    --text-muted: #8b7355;
    --border: rgba(196, 30, 58, 0.25);
    --shadow-red: rgba(196, 30, 58, 0.15);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(180deg, #fff5eb 0%, #ffe8e0 40%, #fff0e8 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

.form-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 24px 16px 20px;
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
    position: relative;
}

.form-main {
    flex: 1;
    position: relative;
    z-index: 1;
}

/* 过年喜庆装饰 - 红金氛围 */
.festive-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
    background: 
        radial-gradient(ellipse 80% 50% at 50% 0%, rgba(212, 160, 23, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 20% 80%, rgba(196, 30, 58, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 90%, rgba(196, 30, 58, 0.08) 0%, transparent 50%);
}

.lantern {
    position: absolute;
    font-size: 32px;
    filter: drop-shadow(0 2px 4px rgba(196, 30, 58, 0.3));
    animation: sway 3s ease-in-out infinite;
}
.lantern:nth-child(1) { top: 16px; left: 8%; }
.lantern:nth-child(2) { top: 16px; right: 8%; animation-delay: 0.5s; }
.confetti {
    position: absolute;
    font-size: 20px;
    top: 18%;
    right: 6%;
    animation: twinkle 2s ease-in-out infinite;
}
.confetti-2 {
    top: auto;
    bottom: 25%;
    left: 5%;
    right: auto;
    animation-delay: 0.8s;
}

@keyframes sway {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}
@keyframes twinkle {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.form-header {
    text-align: center;
    margin-bottom: 24px;
}

.form-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--festive-red);
    text-shadow: 0 2px 4px rgba(196, 30, 58, 0.2);
}

.form-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-desc {
    font-size: 13px;
    color: var(--text-muted);
}

.form-card {
    background: var(--bg-card);
    border: 2px solid rgba(196, 30, 58, 0.2);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 4px 24px var(--shadow-red), 0 0 0 1px rgba(212, 160, 23, 0.1);
}

.form-row {
    margin-bottom: 18px;
}

.form-row:last-of-type { margin-bottom: 0; }

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-label .required { color: var(--festive-red); }

.form-input,
.form-select {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-cream);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--festive-red);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* 出生日期：年/月/日分开，手动输入无bug */
.date-inputs {
    display: flex;
    align-items: center;
    gap: 6px;
}

.date-part {
    flex: 1;
    text-align: center;
    min-width: 0;
}

.date-sep {
    color: var(--text-muted);
    font-size: 16px;
}

.time-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.time-row .form-input { flex: 1; min-width: 120px; }

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}

.checkbox-label input { width: 16px; height: 16px; cursor: pointer; }

.help-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* 标签 */
.tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-btn {
    padding: 8px 14px;
    background: var(--bg-cream);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.tag-btn:hover {
    border-color: var(--festive-red);
    color: var(--festive-red);
}

.tag-btn.selected {
    background: linear-gradient(135deg, var(--festive-red) 0%, var(--festive-red-dark) 100%);
    border-color: var(--festive-red);
    color: #fff;
    font-weight: 600;
}

.limit-hint {
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    margin: 16px 0;
    font-size: 13px;
}

.limit-hint.available {
    background: rgba(212, 160, 23, 0.15);
    color: var(--festive-red-dark);
}

.limit-hint.exhausted {
    background: rgba(196, 30, 58, 0.1);
    color: var(--festive-red);
}

.btn-submit {
    width: 100%;
    padding: 16px;
    margin-top: 8px;
    background: linear-gradient(135deg, var(--festive-red) 0%, var(--festive-red-dark) 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 20px var(--shadow-red);
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(196, 30, 58, 0.35);
}

.btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-submit .btn-icon { font-size: 22px; }

.error-message {
    display: none;
    padding: 12px;
    background: rgba(231, 76, 60, 0.15);
    border: 1px solid var(--festive-red);
    border-radius: 8px;
    color: var(--festive-red);
    font-size: 14px;
    margin-bottom: 16px;
}

.error-message.show { display: block; }

/* 今日次数用完弹窗 */
.quota-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}
.quota-modal-content {
    background: #fff;
    border-radius: 16px;
    padding: 32px 24px;
    max-width: 320px;
    width: 100%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.quota-modal-icon {
    font-size: 48px;
    margin-bottom: 16px;
}
.quota-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 12px 0;
}
.quota-modal-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin: 0 0 24px 0;
}
.quota-modal-btn {
    width: 100%;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--festive-red) 0%, var(--festive-red-dark) 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

/* 车库迷你 */
.garage-mini {
    text-align: center;
    padding: 16px;
}

.garage-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: block;
}

.garage-empty {
    font-size: 14px;
    color: var(--text-muted);
}

.garage-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.garage-link {
    padding: 6px 12px;
    background: var(--bg-cream);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--festive-red);
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s;
}

.garage-link:hover {
    border-color: var(--festive-red);
    background: rgba(196, 30, 58, 0.08);
}

/* 加载遮罩 - 喜庆暖色 */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, #fff8f0 0%, #ffe8e0 100%);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.loading-overlay.active { display: flex; }

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(196, 30, 58, 0.2);
    border-top-color: var(--festive-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
    margin-top: 16px;
    color: var(--text-primary);
    font-size: 16px;
}

.toast-msg {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--festive-red);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    z-index: 10001;
    animation: fadeIn 0.2s ease;
    box-shadow: 0 4px 16px var(--shadow-red);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@media (max-width: 400px) {
    .form-title { font-size: 24px; }
    .date-part { font-size: 14px; }
}

.site-footer {
    flex-shrink: 0;
    width: 100%;
    margin-top: auto;
    padding: 20px 0 calc(12px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(196, 30, 58, 0.08);
    text-align: center;
}

.site-footer-copy,
.site-footer-icp {
    display: block;
    width: 100%;
    text-align: center;
    font-size: 11px;
    line-height: 1.5;
    margin: 0 auto;
}

.site-footer-copy {
    color: var(--text-muted);
    margin-bottom: 4px;
}

.site-footer-icp a {
    color: #999;
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-footer-icp a:hover {
    color: var(--festive-red);
    text-decoration: underline;
}
