/* ===== 主题变量 ===== */
:root {
    /* 浅色主题 */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-card: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #6c757d;
    --border-color: #e0e0e0;
    --accent-color: #667eea;
    --accent-hover: #5568d3;
    --success-color: #48bb78;
    --danger-color: #f56565;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] {
    /* 深色主题 */
    --bg-primary: #1a1a1a;
    --bg-secondary: #252525;
    --bg-card: #2d2d2d;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --border-color: #404040;
    --accent-color: #7c8ef5;
    --accent-hover: #6b7de4;
    --success-color: #48bb78;
    --danger-color: #f56565;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    padding: 0;
    color: var(--text-primary);
    line-height: 1.6;
}

/* ===== 头部 ===== */
.header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    min-width: 0;
}

.logo {
    font-size: 1.3em;
    font-weight: 700;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.logo-text {
    display: inline;
}

.header-nav {
    display: flex;
    gap: 10px;
    margin-left: 20px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s;
    white-space: nowrap;
    font-size: 0.95em;
}

.nav-link:hover {
    color: var(--accent-color);
    background: var(--bg-secondary);
}

.nav-link.active {
    color: var(--accent-color);
    background: var(--bg-secondary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.theme-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1.2em;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}

.theme-toggle:hover,
.theme-toggle:active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    transform: scale(1.05);
}

/* ===== 容器 ===== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px;
}

/* ===== 页面标题 ===== */
.page-header {
    margin-bottom: 30px;
}

.page-title {
    font-size: 2.2em;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.page-description {
    color: var(--text-secondary);
    font-size: 1em;
    line-height: 1.6;
}

/* ===== 操作栏 ===== */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.action-bar-title {
    font-size: 1.3em;
    font-weight: 600;
    color: var(--text-primary);
}

/* ===== 按钮 ===== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

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

.btn-danger:hover {
    background: #e55353;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 101, 101, 0.35);
}

/* ===== 配置卡片 ===== */
.config-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    transition: all 0.3s;
    box-shadow: var(--shadow);
}

.config-item:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

/* ===== 表单 ===== */
.form-group {
    margin-bottom: 20px;
}

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

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1em;
    font-family: inherit;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: var(--bg-primary);
}

.form-control::placeholder {
    color: var(--text-secondary);
}

/* ===== 消息提示 ===== */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 1000;
    animation: slideIn 0.3s;
    max-width: 400px;
    word-wrap: break-word;
    white-space: pre-line;
}

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

.message.success {
    background: var(--success-color);
    color: white;
    border-left: 4px solid #2f855a;
}

.message.error {
    background: var(--danger-color);
    color: white;
    border-left: 4px solid #c53030;
}

.message.show {
    display: block;
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    .header {
        padding: 12px 15px;
    }
    .logo-text {
        display: none;
    }
    .action-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        padding: 15px;
    }
    .btn {
        min-width: 44px;
        min-height: 44px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    .page-title {
        font-size: 1.6em;
    }
    .form-control {
        font-size: 16px;
    }
}
