/* ============================================
   家族族谱系统 - UI增强样式表
   美观大气上档次 - 渐变/阴影/动画/微交互
   ============================================ */

/* 全局背景优化 */
body {
    background: 
        radial-gradient(ellipse at top left, rgba(212, 175, 55, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(200, 16, 46, 0.03) 0%, transparent 50%),
        var(--bg);
    min-height: 100vh;
}

/* 主内容区域 */
.main {
    padding: 24px 0;
    min-height: calc(100vh - 200px);
}

/* 容器 */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== Banner优化 ========== */
.banner {
    background: 
        linear-gradient(135deg, rgba(139, 0, 0, 0.95) 0%, rgba(200, 16, 46, 0.9) 50%, rgba(139, 0, 0, 0.95) 100%),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><circle cx="50" cy="50" r="40" fill="none" stroke="rgba(212,175,55,0.1)" stroke-width="1"/></svg>');
    color: #fff;
    padding: 50px 30px;
    text-align: center;
    border-radius: 16px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(139, 0, 0, 0.3);
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.banner::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 40%, rgba(212, 175, 55, 0.1) 50%, transparent 60%);
    animation: bannerShine 8s ease-in-out infinite;
}

@keyframes bannerShine {
    0%, 100% { transform: translateX(-100%) rotate(45deg); }
    50% { transform: translateX(100%) rotate(45deg); }
}

.banner h2 {
    font-size: 32px;
    margin-bottom: 12px;
    letter-spacing: 4px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.banner p {
    font-size: 16px;
    opacity: 0.9;
    letter-spacing: 2px;
    position: relative;
    z-index: 1;
}

/* 统计行 */
.stats-row {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 30px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.stat-item {
    text-align: center;
}

.stat-num {
    font-size: 36px;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 0 2px 10px rgba(255, 215, 0, 0.4);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    opacity: 0.85;
    letter-spacing: 1px;
}

/* ========== 公告滚动 ========== */
.notice-scroll {
    background: linear-gradient(135deg, #fff 0%, #fefcf8 100%);
    border-radius: 12px;
    padding: 14px 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 12px rgba(139, 69, 19, 0.08);
    border-left: 4px solid var(--gold);
    transition: all 0.3s;
}

.notice-scroll:hover {
    box-shadow: 0 4px 20px rgba(139, 69, 19, 0.12);
    transform: translateY(-1px);
}

.notice-scroll .label {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    padding: 4px 14px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
}

.notice-scroll .content {
    flex: 1;
    overflow: hidden;
}

.notice-item a {
    color: var(--text);
    font-size: 14px;
}

.notice-item a:hover {
    color: var(--primary);
}

/* ========== 快捷导航 ========== */
.quick-nav {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.quick-item {
    background: linear-gradient(135deg, #fff 0%, #fefcf8 100%);
    border-radius: 12px;
    padding: 18px 12px;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    border: 1px solid var(--border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.quick-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--primary));
    transform: scaleX(0);
    transition: transform 0.3s;
}

.quick-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(200, 16, 46, 0.15);
    border-color: var(--gold);
    color: var(--primary);
}

.quick-item:hover::before {
    transform: scaleX(1);
}

.quick-label {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 1px;
}

/* ========== 卡片优化 ========== */
.card {
    background: linear-gradient(135deg, #ffffff 0%, #fefcf8 100%);
    border-radius: 14px;
    box-shadow: 0 2px 16px rgba(139, 69, 19, 0.08);
    margin-bottom: 20px;
    overflow: hidden;
    border: 1px solid rgba(212, 175, 55, 0.2);
    transition: all 0.3s;
}

.card:hover {
    box-shadow: 0 6px 28px rgba(139, 69, 19, 0.12);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.05) 0%, transparent 100%);
}

.card-title {
    font-size: 17px;
    font-weight: bold;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background: linear-gradient(180deg, var(--gold), var(--primary));
    border-radius: 2px;
}

.card-body {
    padding: 20px;
}

/* ========== 按钮优化 ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    text-decoration: none;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(200, 16, 46, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #A00D24 0%, #6B0000 100%);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(200, 16, 46, 0.4);
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

.btn-gold:hover {
    background: linear-gradient(135deg, #B8860B 0%, #8B6914 100%);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.4);
}

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

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

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

/* ========== 网格布局 ========== */
.grid {
    display: grid;
    gap: 20px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }

/* ========== 族人卡片 ========== */
.member-card {
    background: linear-gradient(135deg, #fff 0%, #fefcf8 100%);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    border: 1px solid var(--border);
    transition: all 0.3s;
    cursor: pointer;
}

.member-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(200, 16, 46, 0.15);
    border-color: var(--gold);
}

.member-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: #fff;
}

.member-avatar.male {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
}

.member-avatar.female {
    background: linear-gradient(135deg, #be185d, #ec4899);
    box-shadow: 0 4px 12px rgba(190, 24, 93, 0.3);
}

.member-name {
    font-size: 16px;
    font-weight: bold;
    color: var(--text);
    margin-bottom: 4px;
}

.member-info {
    font-size: 12px;
    color: var(--text-muted);
}

/* ========== 时间线 ========== */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--gold), var(--primary), transparent);
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -26px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--gold);
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--gold);
}

.timeline-date {
    font-size: 13px;
    color: var(--primary);
    font-weight: bold;
    margin-bottom: 4px;
}

.timeline-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 4px;
}

.timeline-content {
    font-size: 13px;
    color: var(--text-light);
}

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

