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

:root {
    /* 典雅黑白配色 */
    --background: #ffffff;
    --surface: #f6f6f6;
    --surface-hover: #efefef;
    --border: #e5e5e5;
    --text-primary: #111111;
    --text-secondary: #555555;
    --text-muted: #8a8a8a;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.06);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.06);
    --radius: 8px;
    --radius-lg: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 14px;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* 登录页面 */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(90deg, transparent 98%, rgba(0,0,0,0.03) 100%),
        linear-gradient(0deg, transparent 98%, rgba(0,0,0,0.03) 100%);
    background-size: 50px 50px;
    animation: grid-move 20s linear infinite;
}

.login-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(0,0,0,0.02) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0,0,0,0.02) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(0,0,0,0.01) 0%, transparent 50%);
    animation: float 30s ease-in-out infinite;
}

@keyframes grid-move {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

@keyframes float {
    0%, 100% { transform: translate(-25%, -25%) rotate(0deg); }
    33% { transform: translate(-25%, -30%) rotate(1deg); }
    66% { transform: translate(-30%, -25%) rotate(-1deg); }
}

/* 动态线条效果 */
.login-container .line {
    position: absolute;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 1px;
    z-index: 1;
    pointer-events: none;
}

.login-container .line:nth-child(1) {
    width: 200px;
    height: 1px;
    top: 20%;
    left: 10%;
    animation: line-float-1 8s ease-in-out infinite;
}

.login-container .line:nth-child(2) {
    width: 150px;
    height: 1px;
    top: 60%;
    right: 15%;
    animation: line-float-2 10s ease-in-out infinite reverse;
}

.login-container .line:nth-child(3) {
    width: 1px;
    height: 100px;
    top: 30%;
    left: 80%;
    animation: line-float-3 12s ease-in-out infinite;
}

.login-container .line:nth-child(4) {
    width: 1px;
    height: 80px;
    bottom: 25%;
    left: 20%;
    animation: line-float-4 9s ease-in-out infinite reverse;
}

@keyframes line-float-1 {
    0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.3; }
    50% { transform: translateY(-20px) rotate(2deg); opacity: 0.7; }
}

@keyframes line-float-2 {
    0%, 100% { transform: translateX(0) rotate(0deg); opacity: 0.4; }
    50% { transform: translateX(15px) rotate(-1deg); opacity: 0.8; }
}

@keyframes line-float-3 {
    0%, 100% { transform: translateX(0) scaleY(1); opacity: 0.3; }
    50% { transform: translateX(-10px) scaleY(1.2); opacity: 0.6; }
}

@keyframes line-float-4 {
    0%, 100% { transform: translateY(0) scaleY(1); opacity: 0.5; }
    50% { transform: translateY(10px) scaleY(0.8); opacity: 0.3; }
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-lg);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    position: relative;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    z-index: 10;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.1), transparent);
    animation: scan 3s ease-in-out infinite;
}

@keyframes scan {
    0%, 100% { opacity: 0; transform: translateX(-100%); }
    50% { opacity: 1; transform: translateX(100%); }
}

.logo-section {
    margin-bottom: 32px;
}

.logo {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
}

.logo-section h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.tagline {
    color: var(--text-secondary);
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    position: relative;
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    transition: all 0.2s;
    background: var(--background);
}

.input-group input:focus {
    outline: none;
    border-color: #111111;
    box-shadow: 0 0 0 3px rgb(0 0 0 / 0.06);
}

.login-btn {
    padding: 12px 24px;
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.login-btn:hover {
    background: var(--surface-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* 导航栏 */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--background);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-logo {
    width: 32px;
    height: 32px;
}

.brand-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius);
    transition: all 0.2s;
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    background: var(--surface);
    color: var(--text-primary);
}

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

