/* 基础变量 */
:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --secondary: #5f6368;
    --success: #34a853;
    --danger: #ea4335;
    --warning: #fbbc04;
    --bg: #f8f9fa;
    --bg-card: #ffffff;
    --text: #202124;
    --text-secondary: #5f6368;
    --border: #dadce0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    --radius: 8px;
    --transition: all 0.3s ease;
}

/* 深色模式 */
[data-theme="dark"] {
    --bg: #1a1a2e;
    --bg-card: #16213e;
    --text: #e0e0e0;
    --text-secondary: #a0a0a0;
    --border: #2a2a4a;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
.header {
    background: var(--bg-card);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.logo {
    font-size: 1.25rem;
    color: var(--primary);
    font-weight: 600;
}

.nav {
    display: flex;
    gap: 8px;
}

.nav-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius);
    transition: var(--transition);
    font-size: 0.95rem;
}

.nav-btn:hover {
    background: var(--bg);
    color: var(--primary);
}

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

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text);
}

/* 主内容区 */
.main {
    padding: 24px 0;
    min-height: calc(100vh - 120px);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 卡片样式 */
.welcome-card, .collect-card, .list-card, .settings-card, .stats-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.welcome-card h2, .collect-card h2, .settings-card h2 {
    color: var(--text);
    margin-bottom: 16px;
    font-size: 1.5rem;
}

.welcome-card p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* 特性卡片 */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.feature-card {
    text-align: center;
    padding: 20px;
    background: var(--bg);
    border-radius: var(--radius);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 12px;
}

.feature-card h3 {
    color: var(--text);
    margin-bottom: 8px;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* 统计卡片 */
.stats-card h3 {
    color: var(--text);
    margin-bottom: 16px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius);
    color: white;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    display: block;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* 表单样式 */
.collect-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 500;
    color: var(--text);
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

/* 按钮样式 */
.btn-primary {
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

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

.btn-secondary {
    padding: 10px 20px;
    background: var(--secondary);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    opacity: 0.9;
}

.btn-danger {
    padding: 10px 20px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.btn-danger:hover {
    opacity: 0.9;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 6px 16px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

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

/* 收集列表 */
.collect-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.collect-item {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: var(--transition);
}

.collect-item:hover {
    box-shadow: var(--shadow);
}

.collect-item-content {
    flex: 1;
}

.collect-item-title {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.collect-item-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.collect-item-meta {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.collect-item-meta .badge {
    padding: 2px 8px;
    border-radius: 12px;
    background: var(--primary);
    color: white;
}

.collect-item-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 1rem;
}

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

.btn-icon.delete:hover {
    background: rgba(234, 67, 53, 0.1);
    color: var(--danger);
}

.empty-tip {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px 0;
    font-size: 0.95rem;
}

/* 设置页面 */
.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

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

.setting-info h4 {
    color: var(--text);
    margin-bottom: 4px;
}

.setting-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* 开关样式 */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border);
    transition: var(--transition);
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: var(--transition);
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary);
}

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

/* 安装提示 */
.install-prompt {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 16px 24px;
    z-index: 1000;
    max-width: 400px;
    width: 90%;
}

.install-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: center;
}

.install-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* 页脚 */
.footer {
    background: var(--bg-card);
    padding: 16px 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid var(--border);
}

/* 响应式设计 - 手机端 */
@media (max-width: 768px) {
    .header .container {
        flex-wrap: wrap;
        height: auto;
        padding: 12px 16px;
    }

    .nav {
        display: none;
        width: 100%;
        flex-direction: column;
        padding: 12px 0;
    }

    .nav.active {
        display: flex;
    }

    .nav-btn {
        width: 100%;
        text-align: center;
        padding: 12px;
    }

    .menu-toggle {
        display: block;
    }

    .main {
        padding: 16px 0;
    }

    .container {
        padding: 0 16px;
    }

    .features {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .collect-item {
        flex-direction: column;
        gap: 12px;
    }

    .collect-item-actions {
        align-self: flex-end;
    }
}

/* 响应式设计 - 平板端 */
@media (min-width: 769px) and (max-width: 1024px) {
    .features {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 响应式设计 - 电脑端 */
@media (min-width: 1025px) {
    .features {
        grid-template-columns: repeat(3, 1fr);
    }

    .welcome-card, .collect-card, .list-card, .settings-card, .stats-card {
        padding: 32px;
    }
}

/* 打印样式 */
@media print {
    .header, .footer, .install-prompt {
        display: none;
    }

    .main {
        padding: 0;
    }
}

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

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* 选择文本颜色 */
::selection {
    background: var(--primary);
    color: white;
}

/* 弹窗样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    margin: 0;
    color: var(--text);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 4px;
}

.modal-close:hover {
    background: var(--bg);
}

.modal-body {
    padding: 20px;
}

.install-guide-step {
    display: flex;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.install-guide-step:last-child {
    border-bottom: none;
}

.step-number {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content p {
    margin: 0;
    color: var(--text);
    line-height: 1.5;
}

.step-content .step-icon {
    font-size: 1.2rem;
    margin-right: 8px;
}

.install-browser-tag {
    display: inline-block;
    padding: 4px 10px;
    background: var(--primary);
    color: white;
    border-radius: 12px;
    font-size: 0.85rem;
    margin-bottom: 12px;
}