.pagination a, .pagination span {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    font-size: 14px;
    transition: all 0.3s;
    text-decoration: none;
}

.pagination a:hover {
    border-color: var(--gold);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.2);
}

.pagination .current {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(200, 16, 46, 0.3);
}

/* ========== 表单 ========== */
.form-group {
    margin-bottom: 18px;
}

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

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
    background: #fff;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

/* ========== 徽章 ========== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}

.badge-male {
    background: #dbeafe;
    color: #1e40af;
}

.badge-female {
    background: #fce7f3;
    color: #be185d;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

/* ========== 页脚 ========== */
.footer {
    background: linear-gradient(135deg, #1A0A0A 0%, #2D1515 100%);
    color: var(--gold-light);
    padding: 40px 0 20px;
    margin-top: 40px;
    border-top: 3px solid var(--gold);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 30px;
}

.footer-title {
    font-size: 16px;
    font-weight: bold;
    color: var(--gold);
    margin-bottom: 14px;
}

.footer-links a {
    display: block;
    color: rgba(245, 230, 200, 0.7);
    padding: 4px 0;
    font-size: 13px;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--gold);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    font-size: 13px;
    opacity: 0.7;
}

/* ========== 响应式 ========== */
@media (max-width: 1024px) {
    .quick-nav { grid-template-columns: repeat(4, 1fr); }
    .grid-4, .grid-6 { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .container { padding: 0 12px; }
    .banner { padding: 30px 20px; }
    .banner h2 { font-size: 24px; }
    .stats-row { gap: 20px; }
    .stat-num { font-size: 28px; }
    .quick-nav { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .quick-item { padding: 14px 8px; }
    .quick-label { font-size: 12px; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .grid-4, .grid-6 { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr; }
    .main { padding: 16px 0; }
}

@media (max-width: 480px) {
    .quick-nav { grid-template-columns: repeat(2, 1fr); }
    .grid-4, .grid-6 { grid-template-columns: 1fr; }
    .stats-row { gap: 12px; }
    .stat-num { font-size: 22px; }
}

/* ========== 导航菜单水平对齐优化 ========== */
.nav {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 100%;
}

.nav-item {
    display: inline-flex;
    align-items: center;
    height: 40px;
    padding: 0 14px;
    color: rgba(255,255,255,.9);
    font-size: 14px;
    border-radius: 6px;
    transition: all .3s;
    white-space: nowrap;
    line-height: 40px;
}

.nav-item:hover, .nav-item.active {
    background: rgba(255,255,255,.15);
    color: var(--gold-light);
}

.nav-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
}

.nav-dropdown .dropdown-toggle {
    display: inline-flex;
    align-items: center;
    height: 40px;
    padding: 0 14px;
    cursor: pointer;
}

.nav-dropdown .dropdown-toggle::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 6px;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    transition: transform .3s;
}

.nav-dropdown:hover .dropdown-toggle::after {
    transform: rotate(180deg);
}

/* 大型下拉菜单（三列分组） */
.dropdown-menu-large {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,.15);
    padding: 16px;
    z-index: 1000;
    min-width: 560px;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    border: 1px solid var(--border);
}

.nav-dropdown:hover .dropdown-menu-large {
    display: grid;
}

.dropdown-group {
    display: flex;
    flex-direction: column;
}

.dropdown-group-title {
    font-size: 13px;
    font-weight: bold;
    color: var(--primary-dark);
    padding: 8px 10px;
    margin-bottom: 6px;
    border-bottom: 2px solid var(--gold);
    letter-spacing: 1px;
}

.dropdown-group a {
    display: block;
    padding: 7px 10px;
    color: var(--text);
    font-size: 13px;
    border-radius: 6px;
    transition: all .2s;
}

.dropdown-group a:hover {
    background: linear-gradient(135deg, rgba(200,16,46,.08), rgba(212,175,55,.08));
    color: var(--primary);
    padding-left: 14px;
}

/* 移动端适配 */
@media (max-width: 1024px) {
    .dropdown-menu-large {
        min-width: 400px;
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--primary-dark);
        flex-direction: column;
        padding: 10px;
        height: auto;
        align-items: stretch;
    }
    .nav.open {
        display: flex;
    }
    .nav-item {
        height: auto;
        padding: 12px 16px;
        line-height: 1.5;
    }
    .nav-dropdown {
        height: auto;
        flex-direction: column;
        align-items: stretch;
    }
    .dropdown-menu-large {
        position: static;
        display: none;
        grid-template-columns: 1fr;
        min-width: auto;
        box-shadow: none;
        border: none;
        padding: 8px;
        background: rgba(0,0,0,.1);
    }
    .nav-dropdown.open .dropdown-menu-large {
        display: grid;
    }
    .dropdown-group-title {
        color: var(--gold);
        border-bottom-color: rgba(212,175,55,.3);
    }
    .dropdown-group a {
        color: rgba(255,255,255,.8);
    }
    .dropdown-group a:hover {
        background: rgba(255,255,255,.1);
        color: #fff;
    }
}

/* v94: 防重复提交加载动画 */
.btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}
.btn-secondary .btn-spinner, .btn-outline .btn-spinner {
    border-color: rgba(0,0,0,0.2);
    border-top-color: #666;
}
@keyframes btn-spin {
    to { transform: rotate(360deg); }
}
.btn-loading {
    pointer-events: none;
    opacity: 0.75;
    cursor: not-allowed;
}
.btn-loading .btn-text {
    display: none;
}
