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

body {
    font-family: "宋体", "SimSun", "楷体", "KaiTi", serif;
    background-color: #f5f0e6;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
}

.login-container {
    background: #fff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
    border: 3px solid #8B4513;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: #8B4513;
    font-size: 28px;
    margin-bottom: 10px;
    font-weight: bold;
}

.login-header p {
    color: #666;
    font-size: 14px;
}

.login-form {
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: bold;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #8B4513;
}

.form-actions {
    text-align: center;
    margin-top: 25px;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background-color: #8B4513;
    color: #fff;
}

.btn-primary:hover {
    background-color: #A0522D;
}

.btn-success {
    background-color: #228B22;
    color: #fff;
}

.btn-success:hover {
    background-color: #2E8B2E;
}

.btn-danger {
    background-color: #DC143C;
    color: #fff;
}

.btn-danger:hover {
    background-color: #B22222;
}

.btn-warning {
    background-color: #FF8C00;
    color: #fff;
}

.btn-warning:hover {
    background-color: #FF7F00;
}

.btn-info {
    background-color: #4682B4;
    color: #fff;
}

.btn-info:hover {
    background-color: #5F9EA0;
}

.login-links {
    text-align: center;
    margin-top: 20px;
}

.login-links a {
    color: #8B4513;
    text-decoration: none;
    margin: 0 10px;
    font-size: 14px;
}

.login-links a:hover {
    text-decoration: underline;
}

.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error {
    background-color: #fee;
    border: 1px solid #fcc;
    color: #c33;
}

.alert-success {
    background-color: #efe;
    border: 1px solid #cfc;
    color: #3c3;
}

.alert-info {
    background-color: #eef;
    border: 1px solid #ccf;
    color: #33c;
}

.admin-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background-color: #8B4513;
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #A0522D;
}

.sidebar-header h2 {
    font-size: 20px;
    margin-bottom: 5px;
}

.user-role {
    font-size: 12px;
    color: #FFD700;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 5px;
}

.sidebar-nav a {
    display: block;
    padding: 12px 20px;
    color: #fff;
    text-decoration: none;
    transition: background-color 0.3s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background-color: #A0522D;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #A0522D;
}

.main-content {
    flex: 1;
    margin-left: 250px;
    background-color: #f5f0e6;
}

.top-bar {
    background-color: #fff;
    padding: 20px 30px;
    border-bottom: 2px solid #8B4513;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar h1 {
    color: #8B4513;
    font-size: 24px;
}

.user-info {
    color: #666;
    font-size: 14px;
}

.content {
    padding: 30px;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    border: 2px solid #8B4513;
}

.stat-card h3 {
    color: #8B4513;
    font-size: 16px;
    margin-bottom: 10px;
}

.stat-card .number {
    font-size: 36px;
    font-weight: bold;
    color: #333;
}

.card {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    border: 2px solid #8B4513;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.card-header h2 {
    color: #8B4513;
    font-size: 20px;
}

