/* =====================================================
   校团委志愿服务时长记录系统 - 可爱马卡龙主题 🎀
   （前后端不分离 PHP 版，类名与旧版完全兼容）
   ===================================================== */

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

:root {
    /* 樱花粉主色 */
    --primary: #ff7ea5;
    --primary-dark: #ff648f;
    --primary-light: #ffe3ec;
    /* 薄荷绿 */
    --success: #3ec98f;
    --success-light: #d9f7ea;
    /* 奶油黄 */
    --warning: #ffb84d;
    --warning-light: #fff3d6;
    /* 粉红（危险） */
    --danger: #ff5c8a;
    --danger-light: #ffe0eb;
    /* 淡紫辅助 */
    --purple: #a78bfa;
    --purple-light: #efe7ff;
    /* 暖灰文字 */
    --gray-50: #fff9fb;
    --gray-100: #fdf2f6;
    --gray-200: #fbe4ec;
    --gray-300: #f5cddc;
    --gray-400: #c9a9b8;
    --gray-500: #a3849a;
    --gray-600: #7d6273;
    --gray-700: #5f4a58;
    --gray-800: #4a3a45;
    --gray-900: #3a2d37;
    /* 圆润造型 */
    --radius: 16px;
    --radius-lg: 22px;
    --radius-pill: 999px;
    /* 粉粉软软的阴影 */
    --shadow-sm: 0 2px 4px rgba(255,126,165,.08);
    --shadow: 0 4px 12px rgba(255,126,165,.12);
    --shadow-md: 0 6px 18px rgba(255,126,165,.16);
    --shadow-lg: 0 12px 30px rgba(255,126,165,.22);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Quicksand", sans-serif;
    background: #fdf5f8;
    color: var(--gray-800);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------- Topbar ---------- */
.topbar {
    background: linear-gradient(120deg, #ffb1c9 0%, #ff8fab 55%, #f7a4d0 100%);
    color: #fff;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    white-space: nowrap;
    text-shadow: 0 1px 4px rgba(214,51,108,.18);
}

.logo-icon {
    font-size: 26px;
    filter: drop-shadow(0 2px 3px rgba(214,51,108,.2));
}

.topnav {
    display: flex;
    gap: 6px;
    flex: 1;
}

.topnav a {
    color: rgba(255,255,255,.92);
    text-decoration: none;
    padding: 8px 18px;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 600;
    transition: all .2s;
}

.topnav a:hover {
    color: #fff;
    background: rgba(255,255,255,.3);
}

.topnav a.active {
    color: #ff5c8a;
    background: #fff;
    box-shadow: 0 3px 8px rgba(214,51,108,.18);
}

.user-box {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.user-name {
    font-weight: 600;
}

.btn-logout {
    color: #fff;
    text-decoration: none;
    padding: 6px 18px;
    border: 1.5px solid rgba(255,255,255,.65);
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 600;
    transition: all .2s;
}

.btn-logout:hover {
    background: rgba(255,255,255,.92);
    color: #ff5c8a;
}

/* ---------- Badges ---------- */
.badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 700;
}

.badge-admin {
    background: #fff3d6;
    color: #b07818;
}

.badge-student {
    background: rgba(255,255,255,.35);
    color: #fff;
}

.badge-pending {
    background: var(--warning-light);
    color: #b07818;
}

.badge-approved {
    background: var(--success-light);
    color: #1c8a5f;
}

.badge-rejected {
    background: var(--danger-light);
    color: #d63a68;
}

.badge-open {
    background: var(--success-light);
    color: #1c8a5f;
}

.badge-closed {
    background: var(--gray-200);
    color: var(--gray-600);
}

/* ---------- Container ---------- */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 24px;
    flex: 1;
    width: 100%;
}

/* ---------- 可爱横幅 Hero ---------- */
.hero {
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #ff9ebd 0%, #ff7ea5 60%, #f8a5d4 100%);
    color: #fff;
    padding: 30px 34px;
    margin-bottom: 26px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.hero.hero-purple {
    background: linear-gradient(135deg, #c4b0ff 0%, #a78bfa 60%, #d3b8ff 100%);
}

/* 装饰泡泡 */
.hero::before,
.hero::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,.18);
}
.hero::before {
    width: 140px; height: 140px;
    right: -30px; top: -46px;
}
.hero::after {
    width: 76px; height: 76px;
    right: 110px; bottom: -30px;
    background: rgba(255,255,255,.12);
}

.hero h2 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
    text-shadow: 0 1px 4px rgba(214,51,108,.2);
}

.hero p {
    font-size: 14px;
    opacity: .95;
    position: relative;
    z-index: 1;
}