.logout-btn {
    padding: 8px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

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

/* 主内容 */
.main-content {
    padding: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.tab-content {
    display: none;
}

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

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.header-content h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.header-desc {
    color: var(--text-secondary);
    font-size: 14px;
}

.primary-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

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

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

/* 内容网格 */
.content-grid {
    display: grid;
    gap: 16px;
}

.card {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.card-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.card-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.btn {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--background);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
}

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

.btn-primary, .btn-danger { background: var(--surface); color: var(--text-primary); border-color: var(--border); }
.btn-primary:hover, .btn-danger:hover { background: var(--surface-hover); }

/* 状态标签 */
.status {
display: inline-flex;
align-items: center;
padding: 4px 8px;
border-radius: 12px;
font-size: 11px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.5px;
}

.status.enabled { background: rgb(0 0 0 / 0.06); color: var(--text-primary); }
.status.disabled { background: rgb(0 0 0 / 0.04); color: var(--text-muted); }

/* 模态框 */
.modal {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1000;
}

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

.modal-backdrop {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
backdrop-filter: blur(4px);
}

.modal-content {
position: relative;
background: var(--background);
border-radius: var(--radius-lg);
box-shadow: var(--shadow-lg);
max-width: 500px;
width: 90%;
max-height: 90vh;
overflow-y: auto;
display: flex;
flex-direction: column;
}

.modal-header {
display: flex;
justify-content: flex-end;
padding: 16px 20px 0;
flex-shrink: 0;
}

.close {
font-size: 24px;
cursor: pointer;
color: var(--text-muted);
transition: color 0.2s;
}

.close:hover {
color: var(--text-primary);
}

.modal-body {
padding: 0 20px 20px;
flex: 1;
overflow-y: auto;
min-height: 0;
}

.modal-form h3 {
font-size: 20px;
font-weight: 700;
margin-bottom: 20px;
color: var(--text-primary);
}

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

.form-group label {
display: block;
margin-bottom: 6px;
font-weight: 600;
color: var(--text-primary);
font-size: 13px;
}

.form-group input,
.form-group textarea {
width: 100%;
padding: 10px 12px;
border: 2px solid var(--border);
border-radius: var(--radius);
font-size: 14px;
transition: all 0.2s;
background: var(--background);
}

.form-group input:focus,
.form-group textarea:focus {
outline: none;
border-color: var(--border);
box-shadow: 0 0 0 3px rgb(0 0 0 / 0.1);
}

.form-group textarea {
height: 80px;
resize: vertical;
}

.form-group input[type="checkbox"] {
width: auto;
margin-right: 8px;
}

.form-actions {
display: flex;
gap: 12px;
justify-content: flex-end;
margin-top: 24px;
padding-top: 16px;
border-top: 1px solid var(--border);
}

.form-actions button {
padding: 10px 20px;
border-radius: var(--radius);
font-weight: 600;
cursor: pointer;
transition: all 0.2s;
}

.form-actions button[type="button"] {
background: var(--surface);
border: 1px solid var(--border);
color: var(--text-secondary);
}

.form-actions button[type="button"]:hover {
background: var(--surface-hover);
}

.form-actions button[type="submit"] { background: var(--surface); border: 1px solid var(--border); color: var(--text-primary); }
.form-actions button[type="submit"]:hover { background: var(--surface-hover); }

/* 空状态 */
.empty-state {
text-align: center;
padding: 60px 20px;
color: var(--text-muted);
background: var(--surface);
border-radius: var(--radius-lg);
border: 2px dashed var(--border);
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--border);
}

.empty-state::before {
    content: "📭";
    display: block;
    font-size: 48px;
    margin-bottom: 16px;
}

/* 筛选条 */
.filter-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin: 8px 0 16px 0;
}
.filter-bar input[type="text"],
.filter-bar input[type="datetime-local"] {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    background: var(--background);
}
.filter-bar .btn { padding: 8px 12px; }

/* 表格 */
.table-wrapper {
    width: 100%;
    overflow: auto;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.simple-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.simple-table thead th {
    text-align: left;
    background: var(--surface);
    color: var(--text-primary);
    font-weight: 600;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}
.simple-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
}
.simple-table tbody tr:hover { background: var(--surface); }
.simple-table .col-title {
    max-width: 520px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.simple-table .col-time { color: var(--text-secondary); white-space: nowrap; }
.simple-table .col-link a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--border); padding-bottom: 1px; }
.simple-table .col-link a:hover { background: var(--surface); }

/* 分页 */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
}
.pagination .page-info { color: var(--text-secondary); font-size: 13px; }
.pagination .pager { display: flex; gap: 8px; }
.pagination .btn { padding: 6px 10px; }

/* 响应式 */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 16px;
        padding: 16px;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }
    
    .page-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .main-content {
        padding: 16px;
    }
    
    .login-card {
        padding: 24px;
    }
    
    .modal-content {
        margin: 20px;
        width: calc(100% - 40px);
    }
}

@media (max-width: 480px) {
    .nav-link {
        flex-direction: column;
        gap: 4px;
        font-size: 12px;
        padding: 8px 12px;
    }
    
    .nav-icon {
        font-size: 18px;
    }
}
