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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #2d1b4e 0%, #4a2570 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    color: #6b3fa0;
    margin-bottom: 10px;
    font-size: 28px;
}

.login-box h2 {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 18px;
    font-weight: normal;
}

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

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

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

.form-group input:focus {
    outline: none;
    border-color: #6b3fa0;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #6b3fa0 0%, #4a2570 100%);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-login:hover {
    transform: translateY(-2px);
}

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

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

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

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

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

.sidebar {
    width: 200px;
    background: linear-gradient(180deg, #2d1b4e 0%, #1a0e2e 100%);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    transition: width 0.3s ease;
    overflow: hidden;
}

.sidebar.collapsed {
    width: 64px;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
}

.sidebar-title {
    overflow: hidden;
    white-space: nowrap;
    transition: opacity 0.3s;
    flex: 1;
}

.sidebar-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 16px;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.3s;
    margin-left: auto;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

.sidebar.collapsed .sidebar-title {
    opacity: 0;
    width: 0;
}

.sidebar.collapsed .sidebar-header {
    padding: 20px 16px;
    justify-content: center;
}

.sidebar.collapsed .sidebar-header .sidebar-toggle {
    margin-left: 0;
}

.sidebar-header h1 {
    font-size: 22px;
    margin-bottom: 5px;
}

.sidebar-header p {
    font-size: 14px;
    opacity: 0.8;
}

.sidebar-menu {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.sidebar.collapsed .sidebar-menu {
    padding: 10px 0;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s;
    white-space: nowrap;
}

.sidebar.collapsed .menu-item {
    padding: 15px 0;
    justify-content: center;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.menu-item.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.menu-icon {
    font-size: 20px;
    margin-right: 12px;
    flex-shrink: 0;
}

.sidebar.collapsed .menu-icon {
    margin-right: 0;
}

.sidebar.collapsed .menu-item span:not(.menu-icon) {
    display: none;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    white-space: nowrap;
}

.sidebar.collapsed .sidebar-footer {
    padding: 20px 12px;
    text-align: center;
}

.sidebar.collapsed .sidebar-footer .admin-info {
    display: none;
}

.sidebar.collapsed .sidebar-footer .btn-logout {
    font-size: 0;
    padding: 10px;
}

.sidebar.collapsed .sidebar-footer .btn-logout::after {
    content: '⏻';
    font-size: 16px;
}

.admin-info {
    margin-bottom: 15px;
}

.admin-name {
    font-size: 14px;
    opacity: 0.9;
}

.btn-logout {
    display: block;
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.3);
}

.main-content {
    flex: 1;
    margin-left: 200px;
    background-color: #f0ebf5;
    transition: margin-left 0.3s ease;
}

.sidebar.collapsed ~ .main-content {
    margin-left: 64px;
}

.content-wrapper {
    padding: 30px;
}

.search-bar {
    margin-bottom: 16px;
}

.search-input {
    width: 100%;
    max-width: 400px;
    padding: 10px 16px;
    border: 1px solid #d5c8e8;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: white;
}

.search-input:focus {
    border-color: #6b3fa0;
    box-shadow: 0 0 0 3px rgba(107, 63, 160, 0.1);
}

.search-input::placeholder {
    color: #b0a0c8;
}

.page-header {
    margin-bottom: 30px;
}

.page-header h2 {
    font-size: 28px;
    color: #2d1b4e;
}

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

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(45, 27, 78, 0.08);
    display: flex;
    align-items: center;
    transition: transform 0.2s;
    border-left: 4px solid #6b3fa0;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 40px;
    margin-right: 20px;
}

.stat-info h3 {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.stat-number {
    font-size: 28px;
    font-weight: bold;
    color: #2d1b4e;
}

.content-area {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(45, 27, 78, 0.08);
    min-height: 400px;
}

.content-area p {
    color: #666;
    font-size: 16px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.btn-primary {
    padding: 10px 20px;
    background: linear-gradient(135deg, #6b3fa0 0%, #4a2570 100%);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background-color: #f0ebf5;
    font-weight: 600;
    color: #4a2570;
}

.data-table tbody tr:hover {
    background-color: #f5f0fa;
}

.data-table .no-data {
    text-align: center;
    color: #999;
    padding: 40px;
}

.btn-edit {
    padding: 6px 12px;
    background-color: #6b3fa0;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    margin-right: 5px;
}

.btn-edit:hover {
    background-color: #5a3290;
}

.btn-delete {
    padding: 6px 12px;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.btn-delete:hover {
    background-color: #c82333;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-active {
    background-color: #d4edda;
    color: #155724;
}

.status-inactive {
    background-color: #f8d7da;
    color: #721c24;
}

.finance-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.finance-income {
    background-color: #d4edda;
    color: #155724;
}

.finance-expense {
    background-color: #f8d7da;
    color: #721c24;
}

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

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 20px;
    color: #333;
}

.close {
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: #333;
}

.modal .form-group {
    margin-bottom: 15px;
}

.modal .form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
    font-size: 14px;
}

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

.modal .form-group input:focus,
.modal .form-group select:focus,
.modal .form-group textarea:focus {
    outline: none;
    border-color: #6b3fa0;
}

.modal .form-group textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

.btn-cancel {
    padding: 10px 20px;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-left: 10px;
    transition: background-color 0.3s;
}

.btn-cancel:hover {
    background-color: #5a6268;
}

.modal .btn-primary {
    padding: 12px 20px;
    font-size: 16px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #6b3fa0;
}

input:checked + .slider:before {
    transform: translateX(24px);
}

input:disabled + .slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== Live2D 模型管理页面样式 ==================== */
.upload-section,
.models-section {
    background: white;
    padding: 24px;
    border-radius: 8px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.upload-section h3,
.models-section h3 {
    color: #333;
    font-size: 18px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #6b3fa0;
}

.upload-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    align-items: end;
}

.upload-form .form-group {
    display: flex;
    flex-direction: column;
}

.upload-form label {
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
    font-size: 14px;
}

.required {
    color: #dc3545;
}

.upload-form input[type="text"],
.upload-form input[type="file"] {
    padding: 10px 12px;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.upload-form input[type="text"]:focus,
.upload-form input[type="file"]:focus {
    outline: none;
    border-color: #6b3fa0;
    box-shadow: 0 0 0 3px rgba(107, 63, 160, 0.1);
}

.help-text {
    color: #888;
    font-size: 12px;
    margin-top: 4px;
}

.btn-primary {
    background-color: #6b3fa0;
    color: white;
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    background-color: #5a3590;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 63, 160, 0.3);
}

.btn-icon {
    font-size: 16px;
}

/* 模型网格布局 */
.models-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 16px;
}

@media (max-width: 1200px) {
    .models-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .models-grid {
        grid-template-columns: 1fr;
    }
}

/* 模型卡片 */
.model-card {
    background: #fafafa;
    border: 2px solid #e1e1e1;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.model-card:hover {
    border-color: #6b3fa0;
    box-shadow: 0 4px 16px rgba(107, 63, 160, 0.15);
    transform: translateY(-4px);
}

.model-thumbnail {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f5f5 0%, #e1e1e1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.model-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.model-card:hover .model-thumbnail img {
    transform: scale(1.05);
}

.model-info {
    padding: 16px;
}

.model-name {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.model-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: #666;
    font-size: 13px;
    margin-bottom: 8px;
}

.download-count,
.file-size {
    display: flex;
    align-items: center;
    gap: 6px;
}

.icon {
    font-size: 14px;
}

.model-date {
    color: #999;
    font-size: 12px;
}

.model-actions {
    padding: 0 16px 16px;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
    border: none;
}

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

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.empty-state p:first-child {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-state .hint {
    font-size: 14px;
    color: #aaa;
}