/* ---------- Cards ---------- */
.card {
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1.5px solid var(--gray-200);
    box-shadow: var(--shadow);
    padding: 26px;
    margin-bottom: 26px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px dashed var(--gray-200);
}

.card-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--gray-800);
}

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

.stat-card {
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1.5px solid var(--gray-200);
    box-shadow: var(--shadow);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform .2s, box-shadow .2s;
}

.stat-card:hover {
    transform: translateY(-4px) rotate(-.4deg);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 58px;
    height: 58px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}

.stat-icon.blue   { background: var(--primary-light); }   /* 粉 */
.stat-icon.green  { background: var(--success-light); }
.stat-icon.amber  { background: var(--warning-light); }
.stat-icon.red    { background: var(--danger-light); }
.stat-icon.purple { background: var(--purple-light); }

.stat-info h3 {
    font-size: 28px;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1.2;
}

.stat-info p {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 2px;
}

/* ---------- Buttons（胶囊按钮） ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 24px;
    border: none;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all .2s;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #ff8fab, #ff7ea5);
    color: #fff;
    box-shadow: 0 4px 10px rgba(255,126,165,.35);
}
.btn-primary:hover { background: linear-gradient(135deg, #ff7ea5, #ff648f); transform: translateY(-1px); }

.btn-success {
    background: linear-gradient(135deg, #52d6a0, #3ec98f);
    color: #fff;
    box-shadow: 0 4px 10px rgba(62,201,143,.3);
}
.btn-success:hover { background: linear-gradient(135deg, #3ec98f, #2eb47e); transform: translateY(-1px); }

.btn-danger {
    background: linear-gradient(135deg, #ff7ba1, #ff5c8a);
    color: #fff;
    box-shadow: 0 4px 10px rgba(255,92,138,.3);
}
.btn-danger:hover { background: linear-gradient(135deg, #ff5c8a, #f0437495); }

.btn-warning {
    background: linear-gradient(135deg, #ffc66b, #ffb84d);
    color: #7a4d00;
    box-shadow: 0 4px 10px rgba(255,184,77,.3);
}
.btn-warning:hover { background: linear-gradient(135deg, #ffb84d, #ffa733); transform: translateY(-1px); }

.btn-outline {
    background: #fff;
    color: #ff5c8a;
    border: 1.5px solid #ff9ebd;
}
.btn-outline:hover { background: var(--primary-light); }

.btn-gray {
    background: var(--gray-200);
    color: var(--gray-700);
}
.btn-gray:hover { background: var(--gray-300); }

.btn-sm {
    padding: 5px 14px;
    font-size: 13px;
}

/* ---------- Tables ---------- */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius);
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

table.data-table th {
    background: var(--gray-50);
    color: var(--gray-600);
    font-weight: 700;
    text-align: left;
    padding: 12px 16px;
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}

table.data-table td {
    padding: 12px 16px;
    border-bottom: 1.5px dashed var(--gray-200);
    color: var(--gray-700);
}

table.data-table tbody tr:hover {
    background: #fff7fa;
}

table.data-table .actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ---------- Forms ---------- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.form-group label .required {
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 11px 18px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-family: inherit;
    transition: border-color .2s, box-shadow .2s;
    background: #fffdfe;
}

textarea.form-control {
    border-radius: var(--radius);
    resize: vertical;
    min-height: 90px;
}

select.form-control {
    cursor: pointer;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255,126,165,.15);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-hint {
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 4px;
}

/* ---------- Alerts ---------- */
.alert {
    padding: 12px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-success {
    background: var(--success-light);
    color: #1c8a5f;
    border: 1.5px solid #a9ebd1;
}

.alert-danger {
    background: var(--danger-light);
    color: #d63a68;
    border: 1.5px solid #ffc3d6;
}

.alert-warning {
    background: var(--warning-light);
    color: #b07818;
    border: 1.5px solid #ffe3ae;
}

.alert-info {
    background: var(--primary-light);
    color: #d63a68;
    border: 1.5px solid #ffc9da;
}

/* ---------- Login & Register ---------- */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #ffd9e6 0%, #ffb3c9 45%, #cbb6ff 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* 背景装饰泡泡 */
.auth-wrapper::before,
.auth-wrapper::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
}
.auth-wrapper::before {
    width: 260px; height: 260px;
    left: -70px; bottom: -80px;
    background: rgba(255,255,255,.25);
}
.auth-wrapper::after {
    width: 180px; height: 180px;
    right: -50px; top: -60px;
    background: rgba(255,255,255,.2);
}

