/* =========================================================
   卡片分拣管理系统 - 前台样式（参考协会官网风格）
   ========================================================= */
:root {
    --primary: #0674c3;
    --primary-light: #3b82f6;
    --primary-dark: #075985;
    --secondary: #60a5fa;
    --accent: #f59e0b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg-dark: #0f172a;
    --bg-card: #ffffff;
    --bg-page: #eff6ff;
    --bg-section: #dbeafe;
    --border: #bfdbfe;
    --border-light: #eff6ff;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-white: #ffffff;
    --shadow-sm: 0 1px 3px rgba(6, 116, 195, 0.08);
    --shadow-md: 0 4px 15px rgba(6, 116, 195, 0.1);
    --shadow-lg: 0 10px 30px rgba(6, 116, 195, 0.12);
    --shadow-xl: 0 15px 45px rgba(6, 116, 195, 0.15);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 14px; line-height: 1.7; color: var(--text-primary);
    background: var(--bg-page); min-height: 100vh;
    display: flex; flex-direction: column;
}
a { text-decoration: none; color: inherit; transition: all 0.25s ease; }
img { max-width: 100%; height: auto; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ================ Header（参考官网） ================ */
.site-header {
    background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 50%, #1e293b 100%);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.35);
}
.header-top { background: rgba(0, 0, 0, 0.2); padding: 8px 0; font-size: 13px; }
.header-top .container { display: flex; justify-content: space-between; align-items: center; }
.header-top .contact-info { display: flex; gap: 20px; opacity: 0.9; }
.header-top .contact-info i { margin-right: 5px; }
.header-top .auth-links { display: flex; gap: 12px; align-items: center; }
.header-top .auth-links a {
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
}
.header-top .auth-links a.btn-login {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-white);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.header-top .auth-links a.btn-login:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: translateY(-2px);
}
.header-top .auth-links a.btn-register {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(6, 116, 195, 0.45);
}
.header-top .auth-links a.btn-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(6, 116, 195, 0.55);
}
.header-top .auth-links a.btn-user {
    color: rgba(255, 255, 255, 0.9);
    padding: 6px 12px;
}
.header-top .auth-links a.btn-user:hover { color: var(--secondary); }
.header-top .auth-links a.btn-logout {
    color: rgba(255, 255, 255, 0.7);
    padding: 6px 12px;
}
.header-top .auth-links a.btn-logout:hover { color: #fca5a5; }

.header-main { padding: 16px 0; }
.header-main .container { display: flex; justify-content: space-between; align-items: center; }
.logo { display: flex; align-items: center; gap: 16px; color: #fff; }
.logo img.logo-img {
    width: 56px; height: 56px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
}
.logo-icon {
    width: 52px; height: 52px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; color: #fff;
    border: 2px solid rgba(6, 116, 195, 0.5);
    box-shadow: 0 4px 16px rgba(6, 116, 195, 0.3);
}
.logo-text h1 { font-size: 20px; font-weight: 700; margin: 0; letter-spacing: 1px; }
.logo-text p { font-size: 12px; opacity: 0.6; margin: 2px 0 0; letter-spacing: 1px; }

/* ================ Navigation ================ */
.nav-bar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 999;
}
.nav-bar .container { display: flex; align-items: center; justify-content: space-between; }
.nav-menu { display: flex; list-style: none; gap: 2px; }
.nav-menu a {
    display: block;
    padding: 16px 22px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    position: relative;
    transition: all 0.3s;
}
.nav-menu a:hover, .nav-menu a.active {
    color: var(--primary);
    background: rgba(6, 116, 195, 0.06);
}
.nav-menu a.active::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 2px;
}
.mobile-menu-btn { display: none; background: none; border: none; color: var(--text-primary); font-size: 24px; cursor: pointer; padding: 10px; }

/* ================ Main ================ */
.main-content { flex: 1; padding: 30px 0; }

