:root {
    --primary: #4472C4;
    --primary-dark: #2F5597;
    --success: #4CAF50;
    --danger: #E74C3C;
    --warn: #F39C12;
    --bg: #f5f7fb;
    --card-bg: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
}

* { box-sizing: border-box; }
html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: underline; }

/* Top bar */
.topbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
    position: sticky;
    top: 0;
    z-index: 10;
}
.topbar-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 20px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand { font-weight: 700; font-size: 18px; color: var(--text); }
.brand:hover { text-decoration: none; }
.topbar-nav a {
    margin-left: 18px;
    color: var(--muted);
    font-size: 14px;
}
.topbar-nav a:hover { color: var(--primary); text-decoration: none; }
.topbar-nav a.muted { color: var(--muted); }

/* Container */
.container { max-width: 1180px; margin: 0 auto; padding: 20px; }

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    padding: 24px;
    border: 1px solid var(--border);
}
.card-title { margin: 0 0 4px; font-size: 20px; }
.card-subtitle { margin: 0 0 18px; color: var(--muted); }

/* Forms */
.form .form-row { margin-bottom: 14px; }
.form label { display: block; margin-bottom: 6px; font-weight: 500; }
.form .req { color: var(--danger); }
.form input[type="text"],
.form input[type="password"],
.form input[type="number"],
.form input[type="search"],
.form select,
.filter-bar input,
.filter-bar select {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    font-size: 14px;
    transition: border-color .15s, box-shadow .15s;
}
.form input:focus, .form select:focus,
.filter-bar input:focus, .filter-bar select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(68,114,196,.15);
    outline: none;
}
.form input[readonly] { background: #f3f4f6; color: var(--muted); }
.form-actions { display: flex; gap: 10px; margin-top: 18px; }
.hint { color: var(--muted); font-size: 12px; margin: 8px 0 0; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: #e9ecef;
    color: #374151;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.4;
    transition: background .15s, border-color .15s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #3d9140; color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c0392b; color: #fff; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: #f3f4f6; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* Flash messages */
.flashes { margin: 12px 0; }
.flash {
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 8px;
    border: 1px solid transparent;
}
.flash-success { background: #d4edda; color: #155724; border-color: #c3e6cb; }
.flash-danger  { background: #f8d7da; color: #721c24; border-color: #f5c6cb; }
.flash-warning { background: #fff3cd; color: #856404; border-color: #ffeaa7; }
.flash-info    { background: #d1ecf1; color: #0c5460; border-color: #bee5eb; }

/* Page head */
.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 4px 0 16px;
}
.page-head h2 { margin: 0; font-size: 22px; }

/* Stats */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}
.stat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    transition: box-shadow .15s, transform .15s;
    color: var(--text);
    text-decoration: none;
}
.stat-card:hover { box-shadow: 0 4px 10px rgba(0,0,0,.05); text-decoration: none; }
.stat-card.active { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(68,114,196,.15); }
.stat-num { font-size: 26px; font-weight: 700; color: var(--primary-dark); }
.stat-label { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* Filter bar */
.filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
    align-items: center;
    background: #fff;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
}
.filter-bar input { flex: 1; }
.filter-bar select { width: auto; }

/* Table */
.table-wrap {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow-x: auto;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.data-table th, .data-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.data-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
    position: sticky;
    top: 0;
}
.data-table tbody tr:hover { background: #f9fafb; }
.data-table tr:last-child td { border-bottom: none; }
.data-table .empty { text-align: center; color: var(--muted); padding: 30px; }
.data-table .actions { white-space: normal; min-width: 180px; }
.data-table .actions form, .data-table .actions button { margin: 2px 0; }
.review-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 160px;
}
.review-form .note-input {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 12px;
}
.review-form .note-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(68,114,196,.15);
    outline: none;
}
.review-buttons {
    display: flex;
    gap: 6px;
}
.review-buttons .btn { flex: 1; }

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}
.badge-pending  { background: #fef3c7; color: #92400e; }
.badge-approved { background: #d1fae5; color: #065f46; }
.badge-rejected { background: #fee2e2; color: #991b1b; }
.badge-super    { background: #ede9fe; color: #5b21b6; }
.badge-admin    { background: #e0e7ff; color: #3730a3; }

/* Footer */
.footer {
    text-align: center;
    color: var(--muted);
    padding: 24px 0;
    font-size: 12px;
    border-top: 1px solid var(--border);
    margin-top: 24px;
}

/* Error page */
.error-code {
    font-size: 64px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 8px;
}
.muted { color: var(--muted); }

/* Responsive */
@media (max-width: 768px) {
    .stats { grid-template-columns: repeat(2, 1fr); }
    .topbar-inner { padding: 0 12px; }
    .topbar-nav a { margin-left: 10px; }
    .container { padding: 12px; }
    .filter-bar { flex-wrap: wrap; }
    .filter-bar select, .filter-bar input { width: 100%; }
    .form-grid { grid-template-columns: 1fr; }
    .info-grid { grid-template-columns: 1fr; }
    .topbar-nav { display: flex; flex-wrap: wrap; gap: 6px 8px; }
    .topbar-nav a, .topbar-nav .nav-sep { margin-left: 0; }
    .nav-sep { display: none; }
}

/* Navbar separator */
.nav-sep {
    display: inline-block;
    width: 1px;
    height: 16px;
    margin: 0 4px;
    background: var(--border);
    vertical-align: middle;
}

/* Registration form */
.register-card {
    max-width: 760px;
    margin: 24px auto;
}
.section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary-dark);
    margin: 18px 0 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}
.section-title:first-of-type { margin-top: 4px; }
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 18px;
}
.form-grid .form-row { margin-bottom: 12px; }

/* My registration page */
.my-page { max-width: 760px; margin: 24px auto; }
.status-banner {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 20px 24px;
    border-radius: 8px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
}
.status-banner .status-icon {
    font-size: 36px;
    width: 56px;
    height: 56px;
    line-height: 56px;
    text-align: center;
    border-radius: 50%;
    background: rgba(255,255,255,.6);
    flex-shrink: 0;
}
.status-banner .status-label {
    color: var(--muted);
    font-size: 12px;
}
.status-banner .status-name {
    font-size: 22px;
    font-weight: 700;
    margin: 2px 0 4px;
}
.status-banner .status-tip { font-size: 13px; }
.status-pending  { background: #fff8e1; border-color: #ffe082; }
.status-pending .status-icon { color: #f39c12; }
.status-pending .status-name { color: #92400e; }
.status-approved { background: #dcfce7; border-color: #86efac; }
.status-approved .status-icon { color: #16a34a; }
.status-approved .status-name { color: #065f46; }
.status-rejected { background: #fee2e2; border-color: #fca5a5; }
.status-rejected .status-icon { color: #dc2626; }
.status-rejected .status-name { color: #991b1b; }

/* Info grid */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 24px;
    margin-top: 8px;
}
.info-item {
    background: #f9fafb;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 14px;
}
.info-item-full { grid-column: 1 / -1; }
.info-label {
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 4px;
}
.info-value {
    font-size: 15px;
    font-weight: 500;
    word-break: break-all;
}
.my-actions {
    margin-top: 16px;
    text-align: center;
}

/* My login card */
.my-login-card { max-width: 420px; margin: 32px auto; }

/* 个人信息卡头部 */
.my-profile {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(47, 85, 151, .18);
}
.profile-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .22);
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.profile-name { font-size: 20px; font-weight: 700; line-height: 1.3; }
.profile-sub { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 8px; }
.profile-tag {
    background: rgba(255, 255, 255, .18);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
}

/* 审核进度时间线 */
.timeline {
    margin-top: 14px;
    padding-left: 6px;
}
.tl-item {
    position: relative;
    padding: 0 0 22px 28px;
}
.tl-item:last-child { padding-bottom: 0; }
/* 连接线 */
.tl-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 16px;
    bottom: 0;
    width: 2px;
    background: var(--border);
}
.tl-dot {
    position: absolute;
    left: 0;
    top: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #d1d5db;
    border: 3px solid #fff;
    box-shadow: 0 0 0 1px var(--border);
}
.tl-item.done .tl-dot { background: var(--success); box-shadow: 0 0 0 1px var(--success); }
.tl-item.active .tl-dot {
    background: var(--warn);
    box-shadow: 0 0 0 1px var(--warn);
    animation: tl-pulse 1.4s ease-in-out infinite;
}
@keyframes tl-pulse {
    0%, 100% { box-shadow: 0 0 0 1px var(--warn), 0 0 0 6px rgba(243, 156, 18, .15); }
    50%      { box-shadow: 0 0 0 1px var(--warn), 0 0 0 10px rgba(243, 156, 18, .05); }
}
.tl-item.tl-approved .tl-dot { background: var(--success); box-shadow: 0 0 0 1px var(--success); }
.tl-item.tl-rejected .tl-dot { background: var(--danger);  box-shadow: 0 0 0 1px var(--danger); }
.tl-title { font-weight: 600; font-size: 14px; }
.tl-time  { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* 操作按钮区 */
.my-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

/* 打印样式 */
@media print {
    .topbar, .flashes, .my-actions, .footer { display: none !important; }
    .container { padding: 0; }
    .my-page { margin: 0; max-width: 100%; }
    .card, .status-banner, .my-profile { box-shadow: none; break-inside: avoid; }
    .profile-tag { background: #e5e7eb !important; color: #374151 !important; }
    a { color: var(--text); text-decoration: none; }
}

/* ============ 首页 ============ */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border-radius: 10px;
    padding: 44px 32px;
    margin-bottom: 22px;
    text-align: center;
    box-shadow: 0 6px 20px rgba(47, 85, 151, .22);
}
.hero-inner { max-width: 760px; margin: 0 auto; }
.hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, .2);
    padding: 4px 14px;
    border-radius: 14px;
    font-size: 13px;
    margin-bottom: 14px;
}
.hero-title { font-size: 32px; margin: 0 0 10px; line-height: 1.25; }
.hero-sub { font-size: 16px; opacity: .92; margin: 0 0 16px; }
.hero-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 22px;
    font-size: 14px;
    opacity: .95;
    margin-bottom: 22px;
}
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 14px;
}
.hero-actions .btn-lg { padding: 12px 26px; font-size: 16px; }
.hero-actions .btn-ghost {
    background: rgba(255, 255, 255, .16);
    border-color: rgba(255, 255, 255, .5);
    color: #fff;
}
.hero-actions .btn-ghost:hover { background: rgba(255, 255, 255, .26); }
.hero-tip { font-size: 13px; opacity: .88; margin: 0; }
.hero-tip strong { color: #ffe082; }

.home-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 22px;
}
.entry-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 22px;
    text-align: center;
    transition: box-shadow .15s, transform .15s;
}
.entry-card:hover { box-shadow: 0 6px 16px rgba(0,0,0,.07); transform: translateY(-2px); }
.entry-icon { font-size: 34px; margin-bottom: 8px; }
.entry-title { margin: 0 0 6px; font-size: 17px; }
.entry-desc { color: var(--muted); font-size: 13px; margin: 0 0 14px; min-height: 36px; }
.btn-block { display: block; width: 100%; }

.home-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 22px;
}
.home-stat {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 22px;
    text-align: center;
}
.home-stat-num { font-size: 30px; font-weight: 700; color: var(--primary-dark); }
.home-stat-label { color: var(--muted); font-size: 13px; margin-top: 4px; }

.home-section-title {
    font-size: 20px;
    margin: 0 0 16px;
    text-align: center;
}
.flow-steps {
    display: flex;
    align-items: stretch;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px 16px;
}
.flow-step { text-align: center; min-width: 130px; }
.flow-step-num {
    width: 36px;
    height: 36px;
    line-height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    margin: 0 auto 8px;
}
.flow-step-title { font-weight: 600; font-size: 14px; }
.flow-step-desc { color: var(--muted); font-size: 12px; margin-top: 2px; }
.flow-arrow { color: var(--muted); font-size: 20px; align-self: center; padding: 0 4px; }

/* ============ 会员中心 ============ */
.member-page { max-width: 860px; margin: 24px auto; }
.member-hero {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    color: #fff;
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(22, 163, 74, .2);
}
.member-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .25);
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.member-meta { flex: 1; }
.member-name { font-size: 20px; font-weight: 700; }
.member-sub { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 8px; }
.member-tag {
    background: rgba(255, 255, 255, .2);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
}
.member-hero-actions { display: flex; flex-direction: column; gap: 6px; }
.member-hero-actions .btn { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .45); color: #fff; }
.member-hero-actions .btn:hover { background: rgba(255, 255, 255, .26); }

/* 公告列表 */
.ann-list { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.ann-item {
    border: 1px solid var(--border);
    border-left: 4px solid var(--border);
    border-radius: 6px;
    padding: 12px 14px;
    background: #fff;
}
.ann-pinned { border-left-color: var(--warn); background: #fffbeb; }
.ann-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.ann-pin {
    background: var(--warn);
    color: #fff;
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 10px;
}
.ann-title { font-weight: 600; font-size: 15px; flex: 1; }
.ann-time { color: var(--muted); font-size: 12px; }
.ann-content { color: #374151; font-size: 14px; line-height: 1.6; }
/* 置顶公告内容突出显示 */
.ann-content-hl {
    font-size: 22px;
    font-weight: 800;
    color: #b91c1c;
    text-align: center;
    letter-spacing: 1px;
    padding: 14px 8px;
    margin-top: 6px;
    background: linear-gradient(180deg, #fff 0%, #fef2f2 100%);
    border: 2px solid #fca5a5;
    border-radius: 8px;
    text-shadow: 0 1px 0 #fff;
}
.ann-link { display: inline-block; margin-top: 8px; font-size: 13px; }

/* 活动议程 */
.agenda { margin-top: 10px; }
.agenda-item {
    display: grid;
    grid-template-columns: 140px 18px 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border);
}
.agenda-item:last-child { border-bottom: none; }
.agenda-time { color: var(--primary-dark); font-size: 13px; font-weight: 500; }
.agenda-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    justify-self: center;
}
.agenda-title { font-size: 14px; }

.empty-box {
    text-align: center;
    color: var(--muted);
    padding: 30px;
    background: #f9fafb;
    border-radius: 6px;
}

/* 后台公告管理区 */
.ann-admin { margin-top: 22px; }
.ann-admin .table-wrap { margin-top: 12px; }
.inline-check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.inline-check input { margin: 0; }

/* 响应式 */
@media (max-width: 768px) {
    .home-grid, .home-stats { grid-template-columns: 1fr; }
    .flow-arrow { transform: rotate(90deg); }
    .flow-steps { flex-direction: column; align-items: stretch; }
    .hero { padding: 32px 18px; }
    .hero-title { font-size: 24px; }
    .member-hero { flex-wrap: wrap; }
    .member-hero-actions { flex-direction: row; }
    .agenda-item { grid-template-columns: 100px 14px 1fr; gap: 8px; }
}
