/* ==========================================
   学习机申请系统 - 前端样式
   玻璃态 + 圆润 + 强动画 + 现代化
   ========================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #667eea;
    --primary-dark: #5a6fd6;
    --secondary: #764ba2;
    --gradient: linear-gradient(135deg, var(--primary), var(--secondary));
    --bg: #f0f2f8;
    --card-bg: rgba(255,255,255,0.85);
    --card-border: rgba(255,255,255,0.3);
    --text: #2d3748;
    --text-light: #718096;
    --success: #48bb78;
    --danger: #fc8181;
    --warning: #f6ad55;
    --shadow: 0 8px 32px rgba(0,0,0,0.08);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.12);
    --radius: 20px;
    --radius-sm: 12px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* --- Animated Background --- */
.bg-animation {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: floatCircle 20s ease-in-out infinite;
}

.bg-circle.c1 {
    width: 400px; height: 400px;
    background: var(--primary);
    top: -100px; left: -100px;
    animation-delay: 0s;
}

.bg-circle.c2 {
    width: 350px; height: 350px;
    background: var(--secondary);
    bottom: -80px; right: -80px;
    animation-delay: -7s;
}

.bg-circle.c3 {
    width: 250px; height: 250px;
    background: #f093fb;
    top: 50%; left: 60%;
    animation-delay: -14s;
}

.bg-circle.c4 {
    width: 200px; height: 200px;
    background: #4facfe;
    bottom: 30%; left: 10%;
    animation-delay: -5s;
}

@keyframes floatCircle {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -40px) scale(1.05); }
    50% { transform: translate(-20px, -20px) scale(0.95); }
    75% { transform: translate(40px, 30px) scale(1.02); }
}