/* ================ Hero（首页横幅） ================ */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 30%, #0c4a6e 60%, var(--bg-dark) 100%);
    color: #fff;
    padding: 90px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: "";
    position: absolute;
    top: -50%; right: -20%;
    width: 70%; height: 140%;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
}
.hero::after {
    content: "";
    position: absolute;
    bottom: -35%; left: -15%;
    width: 55%; height: 90%;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 50%;
}
.hero .container { position: relative; z-index: 1; }
.hero h2 {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 20px;
    letter-spacing: 3px;
    text-shadow: 0 6px 25px rgba(0, 0, 0, 0.25);
}
.hero p {
    font-size: 18px;
    opacity: 0.95;
    margin-bottom: 36px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}
.hero-actions { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }
.hero .btn {
    font-size: 15px;
    padding: 13px 36px;
    border-radius: 28px;
    font-weight: 600;
}
.hero .btn-primary-action {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    box-shadow: 0 6px 22px rgba(6, 116, 195, 0.5);
    border: none;
}
.hero .btn-primary-action:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(6, 116, 195, 0.6);
}
.hero .btn-outline-action {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(15px);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
}
.hero .btn-outline-action:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: translateY(-3px);
}

/* ================ Card ================ */
.card {
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid var(--border-light);
}
.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-light);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(6, 116, 195, 0.03), rgba(59, 130, 246, 0.03));
}
.card-body { padding: 24px; }

/* ================ Buttons ================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(6, 116, 195, 0.3); }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-secondary { background: #e2e8f0; color: var(--text-secondary); }
.btn-secondary:hover { background: #cbd5e1; }
.btn-lg { padding: 14px 32px; font-size: 16px; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }

/* ================ Forms ================ */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; color: var(--text-primary); font-size: 14px; }
.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    background: #fff;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(6, 116, 195, 0.1);
}
.form-control:disabled { background: #f1f5f9; color: var(--text-muted); }
.input-group { position: relative; }
.input-group i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 18px; }
.input-group .form-control { padding-left: 44px; }
small.form-text { color: var(--text-muted); font-size: 12px; display: block; margin-top: 4px; }
.required { color: var(--danger); }

