/* =============================================
   2026年高考录取结果查询系统
   样式参考: datav-h5.jobpi.cn
   ============================================= */

:root {
    --primary: #1677FF;
    --primary-hover: #4096FF;
    --primary-light: #E6F4FF;
    --primary-active: #0958D9;
    --danger: #FF4D4F;
    --success: #52C41A;
    --warning: #FAAD14;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-tertiary: #9CA3AF;
    --border-color: #E5E7EB;
    --bg-page: #F5F7FA;
    --bg-card: #FFFFFF;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 12px;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

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

body {
    font-family: var(--font-family);
    background: var(--bg-page) url('../images/bj.jpg') no-repeat center top / cover;
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.60);
    pointer-events: none;
    z-index: 0;
}

/* Ensure all direct children of body are above the overlay */
body > * {
    position: relative;
    z-index: 1;
}

/* =============================================
   Header
   ============================================= */
.header {
    background: linear-gradient(135deg, #1677FF 0%, #0958D9 100%);
    padding: 40px 20px 32px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.3;
    pointer-events: none;
}

.header-logo {
    width: 42px;
    height: 42px;
    background: transparent;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    border: 2px solid rgba(255,255,255,0.3);
}

.header-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-title {
    font-size: 26px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 2px;
}

.header-subtitle {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    margin-top: 6px;
    font-weight: 400;
}

/* =============================================
   Main Container
   ============================================= */
.container {
    max-width: 460px;
    margin: 0 auto;
    padding: 0 14px 48px;
}

.card {
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow);
    margin-top: -12px;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.card-header {
    padding: 24px 28px 0;
}

.card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.card-body {
    padding: 24px 28px 32px;
}

/* =============================================
   Form Elements
   ============================================= */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    font-size: 17px;
    font-weight: 500;
    font-family: var(--font-family);
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    background: #FAFAFA;
    color: var(--text-primary);
    transition: all 0.2s ease;
    outline: none;
}

.form-input:hover {
    border-color: #B8D9FF;
}

.form-input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.1);
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

.form-input.is-error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(255, 77, 79, 0.1);
}

/* =============================================
   Buttons
   ============================================= */
.btn-row {
    display: flex;
    gap: 14px;
    margin-top: 24px;
}

.btn {
    flex: 1;
    height: 52px;
    border-radius: 10px;
    font-size: 17px;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-primary:active {
    background: var(--primary-active);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-outline {
    background: #fff;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    background: #F5F5F5;
    border-color: #D9D9D9;
}

.btn-outline:active {
    background: #EBEBEB;
}

.btn-outline:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-sm {
    height: 40px;
    font-size: 15px;
    font-weight: 600;
    padding: 0 16px;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-success {
    background: var(--success);
    color: #fff;
}

/* =============================================
   Tip / Hint Box
   ============================================= */
.tip-box {
    margin-top: 24px;
    padding: 14px 18px;
    background: #FFFBE6;
    border: 2px solid #FFD666;
    border-radius: 10px;
    text-align: center;
}

.tip-box .tip-text {
    font-size: 15px;
    font-weight: 600;
    color: #D4380D;
    line-height: 1.7;
}

.tip-box .tip-title {
    font-weight: 800;
    font-size: 16px;
    margin-bottom: 4px;
    color: #CF1322;
}

/* =============================================
   Result Card
   ============================================= */
.result-card {
    margin-top: 24px;
    background: linear-gradient(145deg, #fff 0%, #F8FAFF 100%);
    border: 2px solid #B8D9FF;
    border-radius: 16px;
    padding: 28px 24px;
    text-align: center;
    animation: slideUp 0.4s ease;
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--primary), var(--primary-hover));
}

.result-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--success);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    padding: 8px 20px;
    border-radius: 24px;
    margin-bottom: 20px;
}

.result-name {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.result-id {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-family: "SF Mono", "Monaco", monospace;
}

.result-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.result-major {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 20px;
}

.result-school {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.result-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 16px;
}

/* =============================================
   Error Message
   ============================================= */
.error-msg {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #FFF1F0;
    border: 1px solid #FFA39E;
    border-radius: var(--radius);
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #CF1322;
    animation: shake 0.4s ease;
}

/* =============================================
   Loading
   ============================================= */
.loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    flex-direction: column;
    gap: 12px;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #E6F4FF;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    font-size: 14px;
    color: var(--text-secondary);
}

/* =============================================
   Result Overlay (弹出蒙版)
   ============================================= */
.result-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow-y: auto;
    padding: 16px;
}
.result-overlay.active {
    opacity: 1;
}

.result-modal {
    position: relative;
    max-width: 440px;
    width: 100%;
    animation: modalIn 0.35s ease;
}
.result-close {
    position: absolute;
    top: 8px; right: 12px;
    font-size: 28px;
    color: #fff;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.result-close:hover {
    opacity: 1;
}