.auth-card {
    background: #fff;
    border-radius: 28px;
    border: 2px solid #ffd6e3;
    box-shadow: var(--shadow-lg);
    padding: 42px 40px;
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo .icon {
    font-size: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffe3ec, #efe7ff);
    border: 2px solid #ffd6e3;
    margin-bottom: 14px;
    box-shadow: 0 6px 14px rgba(255,126,165,.2);
}

.auth-logo h1 {
    font-size: 22px;
    color: var(--gray-800);
    font-weight: 800;
}

.auth-logo p {
    font-size: 14px;
    color: var(--gray-500);
    margin-top: 4px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--gray-500);
    line-height: 2;
}

.auth-footer a {
    color: #ff5c8a;
    text-decoration: none;
    font-weight: 700;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ---------- Landing Page ---------- */
.landing-hero {
    background: linear-gradient(135deg, #ffb1c9 0%, #ff7ea5 55%, #c4b0ff 100%);
    color: #fff;
    padding: 84px 24px;
    text-align: center;
    border-radius: 0 0 32px 32px;
    position: relative;
    overflow: hidden;
}

.landing-hero h1 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 16px;
    text-shadow: 0 2px 8px rgba(214,51,108,.2);
}

.landing-hero p {
    font-size: 18px;
    opacity: .95;
    max-width: 600px;
    margin: 0 auto 32px;
}

.landing-hero .btn {
    padding: 13px 36px;
    font-size: 16px;
    background: #fff;
    color: #ff5c8a;
    box-shadow: 0 6px 16px rgba(214,51,108,.25);
}

.landing-features {
    max-width: 1000px;
    margin: -40px auto 0;
    padding: 0 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    position: relative;
    z-index: 10;
}

.feature-card {
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1.5px solid var(--gray-200);
    box-shadow: var(--shadow-md);
    padding: 30px;
    text-align: center;
    transition: transform .2s;
}

.feature-card:hover {
    transform: translateY(-4px) rotate(.4deg);
}

.feature-card .icon {
    font-size: 42px;
    margin-bottom: 12px;
    display: inline-flex;
    width: 76px;
    height: 76px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), var(--purple-light));
}

.feature-card h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 14px;
    color: var(--gray-500);
}

/* ---------- Announcement ---------- */
.announcement-item {
    padding: 16px 20px;
    border-bottom: 1.5px dashed var(--gray-200);
}

.announcement-item:last-child {
    border-bottom: none;
}

.announcement-item.pinned {
    background: #fff8e9;
    border-radius: var(--radius);
}

.announcement-item h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.announcement-item .meta {
    font-size: 12px;
    color: var(--gray-400);
    margin-bottom: 8px;
}

.announcement-item .content {
    font-size: 14px;
    color: var(--gray-600);
    white-space: pre-wrap;
}

/* ---------- Progress Bar（糖果渐变） ---------- */
.progress-bar {
    width: 100%;
    height: 12px;
    background: var(--gray-200);
    border-radius: var(--radius-pill);
    overflow: hidden;
    margin-top: 8px;
}

.progress-bar .fill {
    height: 100%;
    background: linear-gradient(90deg, #ff8fab, #a78bfa);
    border-radius: var(--radius-pill);
    transition: width .5s ease;
}

.progress-bar .fill.complete {
    background: linear-gradient(90deg, #52d6a0, #3ec98f);
}

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

.pagination a, .pagination span {
    padding: 6px 14px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-pill);
    font-size: 14px;
    text-decoration: none;
    color: var(--gray-600);
    font-weight: 600;
}

.pagination a:hover {
    background: var(--gray-100);
}

.pagination .current {
    background: linear-gradient(135deg, #ff8fab, #ff7ea5);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 3px 8px rgba(255,126,165,.3);
}

/* ---------- Footer ---------- */
.footer {
    text-align: center;
    padding: 26px;
    font-size: 13px;
    color: var(--gray-400);
    border-top: 2px dashed var(--gray-200);
    background: #fffdfe;
}

/* ---------- Misc ---------- */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted   { color: var(--gray-500); }
.fw-bold      { font-weight: 700; }
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-400);
}
.empty-state .icon {
    font-size: 52px;
    margin-bottom: 12px;
}
.empty-state p {
    font-size: 16px;
}

@media (max-width: 768px) {
    .topbar-inner {
        flex-wrap: wrap;
        height: auto;
        padding: 12px 16px;
    }
    .topnav {
        order: 3;
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    .topnav a {
        white-space: nowrap;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .container {
        padding: 20px 16px;
    }
    .landing-hero h1 {
        font-size: 26px;
    }
    .hero {
        padding: 24px 22px;
    }
    .hero h2 {
        font-size: 18px;
    }
    .auth-card {
        padding: 32px 24px;
    }
}
