/* ============================================================
   全局前端样式 (frontend.css) —— 极光天蓝炫酷版
   包含：强制滚动条防抖动、亮色天空蓝、毛玻璃、流光按钮
   ============================================================ */

/* ---------- 主题变量 ---------- */
:root {
    /* 核心提亮：亮天蓝到宝蓝的渐变 */
    --primary-color: #0ea5e9;
    --primary-dark: #0284c7;
    --primary-light: #e0f2fe;
    --secondary-color: #f8fafc;
    --text-color: #1e293b;
    --border-color: #cbd5e1;
    --error-color: #ef4444;
    --success-color: #10b981;
    --required-color: #ef4444;
    --important-bg: #f0f9ff;
    
    /* 炫酷渐变 */
    --gradient-main: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 50%, #2563eb 100%);
    --gradient-bg: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    --gradient-btn: linear-gradient(95deg, #38bdf8 0%, #0ea5e9 100%);
    --gradient-btn-hover: linear-gradient(95deg, #0ea5e9 0%, #2563eb 100%);
    
    /* 阴影（配合浅色减小不透明度） */
    --shadow-sm: 0 2px 8px rgba(14, 165, 233, 0.08);
    --shadow-md: 0 10px 30px rgba(14, 165, 233, 0.15);
    --shadow-lg: 0 20px 50px -12px rgba(14, 165, 233, 0.25);
}

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

body {
    font-family: 'Segoe UI', 'Roboto', system-ui, -apple-system, sans-serif;
    background: var(--gradient-bg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    /* 核心修复：永远保留滚动条位置，防止居中偏移 */
    overflow-y: scroll; 
    overflow-x: hidden;
}

/* 炫酷极光背景 */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(56, 189, 248, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(147, 197, 253, 0.2) 0%, transparent 40%);
    animation: aurora 12s ease-in-out infinite alternate;
    z-index: -1;
    pointer-events: none;
}

@keyframes aurora {
    0% { transform: scale(1) rotate(0deg); }
    100% { transform: scale(1.1) rotate(5deg); }
}

.container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 680px;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    z-index: 1;
    margin: auto; /* 配合 flex 确保绝对居中 */
}

/* ---------- 头部 ---------- */
.header {
    background: var(--gradient-main);
    color: white;
    padding: 36px 28px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* 头部网格纹理 */
.header::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255,255,255,0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.8;
}

.header h1 {
    position: relative;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.header .subtitle {
    position: relative;
    font-size: 16px;
    opacity: 0.95;
    font-weight: 500;
    margin-bottom: 12px;
}

.header .badge {
    position: relative;
    display: inline-block;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    backdrop-filter: blur(4px);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.2); }
    50% { box-shadow: 0 0 0 6px rgba(255,255,255,0); }
}

/* ---------- 表单区 ---------- */
.form-container {
    padding: 32px 28px;
}

.form-group {
    margin-bottom: 22px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-color);
    font-weight: 600;
    font-size: 14px;
    transition: color 0.2s;
}

.form-group label .required {
    color: var(--required-color);
    font-size: 16px;
    margin-left: 2px;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.form-group label .optional {
    color: #94a3b8;
    font-size: 12px;
    font-weight: normal;
    margin-left: 6px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    font-size: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #f8fafc;
    font-family: inherit;
    color: var(--text-color);
}

.form-group input:hover,
.form-group textarea:hover {
    border-color: #bae6fd; /* 浅蓝悬停 */
    background: #fff;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    background: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15), 0 8px 20px -6px rgba(14, 165, 233, 0.2);
    transform: translateY(-2px);
}

.input-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #64748b;
}

/* ---------- 提示区 ---------- */
.important-notice {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 18px;
    padding: 20px 22px;
    margin: 24px 0 20px;
    border-left: 5px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.important-notice::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
    animation: shimmer 3s infinite linear;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.important-notice h3 {
    color: var(--primary-dark);
    font-size: 15px;
    margin-bottom: 12px;
    font-weight: 700;
}

.important-notice ul { list-style: none; padding: 0; }

.important-notice li {
    padding: 6px 0 6px 26px;
    position: relative;
    color: #334155;
    font-size: 13.5px;
    line-height: 1.5;
}

.important-notice li:before {
    content: "✓";
    color: var(--primary-dark);
    position: absolute;
    left: 0;
    top: 6px;
    font-weight: bold;
    display: inline-block;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    background: rgba(14, 165, 233, 0.15);
    border-radius: 50%;
    font-size: 12px;
}

/* 客服链接 */
.customer-service-link,
.customer-service-link-prominent {
    color: white !important;
    background: var(--gradient-btn);
    padding: 4px 12px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    margin-left: 6px;
    display: inline-block;
    transition: all 0.3s;
    box-shadow: 0 2px 10px rgba(14, 165, 233, 0.3);
}

.customer-service-link:hover,
.customer-service-link-prominent:hover {
    background: var(--gradient-btn-hover);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.5);
    text-decoration: none;
}

