/* ============================================
   个人数字化工作台 - 主题样式
   ============================================ */

/* --------------------------------------------
   🌊 深海蓝主题 (默认)
   -------------------------------------------- */
[data-theme="ocean"],
:root {
    --primary-color: #3B82F6;
    --bg-color: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-bg: rgba(255, 255, 255, 0.95);
    --card-hover: rgba(255, 255, 255, 1);
    --text-color: #1f2937;
    --text-secondary: #6b7280;
    --border-color: rgba(0, 0, 0, 0.08);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.theme-preview.ocean {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* --------------------------------------------
   🌅 晨曦橙主题
   -------------------------------------------- */
[data-theme="sunset"] {
    --primary-color: #F97316;
    --bg-color: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    --card-bg: rgba(255, 255, 255, 0.95);
    --card-hover: rgba(255, 255, 255, 1);
    --text-color: #431407;
    --text-secondary: #9a3412;
    --border-color: rgba(249, 115, 22, 0.15);
    --shadow: 0 4px 20px rgba(249, 115, 22, 0.15);
    --shadow-hover: 0 8px 30px rgba(249, 115, 22, 0.2);
}

.theme-preview.sunset {
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
}

/* --------------------------------------------
   🌿 森林绿主题
   -------------------------------------------- */
[data-theme="forest"] {
    --primary-color: #10B981;
    --bg-color: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --card-bg: rgba(255, 255, 255, 0.95);
    --card-hover: rgba(255, 255, 255, 1);
    --text-color: #064e3b;
    --text-secondary: #047857;
    --border-color: rgba(16, 185, 129, 0.15);
    --shadow: 0 4px 20px rgba(16, 185, 129, 0.15);
    --shadow-hover: 0 8px 30px rgba(16, 185, 129, 0.2);
}

.theme-preview.forest {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

/* --------------------------------------------
   🌌 星空黑主题
   -------------------------------------------- */
[data-theme="starry"] {
    --primary-color: #8B5CF6;
    --bg-color: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #1e1b4b 100%);
    --card-bg: rgba(30, 41, 59, 0.9);
    --card-hover: rgba(30, 41, 59, 0.95);
    --text-color: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: rgba(139, 92, 246, 0.2);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.5);
}

[data-theme="starry"] .link-card {
    background: rgba(51, 65, 85, 0.6);
}

[data-theme="starry"] .link-card:hover {
    background: rgba(51, 65, 85, 0.9);
}

[data-theme="starry"] .search-wrapper {
    background: rgba(30, 41, 59, 0.8);
}

[data-theme="starry"] .search-wrapper input {
    color: #f1f5f9;
}

[data-theme="starry"] .search-select {
    color: #cbd5e1;
}

.theme-preview.starry {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #1e1b4b 100%);
}

/* --------------------------------------------
   🌸 樱花粉主题
   -------------------------------------------- */
[data-theme="sakura"] {
    --primary-color: #EC4899;
    --bg-color: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 50%, #fbcfe8 100%);
    --card-bg: rgba(255, 255, 255, 0.95);
    --card-hover: rgba(255, 255, 255, 1);
    --text-color: #831843;
    --text-secondary: #be185d;
    --border-color: rgba(236, 72, 153, 0.15);
    --shadow: 0 4px 20px rgba(236, 72, 153, 0.1);
    --shadow-hover: 0 8px 30px rgba(236, 72, 153, 0.15);
}

.theme-preview.sakura {
    background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 50%, #fbcfe8 100%);
}

/* --------------------------------------------
   ⬜ 极简白主题
   -------------------------------------------- */
[data-theme="minimal"] {
    --primary-color: #374151;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --card-hover: #ffffff;
    --text-color: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.08);
}

[data-theme="minimal"] .link-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
}

[data-theme="minimal"] .link-card:hover {
    border-color: #d1d5db;
}

[data-theme="minimal"] .search-wrapper {
    background: #ffffff;
    border: 1px solid var(--border-color);
}

.theme-preview.minimal {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

/* --------------------------------------------
   卡片风格变体
   -------------------------------------------- */

/* 毛玻璃风格 (默认) */
.card-style-glass .group,
.card-style-glass .header,
.card-style-glass .motto-section,
.card-style-glass .footer {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    /* 鸿蒙/华为浏览器降级方案 */
    background-color: rgba(255, 255, 255, 0.95);
}

/* 扁平风格 */
.card-style-flat .group,
.card-style-flat .header,
.card-style-flat .motto-section,
.card-style-flat .footer {
    box-shadow: none;
    border: 1px solid var(--border-color);
}

/* 阴影风格 */
.card-style-shadow .group,
.card-style-shadow .header,
.card-style-shadow .motto-section,
.card-style-shadow .footer {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
}

/* --------------------------------------------
   动画效果
   -------------------------------------------- */

/* 页面加载动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.group {
    animation: fadeInUp 0.5s ease backwards;
}

.group:nth-child(1) { animation-delay: 0.1s; }
.group:nth-child(2) { animation-delay: 0.2s; }
.group:nth-child(3) { animation-delay: 0.3s; }
.group:nth-child(4) { animation-delay: 0.4s; }
.group:nth-child(5) { animation-delay: 0.5s; }

/* 链接卡片进入动画 */
@keyframes cardPopIn {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    70% {
        transform: scale(1.02);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.link-card {
    animation: cardPopIn 0.3s ease backwards;
}

/* 悬停发光效果 */
.group:hover {
    box-shadow: var(--shadow-hover);
}

/* 时间数字闪烁动画 */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.time {
    animation: pulse 2s ease-in-out infinite;
}

/* 格言淡入动画 */
@keyframes mottoFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.motto-content {
    animation: mottoFadeIn 1s ease;
}

/* 搜索框聚焦发光 */
.search-wrapper:focus-within {
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

/* 按钮点击波纹效果 */
.link-card:active,
.btn-primary:active {
    transform: scale(0.95);
}

/* 主题切换过渡 */
body {
    transition: background 0.5s ease;
}

.group,
.header,
.motto-section,
.footer,
.link-card {
    transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
}
