/* ========================================
   卓境发卡系统 - 毛玻璃风格样式
   ======================================== */

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

:root {
    --primary-color: #2563eb;
    --notice-color: #ff9900;
    --primary-hover: #1d4ed8;
    --danger-color: #dc2626;
    --danger-hover: #b91c1c;
    --success-color: #16a34a;
    --warning-color: #d97706;
    --text-color: #111827;
    --text-muted: #000000;
    --bg-color: #f9fafb;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(0, 0, 0, 0.1);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #1d4ed8 100%);
    min-height: 100vh;
    color: var(--text-color);
    line-height: 1.6;
}

/* 毛玻璃容器 */
.glass-container {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.glass-card {
    background: white;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* 登录页面 */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    width: 100%;
    max-width: 400px;
    padding: 40px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-color);
    font-size: 28px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    background: white;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: var(--danger-hover);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 页面布局 */
.page-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    padding: 20px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar h2 {
    font-size: 20px;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--text-color);
}

.nav-menu {
    list-style: none;
}

.nav-menu li {
    margin-bottom: 8px;
}

.nav-menu a {
    display: block;
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--text-color);
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.nav-menu a:hover,
.nav-menu a.active {
    background: var(--primary-color);
    color: white;
}

.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 30px;
}

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

.page-header h1 {
    font-size: 28px;
    margin-bottom: 8px;
}

.page-header p {
    color: var(--text-muted);
}

/* 数据统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    padding: 24px;
    text-align: center;
}

.stat-card .stat-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.stat-card .stat-label {
    font-size: 14px;
    color: var(--text-muted);
}

.stat-card.warning .stat-value {
    color: var(--danger-color);
}

.stat-card.warning {
    border: 2px solid var(--danger-color);
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
}

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

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(0, 0, 0, 0.02);
}

tr:hover {
    background: rgba(0, 0, 0, 0.05);
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #dcfce7;
    color: var(--success-color);
}

.badge-danger {
    background: #fee2e2;
    color: var(--danger-color);
}

.badge-warning {
    background: #fef3c7;
    color: var(--warning-color);
}

.badge-info {
    background: #dbeafe;
    color: var(--primary-color);
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
}

.pagination button {
    padding: 8px 12px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-color);
}

.pagination button:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination .page-info {
    padding: 8px 16px;
    color: var(--text-muted);
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

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

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

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

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Toast 提示 */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
}

.toast {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-success {
    border-left: 4px solid var(--success-color);
}

.toast-error {
    border-left: 4px solid var(--danger-color);
}

.toast-warning {
    border-left: 4px solid var(--warning-color);
}

.toast-info {
    border-left: 4px solid var(--primary-color);
}

/* 工具栏 */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.toolbar-left {
    display: flex;
    gap: 12px;
    align-items: center;
}

.toolbar-right {
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-box input {
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.search-box button {
    padding: 8px 12px;
}

/* 图表容器 */
.chart-container {
    height: 300px;
    padding: 20px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* 加载状态 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(79, 70, 229, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Tab 切换 */
.tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    margin-bottom: 20px;
}

.tab {
    padding: 12px 24px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab:hover {
    background: rgba(255, 255, 255, 0.3);
}

.tab.active {
    border-bottom-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 500;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 响应式 */
@media (max-width: 768px) {
    /* 侧边栏改为隐藏，通过汉堡菜单控制 */
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        width: 280px;
        height: 100vh;
        z-index: 999;
        transition: left 0.3s ease;
        padding-top: 60px;
    }

    .sidebar.active {
        left: 0;
    }

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

    .sidebar-overlay.active {
        display: block;
    }

    /* 汉堡菜单按钮 */
    .mobile-header {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 56px;
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(10px);
        z-index: 997;
        align-items: center;
        padding: 0 16px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }

    .hamburger {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        width: 30px;
        height: 30px;
        cursor: pointer;
        padding: 4px;
    }

    .hamburger span {
        display: block;
        width: 100%;
        height: 2px;
        background: var(--text-color);
        border-radius: 2px;
        transition: all 0.3s ease;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    .mobile-header h2 {
        font-size: 18px;
        margin-left: 16px;
    }

    .main-content {
        margin-left: 0;
        padding: 76px 16px 20px;
        overflow-x: hidden;
        min-width: 0;
    }

    .page {
        min-width: 0;
        overflow-x: hidden;
    }

    .page-header h1 {
        font-size: 22px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-card .stat-value {
        font-size: 28px;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-left,
    .toolbar-right {
        width: 100%;
    }

    .toolbar-right {
        flex-wrap: wrap;
    }

    .toolbar-right input {
        flex: 1;
        min-width: 150px;
    }

    /* 表格手机端优化 */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 600px;
        font-size: 12px;
    }

    th, td {
        padding: 10px 8px;
        white-space: nowrap;
        font-size: 11px;
    }

    /* glass-card 允许表格滚动 */
    .glass-card {
        padding: 12px;
        margin-bottom: 12px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* 表单优化 */
    .form-group {
        margin-bottom: 16px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px;
        font-size: 16px; /* 防止iOS缩放 */
    }

    /* 弹窗优化 */
    .modal-content {
        padding: 20px;
        width: 95%;
        max-height: 85vh;
        border-radius: 12px;
    }

    .modal-header h3 {
        font-size: 18px;
    }

    /* 登录页面优化 */
    .login-box {
        padding: 24px 20px;
    }

    .login-box h1 {
        font-size: 24px;
    }

    /* Toast优化 */
    .toast-container {
        top: 70px;
        right: 10px;
        left: 10px;
    }

    .toast {
        min-width: auto;
        width: 100%;
    }

    /* 分页优化 */
    .pagination {
        flex-wrap: wrap;
        gap: 6px;
    }

    .pagination button {
        padding: 8px 10px;
        font-size: 12px;
    }

    /* 按钮优化 */
    .btn {
        padding: 12px 20px;
        font-size: 14px;
        min-height: 44px;
    }

    .btn-sm {
        padding: 8px 12px;
    }

    /* 确认框优化 */
    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }
}

/* 滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* 隐藏/显示 */
.hidden {
    display: none !important;
}

/* 用户信息栏 */
.user-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    margin-bottom: 20px;
}

.user-info .username {
    font-weight: 500;
}

.user-info .btn-logout {
    padding: 6px 12px;
    font-size: 12px;
}

/* 公告卡片样式 */
.notice-card {
    border-left: 4px solid var(--notice-color);
    background: rgb(255, 94, 0);
}

.notice-card h3 {
    color: var(--primary-color);
}

/* 文章列表样式 */
.article-item {
    padding: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: background 0.2s;
}

.article-item:hover {
    background: rgba(0, 0, 0, 0.03);
}

.article-item:last-child {
    border-bottom: none;
}

.article-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.article-item-header h4 {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.article-date {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}