.card-actions {
    display: flex;
    gap: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

table th,
table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

table th {
    background-color: #8B4513;
    color: #fff;
    font-weight: bold;
}

table tr:hover {
    background-color: #f9f9f9;
}

.action-buttons {
    display: flex;
    gap: 5px;
}

.action-buttons .btn {
    padding: 5px 10px;
    font-size: 12px;
}

.photo-preview {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 5px;
    border: 2px solid #8B4513;
}

.photo-large {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 5px;
    border: 2px solid #8B4513;
}

.member-detail {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.detail-item {
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 5px;
}

.detail-item label {
    display: block;
    color: #8B4513;
    font-weight: bold;
    margin-bottom: 5px;
}

.detail-item .value {
    color: #333;
}

.generation-song {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 3px solid #8B4513;
    text-align: center;
}

.generation-song h2 {
    color: #8B4513;
    font-size: 24px;
    margin-bottom: 20px;
}

.generation-song .content {
    font-size: 28px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    line-height: 2;
}

.generation-song .pinyin {
    font-size: 16px;
    color: #666;
    font-style: italic;
}

.tree-container {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid #8B4513;
}

.tree-node {
    margin: 10px 0;
    padding: 10px;
    border: 2px solid #8B4513;
    border-radius: 5px;
    background-color: #fff;
}

.tree-node-header {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.tree-node-toggle {
    width: 20px;
    height: 20px;
    background-color: #8B4513;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tree-node-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tree-node-name {
    font-size: 18px;
    font-weight: bold;
    color: #8B4513;
}

.tree-node-generation {
    background-color: #FFD700;
    color: #333;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
}

.tree-node-children {
    margin-left: 30px;
    margin-top: 10px;
    border-left: 2px dashed #8B4513;
    padding-left: 20px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    border: 3px solid #8B4513;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.modal-header h2 {
    color: #8B4513;
    font-size: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.modal-close:hover {
    color: #8B4513;
}

.modal-body {
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid #eee;
    text-align: right;
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-box input {
    flex: 1;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
}

.search-box input:focus {
    outline: none;
    border-color: #8B4513;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 20px;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-decoration: none;
    color: #333;
}

.pagination a:hover {
    background-color: #8B4513;
    color: #fff;
}

.pagination .active {
    background-color: #8B4513;
    color: #fff;
}

.permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.permission-item {
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.permission-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.photo-upload {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.photo-upload-item {
    flex: 1;
}

.photo-upload-item label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: bold;
}

.photo-upload-item input[type="file"] {
    width: 100%;
}

.photo-preview-container {
    margin-top: 10px;
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        height: auto;
    }

    .main-content {
        margin-left: 0;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .member-detail {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .photo-upload {
        flex-direction: column;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .card-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .card-actions .btn {
        flex: 1;
        min-width: 120px;
    }
}

/* 主布局样式 */
.main-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 主头部样式 */
.main-header {
    background-color: #8B4513;
    color: #fff;
    padding: 15px 30px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 0 30px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 40px;
}

.header-content h1 {
    font-size: 24px;
    font-family: "楷体", "KaiTi", serif;
    margin: 0;
    color: #fff;
}

.header-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 20px;
}

.header-nav a {
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    font-weight: bold;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.header-nav a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.header-nav a.active {
    background-color: rgba(255, 255, 255, 0.2);
    border-bottom: 2px solid #FFD700;
}

.header-actions {
    display: flex;
    gap: 15px;
}

.header-actions .btn {
    font-size: 14px;
    padding: 8px 16px;
}

/* 欢迎区域样式 */
.welcome-section {
    text-align: center;
    padding: 40px 20px;
    background-color: #f5f0e6;
    border-bottom: 2px solid #8B4513;
}

.welcome-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px;
    border: 2px solid #8B4513;
    background-color: #fff;
}

.welcome-content h2 {
    font-size: 32px;
    color: #8B4513;
    margin-bottom: 15px;
    font-family: "楷体", "KaiTi", serif;
    font-weight: bold;
}

.welcome-content p {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
    font-family: "宋体", "SimSun", serif;
}

.welcome-buttons {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.btn-brown {
    background-color: #8B4513;
    color: #fff;
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-family: "宋体", "SimSun", serif;
    transition: all 0.3s ease;
}

.btn-brown:hover {
    background-color: #A0522D;
    transform: translateY(-2px);
}

.btn-beige {
    background-color: #f5f0e6;
    color: #8B4513;
    padding: 12px 30px;
    border: 1px solid #8B4513;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-family: "宋体", "SimSun", serif;
    transition: all 0.3s ease;
}

.btn-beige:hover {
    background-color: #e8d5b7;
    transform: translateY(-2px);
}

/* 主内容区域 */
.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px;
    width: 100%;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 0 20px;
    }
    
    .header-left {
        flex-direction: column;
        gap: 15px;
    }
    
    .header-nav ul {
        flex-direction: column;
        gap: 10px;
    }
    
    .header-nav a {
        display: block;
        text-align: center;
    }
    
    .header-actions {
        justify-content: center;
    }
    
    .welcome-content {
        padding: 20px;
    }
    
    .welcome-content h2 {
        font-size: 24px;
    }
    
    .welcome-buttons {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .welcome-buttons .btn {
        width: 200px;
    }
    
    .main-content {
        padding: 20px;
    }
}