/* ---------- 提交按钮（流光炫酷版） ---------- */
.submit-btn {
    width: 100%;
    padding: 16px;
    background: var(--gradient-btn);
    color: white;
    border: none;
    border-radius: 40px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 12px;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

/* 按钮流光 */
.submit-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.6s ease;
    z-index: -1;
}

.submit-btn:hover::before {
    left: 100%;
}

.submit-btn:hover {
    background: var(--gradient-btn-hover);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px -5px rgba(14, 165, 233, 0.5);
}

.submit-btn:active {
    transform: translateY(-1px) scale(0.99);
}

.submit-btn:disabled {
    background: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.submit-btn.loading {
    color: transparent;
    pointer-events: none;
}

.submit-btn.loading::after {
    content: '';
    position: absolute;
    width: 22px; height: 22px;
    top: 50%; left: 50%;
    margin: -11px 0 0 -11px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 2;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 消息提示 */
.message {
    margin-top: 20px;
    padding: 14px 18px;
    border-radius: 16px;
    display: none;
    font-size: 14px;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.success {
    display: block;
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.message.error {
    display: block;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ============================================================
   页脚及底部链接（炫酷胶囊版）
   ============================================================ */
.footer,
.copyright {
    text-align: center;
    padding: 20px;
    background: rgba(248, 250, 252, 0.8);
    border-top: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 13px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px; /* 稍微拉开间距 */
}

.copyright a,
.footer a {
    display: inline-block;
    color: var(--primary-dark) !important;
    text-decoration: none !important;
    font-weight: 600;
    padding: 4px 12px;
    background: #e0f2fe;
    border-radius: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}

.copyright a:hover,
.footer a:hover {
    background: var(--primary-color);
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

/* ============================================================
   弹窗样式 (Modal) —— 冰蓝炫酷版
   ============================================================ */
.modal {
    display: none; 
    position: fixed;
    z-index: 1000;
    left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    animation: fadeIn 0.3s;
    padding: 20px;
    overflow-y: auto;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #ffffff;
    width: 100%;
    max-width: 500px;
    border-radius: 24px;
    overflow: hidden;
    animation: zoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    margin: auto;
}

.modal-header {
    background: var(--gradient-main);
    color: white;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* 兼容 .close 和 .close-success */
.modal-header .close,
.modal-header .close-success {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.2s;
}

.modal-header .close:hover,
.modal-header .close-success:hover {
    transform: rotate(90deg) scale(1.1);
}

.modal-body {
    padding: 28px 24px;
    text-align: center;
}

.modal-desc {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 20px;
}

.rule-box {
    background: #f8fafc;
    border-radius: 16px;
    padding: 20px;
    margin: 0 0 24px;
    border: 1px solid #e2e8f0;
    border-left: 5px solid var(--primary-color);
    text-align: left;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.rule-title {
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--primary-dark);
    font-size: 14px;
}

.rule-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rule-list li {
    padding: 8px 0 8px 24px;
    position: relative;
    font-size: 13.5px;
    color: #475569;
    line-height: 1.5;
}

.rule-list li:before {
    content: "✦";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.modal-btn {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s;
}

.yes-btn {
    background: var(--gradient-btn);
    color: white;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.yes-btn:hover {
    background: var(--gradient-btn-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.4);
}

.no-btn {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.no-btn:hover {
    background: #e2e8f0;
    color: #334155;
    transform: translateY(-2px);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* 响应式 */
@media (max-width: 560px) {
    .container { border-radius: 24px; }
    .form-container { padding: 24px 20px; }
    .header { padding: 28px 20px; }
    .header h1 { font-size: 24px; }
    .modal-buttons { flex-direction: column; gap: 10px; }
}