/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

body {
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 顶部导航 */
.header {
    background-color: #2c3e50;
    color: #ffffff;
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.nav a {
    color: #ffffff;
    text-decoration: none;
    margin-left: 2rem;
    font-size: 1rem;
    padding-bottom: 0.3rem;
    transition: all 0.3s;
}

.nav a.active, .nav a:hover {
    color: #3498db;
    border-bottom: 2px solid #3498db;
}

/* 底部样式 */
.footer {
    background-color: #2c3e50;
    color: #ffffff;
    text-align: center;
    padding: 1.5rem;
    margin-top: auto;
    font-size: 0.9rem;
}

/* 首页样式 */
.home-main {
    flex: 1;
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 5%;
}

.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background-color: #ffffff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    text-align: center;
    text-decoration: none;
    color: #333;
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
    color: #2c3e50;
}

.card p {
    color: #666;
    font-size: 0.95rem;
}

/* 个人资料页面样式 */
.profile-main {
    flex: 1;
    max-width: 800px;
    margin: 3rem auto;
    padding: 0 5%;
}

.profile-card {
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    padding: 2rem;
}

.avatar-box {
    text-align: center;
    margin-bottom: 1.5rem;
}

.avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #3498db;
}

.basic-info {
    text-align: center;
    margin-bottom: 2rem;
}

.basic-info h2 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.basic-info .desc {
    color: #666;
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.info-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    font-size: 0.95rem;
}

.info-list li span {
    color: #2c3e50;
    font-weight: 600;
}

.skills {
    margin-bottom: 2rem;
}

.skills h3, .intro h3 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    padding-left: 0.5rem;
    border-left: 3px solid #3498db;
}

.skill-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.skill-item span:first-child {
    width: 100px;
    color: #666;
}

.skill-bar {
    flex: 1;
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 4px;
    margin: 0 1rem;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background-color: #3498db;
    border-radius: 4px;
}

.skill-percent {
    width: 50px;
    text-align: right;
    color: #666;
}

.intro p {
    color: #666;
    line-height: 1.8;
    font-size: 0.95rem;
    text-indent: 2em;
}

/* 图库页面样式 */
.gallery-main {
    flex: 1;
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 5%;
}

.gallery-title {
    font-size: 1.8rem;
    color: #2c3e50;
    text-align: center;
    margin-bottom: 0.8rem;
}

.gallery-desc {
    text-align: center;
    color: #666;
    margin-bottom: 2rem;
}

.gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s;
}

.gallery-item:hover {
    transform: translateY(-3px);
}

.gallery-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.gallery-desc-item {
    padding: 0.8rem 1rem;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

/* 图片预览遮罩层 */
.preview-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

.close-preview {
    position: absolute;
    top: 2rem;
    right: 2rem;
    font-size: 2rem;
    color: #ffffff;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.3s;
}

.close-preview:hover {
    color: #3498db;
}

.preview-img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
}

/* 台账管理页面样式 */
.ledger-main {
    flex: 1;
    max-width: 1000px;
    margin: 3rem auto;
    padding: 0 5%;
}

.ledger-title {
    font-size: 1.8rem;
    color: #2c3e50;
    text-align: center;
    margin-bottom: 1.5rem;
}

.ledger-operation {
    display: flex;
    justify-content: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background-color 0.3s;
    text-align: center;
}

.add-btn {
    background-color: #3498db;
    color: #ffffff;
}

.add-btn:hover {
    background-color: #2980b9;
}

.export-btn {
    background-color: #2ecc71;
    color: #ffffff;
}

.export-btn:hover {
    background-color: #27ae60;
}

/* 弹窗样式 */
.modal-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

.modal-box {
    background-color: #ffffff;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    padding: 1.5rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.modal-title {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 1.2rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.ledger-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-item label {
    font-size: 0.95rem;
    color: #333;
    font-weight: 500;
}

.form-item input, .form-item select, .form-item textarea {
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
    color: #333;
}

.form-item input:focus, .form-item select:focus, .form-item textarea:focus {
    outline: none;
    border-color: #3498db;
}

.form-btn-group {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.submit-btn {
    background-color: #3498db;
    color: #ffffff;
}

.submit-btn:hover {
    background-color: #2980b9;
}

.cancel-btn {
    background-color: #95a5a6;
    color: #ffffff;
}

.cancel-btn:hover {
    background-color: #7f8c8d;
}

/* 台账表格 */
.ledger-list {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
}

.ledger-table {
    width: 100%;
    border-collapse: collapse;
}

.ledger-table th {
    background-color: #f5f5f5;
    padding: 1rem;
    text-align: left;
    font-size: 0.95rem;
    color: #2c3e50;
    border-bottom: 1px solid #ddd;
}

.ledger-table td {
    padding: 1rem;
    font-size: 0.9rem;
    color: #666;
    border-bottom: 1px solid #eee;
}

.ledger-table td button {
    margin-right: 0.5rem;
}

.edit-btn {
    background-color: #f39c12;
    color: #ffffff;
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.edit-btn:hover {
    background-color: #e67e22;
}

.delete-btn {
    background-color: #e74c3c;
    color: #ffffff;
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.delete-btn:hover {
    background-color: #c0392b;
}

.empty-tip {
    text-align: center;
    padding: 3rem;
    color: #999;
    font-size: 0.95rem;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .nav a {
        margin-left: 1rem;
        font-size: 0.9rem;
    }

    .info-list {
        grid-template-columns: 1fr;
    }

    .ledger-operation {
        flex-wrap: wrap;
    }

    .ledger-table th, .ledger-table td {
        padding: 0.6rem 0.4rem;
        font-size: 0.85rem;
    }

    .edit-btn, .delete-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }
}