.bg-dots {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image: radial-gradient(rgba(102,126,234,0.1) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: moveDots 60s linear infinite;
}

@keyframes moveDots {
    0% { background-position: 0 0; }
    100% { background-position: 40px 40px; }
}

/* --- Main Container --- */
.main-container {
    position: relative;
    z-index: 1;
    max-width: 640px;
    margin: 0 auto;
    padding: 32px 20px 60px;
}

/* --- Header --- */
.app-header {
    text-align: center;
    margin-bottom: 36px;
    animation: fadeInDown 0.8s ease-out;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

.logo-wrapper {
    display: inline-block;
    margin-bottom: 16px;
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.logo-icon {
    width: 72px;
    height: 72px;
    filter: drop-shadow(0 4px 12px rgba(102,126,234,0.4));
}

.app-title {
    font-size: 28px;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.app-subtitle {
    color: var(--text-light);
    font-size: 15px;
}

/* --- Steps Indicator --- */
.steps {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.step span {
    font-size: 12px;
    color: var(--text-light);
    transition: var(--transition);
}

.step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    background: #e2e8f0;
    color: var(--text-light);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.step.active .step-circle {
    background: var(--gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(102,126,234,0.4);
    transform: scale(1.1);
}

.step.active span {
    color: var(--primary);
    font-weight: 600;
}

.step.completed .step-circle {
    background: var(--success);
    color: white;
}

.step-line {
    width: 60px;
    height: 2px;
    background: #e2e8f0;
    margin: 0 8px;
    margin-bottom: 20px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.step-line::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--gradient);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.step.completed + .step-line::after,
.step-line.active::after {
    transform: translateX(0);
}

/* --- Form --- */
.app-form {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius);
    padding: 36px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--card-border);
    animation: fadeInUp 0.8s ease-out 0.4s both;
    transition: var(--transition);
}

.form-step {
    display: none;
    animation: slideIn 0.4s ease-out;
}

.form-step.active {
    display: block;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title svg {
    color: var(--primary);
}

/* --- Input Group --- */
.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group.floating input {
    width: 100%;
    padding: 16px 16px 16px 44px;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-sm);
    font-size: 15px;
    color: var(--text);
    background: rgba(255,255,255,0.6);
    transition: all 0.3s ease;
    outline: none;
    font-family: inherit;
}

.input-group.floating input:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(102,126,234,0.1);
}

.input-group.floating label {
    position: absolute;
    left: 44px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    font-size: 15px;
    pointer-events: none;
    transition: all 0.3s ease;
    background: transparent;
    padding: 0 4px;
}

.input-group.floating input:focus + label,
.input-group.floating input:not(:placeholder-shown) + label {
    top: 0;
    transform: translateY(-50%) scale(0.85);
    color: var(--primary);
    background: white;
}

.input-group.floating label svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.input-border {
    position: absolute;
    bottom: 0; left: 0;
    width: 100%; height: 2px;
    background: var(--gradient);
    transform: scaleX(0);
    transition: transform 0.3s ease;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.input-group.floating input:focus ~ .input-border {
    transform: scaleX(1);
}

/* --- Upload Box --- */
.upload-box {
    margin-bottom: 20px;
}

.upload-zone {
    position: relative;
    border: 2px dashed #cbd5e0;
    border-radius: var(--radius-sm);
    padding: 32px;
    text-align: center;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    background: rgba(255,255,255,0.4);
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-zone:hover {
    border-color: var(--primary);
    background: rgba(102,126,234,0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102,126,234,0.15);
}

.upload-zone.has-file {
    border-style: solid;
    border-color: var(--success);
    background: rgba(72,187,120,0.05);
    padding: 8px;
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--text-light);
    transition: opacity 0.3s ease;
}

.upload-placeholder svg {
    color: var(--primary);
    opacity: 0.6;
}

.upload-placeholder span {
    font-size: 15px;
    font-weight: 500;
}

.upload-placeholder small {
    font-size: 12px;
    opacity: 0.7;
}

.upload-zone.has-file .upload-placeholder {
    opacity: 0;
    position: absolute;
}

.upload-preview {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 8px;
    display: none;
    transition: var(--transition);
}

.upload-zone.has-file .upload-preview {
    display: block;
    animation: zoomIn 0.4s ease-out;
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.upload-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: white;
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.upload-zone.has-file:hover .upload-overlay {
    opacity: 1;
    pointer-events: auto;
}

/* --- Contract Box --- */
.contract-box {
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 20px;
    transition: var(--transition);
}

.contract-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #f7fafc, #edf2f7);
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
    color: var(--text);
}

.contract-header svg {
    color: var(--primary);
}

.contract-content {
    padding: 20px;
    max-height: 300px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.8;
    color: #4a5568;
    background: #fafbfc;
}

.contract-content::-webkit-scrollbar {
    width: 6px;
}

.contract-content::-webkit-scrollbar-track {
    background: transparent;
}

.contract-content::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

/* --- Agree Checkbox --- */
.agree-box {
    margin-bottom: 24px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background: rgba(102,126,234,0.04);
    transition: var(--transition);
}

.checkbox-label:hover {
    background: rgba(102,126,234,0.08);
}

.checkbox-label input {
    display: none;
}

.checkmark {
    width: 24px;
    height: 24px;
    border: 2px solid #cbd5e0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.checkbox-label input:checked + .checkmark {
    background: var(--gradient);
    border-color: transparent;
    animation: popIn 0.3s ease-out;
}

@keyframes popIn {
    0% { transform: scale(0.8); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.agree-text {
    font-size: 15px;
    color: var(--text);
}

.checkbox-label input:checked ~ .agree-text {
    color: var(--primary);
    font-weight: 500;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 28px;
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 0; height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn-next {
    background: var(--gradient);
    color: white;
    width: 100%;
    box-shadow: 0 4px 15px rgba(102,126,234,0.3);
}

.btn-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102,126,234,0.4);
}

.btn-next:active {
    transform: translateY(0);
}

.btn-prev {
    background: #edf2f7;
    color: var(--text);
}

.btn-prev:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
}

.btn-submit {
    background: var(--gradient);
    color: white;
    width: 100%;
    box-shadow: 0 4px 15px rgba(102,126,234,0.3);
    font-size: 17px;
    padding: 16px 32px;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102,126,234,0.5);
}

.btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: var(--gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(102,126,234,0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102,126,234,0.4);
}

.btn-text { display: inline; }
.btn-loading { display: none; align-items: center; gap: 8px; }
.btn-submit.loading .btn-text { display: none; }
.btn-submit.loading .btn-loading { display: inline-flex; }

.arrow {
    transition: transform 0.3s ease;
}

.btn:hover .arrow {
    transform: translateX(3px);
}

.btn-prev:hover .arrow {
    transform: translateX(-3px);
}

.step-buttons {
    display: flex;
    gap: 12px;
}

/* --- Success Modal --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.show {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-card {
    background: white;
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 25px 80px rgba(0,0,0,0.2);
    animation: scaleUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes scaleUp {
    from { opacity: 0; transform: scale(0.8) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.success-animation {
    margin-bottom: 20px;
}

.checkmark {
    width: 80px;
    height: 80px;
}

.checkmark-circle {
    stroke-dasharray: 226;
    stroke-dashoffset: 226;
    animation: drawCircle 0.6s ease-out 0.2s forwards;
}

.checkmark-check {
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: drawCheck 0.4s ease-out 0.8s forwards;
}

@keyframes drawCircle {
    to { stroke-dashoffset: 0; }
}

@keyframes drawCheck {
    to { stroke-dashoffset: 0; }
}

.success-card h2 {
    font-size: 24px;
    color: var(--success);
    margin-bottom: 12px;
}

.success-card p {
    color: var(--text-light);
    margin-bottom: 12px;
    line-height: 1.6;
}

.success-id {
    font-size: 13px;
    color: var(--text-light);
    background: #f7fafc;
    padding: 8px 16px;
    border-radius: 50px;
    display: inline-block;
    margin-bottom: 20px;
}

/* --- Toast --- */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-120px);
    background: white;
    color: var(--text);
    padding: 14px 24px;
    border-radius: 50px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    z-index: 2000;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast.error { color: var(--danger); border: 1px solid #fed7d7; }
.toast.success { color: var(--success); border: 1px solid #c6f6d5; }

/* --- Responsive --- */
@media (max-width: 600px) {
    .app-form {
        padding: 24px 16px;
        border-radius: 16px;
    }
    
    .app-title { font-size: 22px; }
    
    .steps { gap: 0; }
    .step-line { width: 40px; }
    
    .modal-card { padding: 28px 20px; }
    
    .input-group.floating input {
        padding: 14px 14px 14px 40px;
        font-size: 14px;
    }
}

/* --- Captcha --- */
.captcha-box {
    margin: 20px 0;
}

.captcha-box label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 8px;
}

.captcha-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.captcha-question {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    min-width: 100px;
    text-align: center;
}

.captcha-input {
    flex: 1;
    max-width: 120px;
    padding: 10px 16px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s;
}

.captcha-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-refresh {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-refresh:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: rotate(180deg);
}
