/* 主题样式文件 - 提示词存储库 */

/* 主题切换动画 */
body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* 主题特定样式 */
.light-mode {
    /* 浅色模式特定样式 */
    --theme-accent: #4361ee;
    --theme-surface: #ffffff;
    --theme-elevation-1: #f8f9fa;
    --theme-elevation-2: #e9ecef;
    --theme-text-primary: #212529;
    --theme-text-secondary: #6c757d;
    --theme-border: #dee2e6;
    
    /* 卡片阴影 */
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
    
    /* 渐变 */
    --gradient-primary: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    --gradient-secondary: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.dark-mode {
    /* 深色模式特定样式 */
    --theme-accent: #60a5fa;
    --theme-surface: #0f172a;
    --theme-elevation-1: #1e293b;
    --theme-elevation-2: #334155;
    --theme-text-primary: #f1f5f9;
    --theme-text-secondary: #cbd5e1;
    --theme-border: #475569;
    
    /* 卡片阴影 */
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    --card-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.4);
    
    /* 渐变 */
    --gradient-primary: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    --gradient-secondary: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

/* 主题应用 */
body.light-mode {
    background-color: var(--theme-surface);
    color: var(--theme-text-primary);
}

body.dark-mode {
    background-color: var(--theme-surface);
    color: var(--theme-text-primary);
}

/* 主题化卡片 */
.themed-card {
    background-color: var(--theme-elevation-1);
    border: 1px solid var(--theme-border);
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.themed-card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
}

/* 主题化按钮 */
.themed-btn-primary {
    background: var(--gradient-primary);
    color: white;
    border: none;
    position: relative;
    overflow: hidden;
}

.themed-btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.themed-btn-primary:hover::before {
    left: 100%;
}

.themed-btn-secondary {
    background-color: var(--theme-elevation-1);
    color: var(--theme-text-primary);
    border: 1px solid var(--theme-border);
}

.themed-btn-secondary:hover {
    background-color: var(--theme-elevation-2);
    border-color: var(--theme-accent);
}

/* 主题化输入框 */
.themed-input {
    background-color: var(--theme-elevation-1);
    border: 1px solid var(--theme-border);
    color: var(--theme-text-primary);
}

.themed-input:focus {
    border-color: var(--theme-accent);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.dark-mode .themed-input:focus {
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

/* 主题化选择框 */
.themed-select {
    background-color: var(--theme-elevation-1);
    border: 1px solid var(--theme-border);
    color: var(--theme-text-primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.dark-mode .themed-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

/* 主题化分隔线 */
.themed-divider {
    border: none;
    height: 1px;
    background-color: var(--theme-border);
    margin: var(--spacing-lg) 0;
}

/* 主题化标签 */
.themed-tag {
    background-color: var(--theme-elevation-2);
    color: var(--theme-text-secondary);
    border: 1px solid var(--theme-border);
}

.themed-tag:hover {
    background-color: var(--theme-accent);
    color: white;
    border-color: var(--theme-accent);
}

/* 主题化徽章 */
.themed-badge {
    background-color: var(--theme-elevation-2);
    color: var(--theme-text-secondary);
    border: 1px solid var(--theme-border);
}

.themed-badge-primary {
    background-color: var(--theme-accent);
    color: white;
    border-color: var(--theme-accent);
}

/* 主题化警告框 */
.themed-alert {
    background-color: var(--theme-elevation-1);
    border: 1px solid var(--theme-border);
    border-left: 4px solid var(--theme-accent);
}

.themed-alert-success {
    border-left-color: var(--success-color);
}

.themed-alert-warning {
    border-left-color: var(--warning-color);
}

.themed-alert-error {
    border-left-color: var(--danger-color);
}

/* 主题化代码块 */
.themed-code {
    background-color: var(--theme-elevation-2);
    border: 1px solid var(--theme-border);
    color: var(--theme-text-primary);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* 主题化表格 */
.themed-table {
    background-color: var(--theme-elevation-1);
    border: 1px solid var(--theme-border);
}

.themed-table th {
    background-color: var(--theme-elevation-2);
    color: var(--theme-text-primary);
    border-bottom: 2px solid var(--theme-border);
}

.themed-table td {
    border-bottom: 1px solid var(--theme-border);
    color: var(--theme-text-secondary);
}

.themed-table tr:hover {
    background-color: var(--theme-elevation-2);
}

/* 主题化加载动画 */
.themed-spinner {
    border: 3px solid var(--theme-elevation-2);
    border-top: 3px solid var(--theme-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 主题化进度条 */
.themed-progress {
    background-color: var(--theme-elevation-2);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.themed-progress-bar {
    background: var(--gradient-primary);
    height: 100%;
    transition: width 0.3s ease;
}

/* 主题化开关 */
.themed-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.themed-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.themed-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--theme-elevation-2);
    transition: .4s;
    border-radius: var(--radius-full);
}

.themed-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .themed-slider {
    background-color: var(--theme-accent);
}

input:checked + .themed-slider:before {
    transform: translateX(24px);
}

/* 主题化工具提示 */
.themed-tooltip {
    position: relative;
}

.themed-tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: var(--spacing-xs) var(--spacing-sm);
    background-color: var(--theme-elevation-2);
    color: var(--theme-text-primary);
    border: 1px solid var(--theme-border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-xs);
    white-space: nowrap;
    z-index: 1000;
    box-shadow: var(--card-shadow);
}

/* 主题化骨架屏 */
.themed-skeleton {
    background: linear-gradient(
        90deg,
        var(--theme-elevation-2) 25%,
        var(--theme-elevation-1) 50%,
        var(--theme-elevation-2) 75%
    );
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 主题化滚动条 */
.themed-scrollbar::-webkit-scrollbar-track {
    background: var(--theme-elevation-1);
}

.themed-scrollbar::-webkit-scrollbar-thumb {
    background: var(--theme-border);
}

.themed-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--theme-text-secondary);
}

/* 主题化模态框背景 */
.themed-modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5);
}

.dark-mode .themed-modal-backdrop {
    background-color: rgba(0, 0, 0, 0.7);
}

/* 主题化聚焦状态 */
.themed-focus:focus {
    outline: 2px solid var(--theme-accent);
    outline-offset: 2px;
}

/* 主题化禁用状态 */
.themed-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 主题化成功/错误状态 */
.themed-success {
    color: var(--success-color);
    background-color: rgba(16, 185, 129, 0.1);
}

.themed-error {
    color: var(--danger-color);
    background-color: rgba(239, 68, 68, 0.1);
}

.themed-warning {
    color: var(--warning-color);
    background-color: rgba(245, 158, 11, 0.1);
}

.themed-info {
    color: var(--info-color);
    background-color: rgba(59, 130, 246, 0.1);
}

/* 主题化响应式断点 */
@media (max-width: 768px) {
    .light-mode .mobile-optimized {
        --card-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    }
    
    .dark-mode .mobile-optimized {
        --card-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    }
}

/* 打印样式 */
@media print {
    .light-mode, .dark-mode {
        --theme-surface: white;
        --theme-text-primary: black;
        --theme-text-secondary: #666;
        --theme-border: #ddd;
    }
    
    .themed-card {
        box-shadow: none;
        border: 1px solid var(--theme-border);
    }
    
    .no-print {
        display: none !important;
    }
}