/* ================ Alerts ================ */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-danger { background: #fee2e2; color: #991b1b; }
.alert-warning { background: #fef3c7; color: #92400e; }
.alert-info { background: #dbeafe; color: #1e40af; }

/* ================ Badges ================ */
.badge { display: inline-block; padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: 500; }
.badge-primary { background: rgba(6, 116, 195, 0.1); color: var(--primary); }
.badge-success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.badge-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.badge-secondary { background: #f1f5f9; color: var(--text-secondary); }

/* ================ Table ================ */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border-light); }
.table th { background: var(--bg-section); font-weight: 600; color: var(--text-secondary); font-size: 13px; }
.table tbody tr:hover { background: var(--bg-page); }

/* ================ Auth Pages ================ */
.auth-wrap { min-height: calc(100vh - 200px); display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-box { background: #fff; border-radius: 20px; box-shadow: var(--shadow-xl); width: 100%; max-width: 440px; padding: 40px; border: 1px solid var(--border-light); }
.auth-header { text-align: center; margin-bottom: 32px; }
.auth-header .logo-icon { width: 64px; height: 64px; margin: 0 auto 16px; background: linear-gradient(135deg, var(--primary), var(--primary-light)); border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 28px; color: #fff; box-shadow: 0 6px 22px rgba(6, 116, 195, 0.35); }
.auth-header h1 { font-size: 22px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.auth-header p { font-size: 14px; color: var(--text-muted); }
.auth-footer { text-align: center; margin-top: 24px; padding-top: 20px; border-top: 1px solid #e2e8f0; font-size: 13px; color: var(--text-muted); }
.auth-footer a { color: var(--primary); font-weight: 500; }

/* ================ Footer（参考官网） ================ */
.site-footer {
    background: linear-gradient(135deg, var(--bg-dark) 0%, #1e293b 50%, #0f172a 100%);
    color: rgba(255, 255, 255, 0.7);
    padding: 50px 0 25px;
    margin-top: auto;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 35px;
}
.footer-section h4 {
    color: var(--text-white);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.footer-section p, .footer-section li { font-size: 13px; opacity: 0.8; line-height: 2; }
.footer-section ul { list-style: none; }
.footer-section ul a { opacity: 0.55; transition: color 0.25s; }
.footer-section ul a:hover { opacity: 1; color: var(--text-white); }
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 22px;
    text-align: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
}
.footer-bottom p { margin-bottom: 6px; }
.footer-bottom a { color: rgba(255, 255, 255, 0.5); margin: 0 6px; transition: color 0.25s; }
.footer-bottom a:hover { color: var(--text-white); }
.footer-bottom .icp-link { display: inline-flex; align-items: center; gap: 4px; }
.footer-bottom .gongan-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
}
.footer-bottom .gongan-link img.gongan-icon { width: 20px; height: 20px; vertical-align: middle; }

/* ================ Responsive ================ */
@media (max-width: 768px) {
    .nav-menu { display: none; }
    .mobile-menu-btn { display: block; }
    .nav-menu.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-card);
        z-index: 100;
        box-shadow: var(--shadow-md);
    }
    .nav-menu.open a { padding: 14px 20px; border-bottom: 1px solid var(--border-light); }
    .header-top .contact-info { display: none; }
    .auth-box { padding: 28px 20px; }
    .hero { padding: 50px 0; }
    .hero h2 { font-size: 26px; letter-spacing: 1px; }
    .hero p { font-size: 14px; margin-bottom: 24px; }
    .hero .btn { font-size: 14px; padding: 12px 24px; }
    .card-body { padding: 16px; }
    .table { font-size: 13px; }
    .table th, .table td { padding: 8px 10px; }
    .footer-grid { grid-template-columns: 1fr; text-align: center; gap: 24px; }
    .footer-section h4 { border-bottom: none; }
}

/* ================ 价格列表样式 ================ */
.price-list { display: flex; flex-direction: column; gap: 10px; }
.price-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 2px solid var(--border-light);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.price-item:hover { border-color: var(--primary-light); background: var(--bg-section); }
.price-item input[type="radio"] { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }
.price-item input[type="radio"]:checked ~ .price-info { color: var(--primary); }
.price-item:has(input:checked) { border-color: var(--primary); background: var(--bg-section); }
.price-info { display: flex; justify-content: space-between; align-items: center; flex: 1; }
.price-name { font-weight: 600; font-size: 14px; color: var(--text-primary); }
.price-amount { font-weight: 700; font-size: 18px; color: var(--danger); }

/* ================ 表单步骤指示 ================ */
.card-header .step-indicator { font-size: 12px; color: var(--text-muted); margin-left: auto; }

/* ================ 加载动画 ================ */
@keyframes spin { to { transform: rotate(360deg); } }

/* ================ 统计卡片（前后台共用） ================ */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    padding: 20px 16px;
    background: var(--bg-card);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
}
.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
}
.stat-icon.blue { background: linear-gradient(135deg, var(--primary), var(--primary-light)); }
.stat-icon.green { background: linear-gradient(135deg, var(--success), #34d399); }
.stat-icon.red { background: linear-gradient(135deg, var(--danger), #f87171); }
.stat-icon.orange { background: linear-gradient(135deg, var(--warning), #fbbf24); }
.stat-icon.purple { background: linear-gradient(135deg, #8b5cf6, #a78bfa); }
.stat-num { display: block; font-size: 28px; font-weight: 700; color: var(--text-primary); line-height: 1; }
.stat-label { display: block; font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* 后台统计卡片（横向布局） */
.stat-card-horizontal {
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 16px;
    padding: 20px 24px;
}
.stat-card-horizontal .stat-num { font-size: 24px; }
.stat-card-horizontal .stat-label { margin-top: 0; }

/* 卡片列表页样式 */
.card-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}
.card-list-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}
.card-table {
    width: 100%;
    border-collapse: collapse;
}
.card-table th,
.card-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
}
.card-table th {
    background: var(--bg-section);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
}
.card-table tbody tr:hover {
    background: var(--bg-page);
}
.card-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

@media (max-width: 640px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-card { padding: 16px 10px; }
    .stat-num { font-size: 22px; }
    .card-table { font-size: 13px; }
    .card-table th, .card-table td { padding: 8px 10px; }
}
