/* admin.css */
/* 从admin.html迁移的全部样式，后续可继续拆分为各功能区块CSS */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --text-color: #333;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f9f9f9;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    width: 100%;
}

header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 50px;
    margin-right: 10px;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: bold;
}

.admin-info {
    display: flex;
    align-items: center;
}

.admin-info span {
    margin-right: 1rem;
}

.admin-info a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    background-color: rgba(255,255,255,0.1);
    border-radius: 5px;
    transition: background-color 0.3s;
}

.admin-info a:hover {
    background-color: rgba(255,255,255,0.2);
}

.main-content {
    display: flex;
    flex-grow: 1;
}

.sidebar {
    width: 250px;
    background-color: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
    padding: 2rem 0;
    height: calc(100vh - 71px);
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 0.5rem;
}

.sidebar-menu a {
    display: block;
    padding: 0.8rem 1.5rem;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 4px solid transparent;
}

.sidebar-menu a:hover, .sidebar-menu a.active {
    background-color: #f9f9f9;
    border-left: 4px solid var(--accent-color);
    color: var(--accent-color);
}

.sidebar-menu a i {
    margin-right: 0.5rem;
}

.content {
    flex-grow: 1;
    padding: 2rem;
    overflow-y: auto;
    height: calc(100vh - 71px);
}

/* --- 控制面板样式 --- */
#dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.dashboard-card {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.dashboard-card h3 {
    margin-bottom: 0.5rem;
    color: #555;
    font-size: 1rem;
    font-weight: 600;
}

.dashboard-card .value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.dashboard-chart-container {
    grid-column: 1 / -1; /* 占满整行 */
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

/* --- 表格和表单通用美化 --- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
    background-color: white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border-radius: 8px;
    overflow: hidden;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

td.actions .btn {
    margin-right: 0.5rem;
}

thead {
    background-color: #f9fafb;
}

th {
    font-weight: 600;
    color: #333;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover {
    background-color: #f9f9f9;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.content-header h2 {
    font-size: 1.8rem;
}

.btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s;
    display: inline-block;
}

.btn-primary {
    background-color: var(--secondary-color);
    color: white;
}
.btn-primary:hover {
    opacity: 0.9;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}
.btn-danger:hover {
    opacity: 0.9;
}

.btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

/* 表单样式 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

/* --- Modal Styles --- */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.close-modal {
    border: none;
    background: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #888;
    transition: color 0.2s;
}
.close-modal:hover {
    color: #333;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    background-color: #f7f9fa;
    border-top: 1px solid #e9ecef;
    text-align: right;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.modal-footer .btn {
    margin-left: 0.75rem;
}

/* --- Tags Checkbox Group --- */
.tags-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    background-color: white;
    padding: 1rem;
    border-radius: 5px;
    border: 1px solid #ddd;
}

label.tag-checkbox {
    display: inline-flex;
    align-items: center;
    background-color: #f1f5f9;
    padding: 0.5rem 0.8rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    border: 1px solid transparent;
}

label.tag-checkbox:hover {
    background-color: #e2e8f0;
}

label.tag-checkbox input {
    display: none;
}

label.tag-checkbox span {
    margin-left: 0.25rem;
}

label.tag-checkbox input:checked + span {
    font-weight: bold;
}

label.tag-checkbox input:checked {
    /* You can't style the checkbox directly, but we can style the label */
}

label.tag-checkbox:has(input:checked) {
    background-color: var(--secondary-color);
    color: white;
    border-color: var(--primary-color);
}

/* --- Status Badge Styles --- */
.status-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    text-transform: capitalize;
}

.status-badge.status-已发布 {
    background-color: var(--success-color);
}

.status-badge.status-草稿 {
    background-color: #777;
}

/* ... 省略部分样式，后续可继续补充 ... */ 