body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding-bottom: 50px;
    box-sizing: border-box;
}

.page {
    display: none;
}

.page.active {
    display: block;
    width: 100%;
}

.hidden {
    display: none;
}

/* ============ 表单样式 ============ */
.form-container {
    max-width: 350px;
    margin: 50px auto;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-align: center;
}

.form-container h2 {
    margin-bottom: 1.5rem;
    color: #333;
}

.form-container input {
    width: calc(100% - 20px);
    padding: 10px;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.form-container button {
    width: 100%;
    padding: 10px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

.form-container button:hover {
    background-color: #0056b3;
}

.form-container p {
    margin-top: 1rem;
}

/* ============ 主面板 ============ */
.dashboard-container {
    width: 90%;
    max-width: 1200px;
    margin: 2rem auto;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

header h1 {
    margin: 0;
}

header button {
    margin-left: 10px;
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 4px;
    border: 1px solid #007bff;
    background-color: #007bff;
    color: white;
}

#logout-button {
    background-color: #dc3545;
    border-color: #dc3545;
}

.back-button {
    background-color: #6c757d;
    border-color: #6c757d;
}

.back-button:hover {
    background-color: #5a6268;
}

/* ============ 卡片网格 ============ */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

.card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 2rem 1.5rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: white;
    min-height: 180px;
    justify-content: center;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.card:nth-child(1) { background: linear-gradient(135deg, #2196F3, #1565C0); }
.card:nth-child(2) { background: linear-gradient(135deg, #9C27B0, #6A1B9A); }
.card:nth-child(3) { background: linear-gradient(135deg, #FF9800, #E65100); }
.card:nth-child(4) { background: linear-gradient(135deg, #F44336, #B71C1C); }
.card:nth-child(5) { background: linear-gradient(135deg, #4CAF50, #1B5E20); }

.card-icon {
    font-size: 3rem;
    margin-bottom: 0.8rem;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.card-desc {
    font-size: 0.85rem;
    opacity: 0.85;
}

/* ============ 进度条 ============ */
#progress-container {
    margin: 1rem 0;
}

#progress-bar {
    width: 100%;
}

/* ============ 表格 ============ */
#resource-table {
    width: 100%;
    border-collapse: collapse;
}

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

#resource-table th {
    background-color: #f8f9fa;
}

#resource-table tbody tr:nth-child(even) {
    background-color: #f2f2f2;
}

#resource-table button {
    padding: 5px 10px;
    margin-right: 5px;
    cursor: pointer;
}

/* ============ 弹窗 ============ */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 8px;
    position: relative;
}

.modal-content.large {
    max-width: 90%;
    height: 80%;
    margin: 5% auto;
    display: flex;
    flex-direction: column;
}

#preview-content {
    flex-grow: 1;
    overflow: auto;
    text-align: center;
    background-color: #f1f1f1;
}

#preview-content img,
#preview-content embed,
#preview-content video,
#preview-content audio {
    max-width: 100%;
    max-height: 100%;
    height: auto;
}

#preview-content embed {
    height: 100%;
}

#preview-content pre {
    text-align: left;
    white-space: pre-wrap;
    word-wrap: break-word;
    padding: 1rem;
    background-color: #fff;
    height: 100%;
    box-sizing: border-box;
    margin: 0;
}

.close-button {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 25px;
    font-size: 35px;
    font-weight: bold;
    z-index: 1001;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* ============ 页脚 ============ */
.site-footer {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    background-color: #f8f9fa;
    color: #6c757d;
    text-align: center;
    padding: 10px 0;
    font-size: 0.9em;
    border-top: 1px solid #e7e7e7;
    z-index: 100;
}

.site-footer a {
    color: #007bff;
    text-decoration: none;
}

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