@keyframes modalIn {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* ===== 录取喜报海报 ===== */
.poster-container {
    position: relative;
    width: 100%;
    max-width: 460px;
    aspect-ratio: 9 / 16;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    overflow: hidden;
    margin: 0 auto;
}
.bg-image {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: 1;
}
.text-layer {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 56%;
}
.info-box {
    width: 82%;
    display: flex;
    flex-direction: column;
}
.info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    color: #000;
}
.info-table td {
    border: 1px solid #666;
    padding: 12px 14px;
    background-color: rgba(255, 250, 235, 0.85);
}
.info-table td:first-child {
    width: 28%;
    text-align: center;
    font-weight: bold;
}
.info-table td:last-child {
    width: 72%;
    text-align: left;
}
.congrats-msg {
    border-top: 1px solid #666;
    border-bottom: 1px solid #666;
    background-color: rgba(255, 250, 235, 0.85);
    padding: 12px 0;
    margin-top: -1px;
    font-weight: bold;
    font-size: 15px;
    text-align: center;
    color: #000;
}
.footer-note {
    margin-top: 12px;
    font-size: 11px;
    color: #444;
    text-align: center;
    background-color: rgba(255, 250, 235, 0.5);
    padding: 6px 0;
    border-radius: 4px;
}
.poster-actions {
    text-align: center;
    margin-top: 16px;
}
.poster-actions .btn {
    min-width: 140px;
}

/* =============================================
   Toast
   ============================================= */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: #fff;
    border-radius: var(--radius);
    padding: 14px 22px;
    box-shadow: var(--shadow-lg);
    font-size: 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: toastIn 0.3s ease;
    pointer-events: auto;
    max-width: 360px;
}

.toast.toast-error {
    border-left: 4px solid var(--danger);
}

.toast.toast-success {
    border-left: 4px solid var(--success);
}

/* =============================================
   Admin Styles
   ============================================= */
.admin-body {
    background: var(--bg-page);
    min-height: 100vh;
}

.admin-header {
    background: linear-gradient(135deg, #1677FF 0%, #0958D9 100%);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
}

.admin-header-title {
    font-size: 18px;
    font-weight: 600;
}

.admin-header-nav {
    display: flex;
    gap: 8px;
}

.admin-header-nav a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.admin-header-nav a:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

.admin-header-nav a.active {
    background: rgba(255,255,255,0.2);
    color: #fff;
    font-weight: 500;
}

.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.admin-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 20px;
}

.admin-card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

/* Table */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.admin-table th,
.admin-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.admin-table th {
    background: #F8FAFC;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-table tr:hover td {
    background: #F8FAFF;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 20px;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s;
}

.pagination a {
    background: #fff;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.pagination a:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination a.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Admin Login */
.admin-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-page);
    padding: 20px;
}

.admin-login-box {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px 32px;
    width: 100%;
    max-width: 380px;
}

.admin-login-title {
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 24px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary);
}

.stat-card.blue { border-left-color: var(--primary); }
.stat-card.green { border-left-color: var(--success); }
.stat-card.orange { border-left-color: var(--warning); }
.stat-card.red { border-left-color: var(--danger); }
.stat-card.purple { border-left-color: #722ED1; }
.stat-card.purple .stat-value { color: #722ED1; }

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.3s ease;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
}

.modal-body {
    padding: 20px 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-tertiary);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.modal-close:hover {
    background: #F5F5F5;
    color: var(--text-primary);
}

/* Captcha */
.captcha-container {
    margin-bottom: 20px;
    padding: 14px;
    background: #FAFAFA;
    border-radius: 10px;
    border: 1.5px dashed var(--border-color);
}

.captcha-slider {
    width: 100%;
    height: 48px;
    background: #E5E7EB;
    border-radius: 24px;
    position: relative;
    cursor: pointer;
    user-select: none;
}

.captcha-slider-track {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--success), #95DE64);
    border-radius: 20px;
    width: 0;
    transition: none;
}

.captcha-slider-thumb {
    position: absolute;
    left: 0;
    top: -2px;
    width: 44px;
    height: 44px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: transform 0.1s;
    cursor: grab;
}

.captcha-slider-thumb:active {
    cursor: grabbing;
}

.captcha-label {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 13px;
    color: var(--text-secondary);
    pointer-events: none;
    white-space: nowrap;
}

.captcha-success .captcha-label {
    color: #fff;
}

/* =============================================
   Animations
   ============================================= */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

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

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

/* =============================================
   Responsive
   ============================================= */
@media (max-width: 480px) {
    .container {
        padding: 0 10px 32px;
    }
    .header {
        padding: 32px 16px 24px;
    }
    .header-title {
        font-size: 23px;
    }
    .header-subtitle {
        font-size: 13px;
    }
    .card-body {
        padding: 20px 20px 28px;
    }
    .card-header {
        padding: 20px 20px 0;
    }
    .form-input {
        height: 50px;
        font-size: 16px;
    }
    .btn {
        height: 48px;
        font-size: 16px;
    }
    .result-name {
        font-size: 24px;
    }
    .result-major {
        font-size: 18px;
    }
    .admin-container {
        padding: 16px;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .admin-table {
        font-size: 13px;
    }
    .admin-table th,
    .admin-table td {
        padding: 8px 10px;
    }
}

/* Admin login responsive */
@media (max-width: 480px) {
    .admin-login-box {
        padding: 32px 24px;
    }
}
