/* ==================== CSS变量定义 ==================== */
:root {
    /* 玻璃拟态变量 */
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.18);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --glass-blur: blur(20px);
    --glass-hover: rgba(255, 255, 255, 0.15);
    
    /* 渐变色变量 */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
    --gradient-warning: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --gradient-info: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-purple: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    /* 文字颜色变量 */
    --text-primary: rgba(255, 255, 255, 0.92);
    --text-secondary: rgba(255, 255, 255, 0.75);
    --text-tertiary: rgba(255, 255, 255, 0.55);
    --text-disabled: rgba(255, 255, 255, 0.35);
    
    /* 动画变量 */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-medium: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* 圆角变量 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-xxl: 24px;
}

/* ==================== 全局样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    user-select: none;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    color: var(--text-primary);
}

#app {
    width: 100vw;
    height: 100vh;
    position: relative;
}

/* ==================== 动态星空背景 ==================== */
.starfield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    background: radial-gradient(ellipse at bottom, #0f0c29 0%, #302b63 50%, #24243e 100%);
}

.stars, .stars2, .stars3 {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.stars {
    background: transparent;
    background-image:
        radial-gradient(2px 2px at 20px 30px, #eee, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 90px 40px, #fff, transparent),
        radial-gradient(2px 2px at 160px 120px, rgba(255,255,255,0.9), transparent),
        radial-gradient(1px 1px at 230px 80px, #fff, transparent),
        radial-gradient(2px 2px at 300px 150px, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 370px 50px, #fff, transparent),
        radial-gradient(2px 2px at 450px 180px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 520px 90px, #fff, transparent),
        radial-gradient(2px 2px at 600px 200px, rgba(255,255,255,0.9), transparent),
        radial-gradient(1px 1px at 680px 130px, #fff, transparent),
        radial-gradient(2px 2px at 750px 60px, rgba(255,255,255,0.7), transparent);
    background-size: 800px 400px;
    animation: starsMove 100s linear infinite;
}

.stars2 {
    background: transparent;
    background-image:
        radial-gradient(1px 1px at 50px 100px, #fff, transparent),
        radial-gradient(1px 1px at 150px 50px, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 250px 180px, #fff, transparent),
        radial-gradient(1px 1px at 350px 30px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 450px 140px, #fff, transparent),
        radial-gradient(1px 1px at 550px 70px, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 650px 160px, #fff, transparent),
        radial-gradient(1px 1px at 750px 90px, rgba(255,255,255,0.6), transparent);
    background-size: 900px 300px;
    animation: starsMove2 150s linear infinite;
}

.stars3 {
    background: transparent;
    background-image:
        radial-gradient(1px 1px at 30px 80px, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 130px 200px, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 230px 60px, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 330px 150px, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 430px 40px, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 530px 190px, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 630px 100px, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 730px 170px, rgba(255,255,255,0.4), transparent);
    background-size: 1000px 350px;
    animation: starsMove3 200s linear infinite;
}

@keyframes starsMove {
    from { transform: translateY(0); }
    to { transform: translateY(-400px); }
}

@keyframes starsMove2 {
    from { transform: translateY(0); }
    to { transform: translateY(-300px); }
}

@keyframes starsMove3 {
    from { transform: translateY(0); }
    to { transform: translateY(-350px); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scrollLeft {
    0% {
        transform: translateX(100%);
    }
    10% {
        transform: translateX(0);
    }
    90% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* ==================== 桌面布局 ==================== */
.desktop {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

/* ==================== 顶部工具栏 ==================== */
.top-bar {
    height: 56px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--glass-border);
    position: relative;
    z-index: 1000;
    box-shadow: var(--glass-shadow);
    gap: 20px;
}

.top-bar-left {
    display: flex;
    align-items: center;
}

.top-bar-center {
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 600px;
}

.top-bar-right {
    display: flex;
    align-items: center;
}

/* ==================== 用户模块 ==================== */
.user-module {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    z-index: 1000;
}

.user-module:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.user-avatar.logged-in {
    background: var(--gradient-primary);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.4);
}

.user-avatar svg {
    width: 16px;
    height: 16px;
    color: rgba(255, 255, 255, 0.6);
}

.avatar-text {
    font-size: 14px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
}

.user-name {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.5px;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 用户下拉菜单 */
.user-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    min-width: 260px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-xl);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    overflow: hidden;
    z-index: 1001;
}

.dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
}

.dropdown-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    flex-shrink: 0;
}

.dropdown-info {
    flex: 1;
    min-width: 0;
}

.dropdown-username {
    color: white;
    font-size: 15px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-email {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 4px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.dropdown-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.dropdown-item.logout {
    color: rgba(255, 100, 100, 0.9);
}

.dropdown-item.logout:hover {
    background: rgba(255, 100, 100, 0.15);
    color: #ff8080;
}

/* 下拉菜单动画 */
.dropdown-enter-active,
.dropdown-leave-active {
    transition: all 0.25s ease;
}

.dropdown-enter-from {
    opacity: 0;
    transform: translateY(-10px);
}

.dropdown-leave-to {
    opacity: 0;
    transform: translateY(-10px);
}

/* 时间显示 */
.time-display {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
}

/* ==================== 顶栏搜索框 ==================== */
.search-container-top {
    display: flex;
    gap: 0;
    width: 100%;
    max-width: 500px;
    position: relative;
    border-radius: 50px;
    overflow: visible;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.search-container-top:focus-within {
    box-shadow: 0 4px 30px rgba(102, 126, 234, 0.4);
}

.search-input-top {
    flex: 1;
    padding: 10px 16px;
    font-size: 14px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    color: white;
    outline: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-left: none;
    border-right: none;
    transition: all 0.3s;
}

.search-input-top::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.search-input-top:focus {
    background: rgba(255, 255, 255, 0.15);
}

.search-btn-top {
    width: 44px;
    height: auto;
    border: none;
    border-radius: 0 50px 50px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 16px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-left: none;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn-top:hover {
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.5);
}

.search-btn-top svg {
    width: 18px;
    height: 18px;
}

/* 搜索引擎选择器 - 顶栏版本 */
.search-container-top .search-engine-selector {
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-right: none;
    border-radius: 50px 0 0 50px;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 50px;
    justify-content: center;
    z-index: 100;
}

.search-container-top .search-engine-selector:hover {
    background: rgba(255, 255, 255, 0.2);
}

.search-container-top .engine-icon {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    object-fit: contain;
}

.search-container-top .dropdown-arrow {
    width: 12px;
    height: 12px;
    color: rgba(255, 255, 255, 0.7);
    transition: transform 0.3s;
}

/* 搜索历史菜单 - 顶栏版本 */
.search-container-top .search-history-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(30, 30, 30, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    padding: 8px;
    z-index: 200;
    max-height: 300px;
    overflow-y: auto;
}

/* 搜索引擎菜单 */
.engine-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 180px;
    background: rgba(30, 30, 30, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    padding: 8px;
    z-index: 101;
}

.engine-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: rgba(255, 255, 255, 0.9);
}

.engine-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.engine-item.active {
    background: rgba(102, 126, 234, 0.3);
    border: 1px solid rgba(102, 126, 234, 0.5);
}

.engine-icon-small {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: contain;
}

.engine-item span {
    font-size: 14px;
    font-weight: 500;
}

/* 搜索历史项 */
.search-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 8px;
}

.search-history-header span {
    font-size: 12px;
    color: var(--text-tertiary);
}

.clear-history-btn {
    background: none;
    border: none;
    color: rgba(255, 100, 100, 0.8);
    font-size: 12px;
    cursor: pointer;
    transition: color 0.2s;
}

.clear-history-btn:hover {
    color: #ff6b6b;
}

.search-history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.search-history-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.history-query {
    flex: 1;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
}

.remove-history-item {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.remove-history-item:hover {
    color: rgba(255, 100, 100, 0.9);
}

/* ==================== 主内容区域 ==================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 40px 60px;
    overflow-y: auto;
    position: relative;
    z-index: 1;
}

/* ==================== 欢迎语样式 ==================== */
.welcome-section {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInUp 0.8s ease-out;
}

.welcome-title {
    font-size: 32px;
    font-weight: 300;
    color: white;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.welcome-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ==================== 组件网格 ==================== */
.widget-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 28px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* ==================== 组件卡片 ==================== */
.widget-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 28px;
    box-shadow: var(--glass-shadow);
    transition: var(--transition-medium);
    display: flex;
    flex-direction: column;
    min-height: 280px;
}

.widget-card:hover {
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
    transform: translateY(-4px);
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.widget-title {
    font-size: 18px;
    font-weight: 600;
    color: white;
    letter-spacing: 0.3px;
}

.widget-status {
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 500;
}

.widget-count {
    font-size: 12px;
    color: var(--text-tertiary);
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 10px;
    border-radius: 12px;
}

.widget-badge {
    font-size: 11px;
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.widget-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ==================== 打卡组件 ==================== */
.checkin-widget .widget-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.checkin-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid rgba(102, 126, 234, 0.6);
    background: rgba(102, 126, 234, 0.15);
    backdrop-filter: blur(10px);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.3s ease;
    color: rgba(255, 255, 255, 0.9);
}

.checkin-btn.checked {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
    border-color: transparent;
}

.checkin-btn svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
}

.checkin-btn span {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.checkin-streak {
    text-align: center;
}

.streak-count {
    display: block;
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.streak-label {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* ==================== 待办组件 ==================== */
.todos-widget .todo-input-area {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.todos-widget .todo-input {
    flex: 1;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: white;
    font-size: 13px;
    outline: none;
    transition: all 0.3s;
}

.todos-widget .todo-input:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(102, 126, 234, 0.4);
}

.todos-widget .todo-add-btn {
    width: 36px;
    height: 36px;
    background: rgba(102, 126, 234, 0.3);
    border: 1px solid rgba(102, 126, 234, 0.5);
    border-radius: 8px;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.todos-widget .todo-add-btn:hover {
    background: rgba(102, 126, 234, 0.5);
    transform: scale(1.05);
}

.todos-widget .todo-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.todo-item-mini {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: all 0.2s;
    cursor: pointer;
}

.todo-item-mini:hover {
    background: rgba(255, 255, 255, 0.08);
}

.todo-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.todo-text-mini {
    flex: 1;
    font-size: 13px;
    color: var(--text-secondary);
}

.todo-item-mini.done .todo-text-mini {
    text-decoration: line-through;
    opacity: 0.6;
}

.todo-delete-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    opacity: 0;
    margin-left: auto;
}

.todo-item-mini:hover .todo-delete-btn {
    opacity: 1;
}

.todo-delete-btn:hover {
    color: rgba(255, 100, 100, 0.9);
    background: rgba(255, 100, 100, 0.1);
    border-radius: 4px;
}

.todo-delete-btn svg {
    width: 14px;
    height: 14px;
}

.todo-more {
    text-align: center;
    margin-top: 8px;
}

.todo-more a {
    font-size: 12px;
    color: var(--text-tertiary);
    text-decoration: none;
    transition: color 0.2s;
}

.todo-more a:hover {
    color: #667eea;
}

/* ==================== 计时组件 ==================== */
.timer-widget .widget-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.timer-mode-tabs {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 4px;
}

.timer-mode-tab {
    padding: 6px 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.timer-mode-tab.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.timer-display {
    font-size: 42px;
    font-weight: 300;
    color: white;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    text-align: center;
    line-height: 1.2;
}

.timer-label {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 8px;
    font-family: 'Segoe UI', sans-serif;
}

.timer-tag-input {
    width: 100%;
    max-width: 280px;
}

.timer-tag-input input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: white;
    font-size: 13px;
    outline: none;
    transition: all 0.3s;
}

.timer-tag-input input:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(102, 126, 234, 0.4);
}

.timer-tag-input input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.timer-controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.timer-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    color: white;
}

.timer-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.4);
    transform: scale(1.1);
}

.timer-btn svg {
    width: 18px;
    height: 18px;
}

.timer-settings {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.timer-slider {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.timer-slider::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    cursor: pointer;
}

.timer-minutes {
    text-align: center;
    font-size: 12px;
    color: var(--text-tertiary);
}

.timer-records {
    width: 100%;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.records-title {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 500;
}

.record-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.record-item:last-child {
    border-bottom: none;
}

.record-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.record-label {
    font-size: 13px;
    color: white;
    font-weight: 500;
}

.record-time {
    font-size: 12px;
    color: var(--text-tertiary);
    font-family: 'Courier New', monospace;
}

.record-date {
    font-size: 11px;
    color: var(--text-tertiary);
}

.record-more {
    text-align: center;
    padding: 8px;
    font-size: 12px;
    color: var(--text-tertiary);
}

/* ==================== 音乐播放器组件 ==================== */
/* 音乐播放器主体 */
.music-widget {
    contain: layout style paint;
    position: relative;
}

.music-widget .widget-body {
    display: flex;
    flex-direction: row;
    padding: 0;
    min-height: 0;
    position: relative;
    overflow: hidden;
}

/* 头部区域 */
.music-controls-header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 20px 20px 16px;
}

.music-title-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
}

.music-title-wrapper {
    overflow: hidden;
    position: relative;
}

/* 标题样式 - 优化选择器 */
.widget-title {
    font: 600 18px/1.3 'Segoe UI', sans-serif;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: transform .3s ease;
    max-width: 100%;
}

/* 滚动动画 - 使用transform3d触发硬件加速 */
.widget-title.scroll {
    display: inline-block;
    text-overflow: clip;
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
    animation: scrollText 15s ease-in-out infinite;
    animation-delay: 2s;
    will-change: transform;
    padding-right: 40px;
}

@keyframes scrollText {
    0%, 10% {
        transform: translateX(0);
    }
    90%, 100% {
        transform: translateX(calc(-100% + 200px));
    }
}

.artist-name {
    font: 500 13px/1.2 'Segoe UI', sans-serif;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 文件夹按钮 - 使用grid优化布局 */
.music-folder-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, .1);
    border-radius: 8px;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: all .2s ease;
    color: var(--text-secondary);
    justify-self: end;
}

.music-folder-btn:hover {
    background: rgba(102, 126, 234, .2);
    color: #fff;
    transform: scale(1.05);
}

.music-folder-btn svg {
    width: 16px;
    height: 16px;
}

/* 进度条区域 - 使用伪元素优化 */
.music-progress-section {
    padding: 0 20px 16px;
    margin-bottom: 0;
}

/* 空状态样式 */
.music-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 20px;
    gap: 20px;
    text-align: center;
    animation: fadeIn .5s ease;
}

.empty-icon {
    display: none;
}

.empty-text {
    font-size: 15px;
    color: var(--text-secondary);
    margin: 0 20px 0 0;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.empty-action-btn {
    display: grid;
    grid-template-columns: auto auto;
    gap: 8px;
    align-items: center;
    padding: 12px 24px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 50px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all .3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, box-shadow;
}

.empty-action-btn:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3), rgba(118, 75, 162, 0.3));
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateY(-2px) translateZ(0);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
}

.empty-action-btn svg {
    width: 18px;
    height: 18px;
    display: block;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 20px 10px rgba(102, 126, 234, 0);
    }
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.music-info {
    display: none;
}

.track-title, .track-artist {
    display: none;
}

.music-progress {
    width: 100%;
}

.time-display {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    font: 500 13px 'Courier New', monospace;
    color: var(--text-secondary);
}

.current-time, .total-time {
    min-width: 45px;
    text-align: center;
}

.progress-bar-container {
    height: 32px;
    display: grid;
    align-items: center;
    cursor: pointer;
    padding: 0 4px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, .1);
    border-radius: 3px;
    overflow: visible;
    cursor: pointer;
    position: relative;
    transition: height .2s ease;
}

.progress-bar:hover, .progress-bar.dragging {
    height: 8px;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-purple);
    transition: width .1s ease;
    position: relative;
}

/* 使用伪元素减少DOM节点 */
.progress-fill::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
    opacity: 0;
    transition: opacity .2s ease, transform .1s ease;
    cursor: grab;
    will-change: opacity;
}

.progress-bar:hover .progress-fill::after,
.progress-bar.dragging .progress-fill::after {
    opacity: 1;
}

.progress-bar.dragging .progress-fill::after {
    cursor: grabbing;
    transform: translateY(-50%) scale(1.1);
}

/* 控制条 - 使用grid优化 */
.music-control-bar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, .1);
}

.music-play-controls {
    display: grid;
    grid-template-columns: repeat(3, auto);
    gap: 12px;
    justify-content: center;
}

/* 按钮通用样式 - 减少重复 */
.music-btn {
    --btn-size: 44px;
    width: var(--btn-size);
    height: var(--btn-size);
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .15);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: all .3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #fff;
    will-change: transform, box-shadow;
}

.music-btn:hover {
    background: rgba(102, 126, 234, .2);
    border-color: rgba(102, 126, 234, .4);
    transform: scale(1.1) translateZ(0);
    box-shadow: 0 4px 12px rgba(102, 126, 234, .2);
}

.music-play {
    --btn-size: 56px;
    background: var(--gradient-purple);
    border-color: transparent;
    box-shadow: 0 4px 20px rgba(102, 126, 234, .3);
}

.music-play:hover {
    box-shadow: 0 6px 30px rgba(102, 126, 234, .5);
}

.music-btn svg {
    width: 20px;
    height: 20px;
    display: block;
}

.music-control-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .15);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: all .2s cubic-bezier(0.4, 0, 0.2, 1);
    color: #fff;
    will-change: transform;
}

.music-control-btn:hover {
    background: rgba(102, 126, 234, .2);
    border-color: rgba(102, 126, 234, .4);
    transform: scale(1.05) translateZ(0);
}

.music-control-btn.active {
    background: rgba(102, 126, 234, .3);
    border-color: rgba(102, 126, 234, .6);
}

.music-control-btn svg {
    width: 16px;
    height: 16px;
    display: block;
}

/* 音量控制抽屉 */
.music-volume-wrapper {
    position: relative;
    display: grid;
    place-items: center;
}

.volume-drawer {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 8px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: grid;
    place-items: center;
    gap: 12px;
    box-shadow: var(--glass-shadow);
    z-index: 100;
    transform-origin: bottom;
}

.slide-up-enter-active, .slide-up-leave-active {
    transition: all .3s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-up-enter-from {
    opacity: 0;
    transform: scaleY(0.8) translateY(10px);
}

.slide-up-leave-to {
    opacity: 0;
    transform: scaleY(0.8) translateY(10px);
}

.volume-drawer::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 14px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid var(--glass-border);
}

.volume-drawer::before {
    content: '';
    position: absolute;
    top: 100%;
    right: 15px;
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 7px solid var(--glass-bg);
    z-index: 1;
}

.volume-slider.vertical {
    width: 4px;
    height: 120px;
    background: rgba(255, 255, 255, .1);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    writing-mode: bt-lr; /* IE */
    -webkit-appearance: slider-vertical; /* WebKit */
    transition: background .2s ease;
}

.volume-slider.vertical::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--gradient-purple);
    border-radius: 50%;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
    will-change: transform;
    margin-left: -5px;
}

.volume-slider.vertical::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 8px rgba(102, 126, 234, .5);
}

.volume-slider.vertical::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--gradient-purple);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: transform .2s ease, box-shadow .2s ease;
    will-change: transform;
}

.volume-slider.vertical::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 8px rgba(102, 126, 234, .5);
}

.volume-value {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    text-align: center;
}

/* 响应式 - 使用CSS容器查询代替媒体查询 */
@media (max-width: 768px) {
    .music-controls-header {
        padding: 16px 16px 12px;
    }
    
    .music-title-section {
        padding-right: 40px;
    }
    
    .music-folder-btn {
        right: 16px;
    }
    
    .music-control-bar {
        padding: 12px 16px;
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .music-play-controls {
        order: -1;
        grid-column: 1;
    }
    
    .music-volume-control {
        justify-self: end;
    }
    
    .volume-slider {
        --slider-width: 60px;
    }
}

/* 歌曲夹面板 - 向内展开 */
/* 歌曲夹面板 - 全屏覆盖 */
.music-folder-panel {
    position: absolute;
    top: -28px;
    left: -28px;
    right: -28px;
    bottom: -28px;
    width: calc(100% + 56px);
    height: calc(100% + 56px);
    background: rgba(20, 20, 35, 0.98);
    backdrop-filter: blur(20px);
    z-index: 1000;
    overflow: hidden;
    border-radius: var(--radius-xl);
    display: flex;
    flex-direction: column;
}

/* 音乐主内容区域 */
.music-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: all 0.3s ease;
}

.folder-panel-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    height: 100%;
    min-height: 120px;
}

.folder-tabs {
    display: flex;
    flex-direction: column;
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.folder-tab {
    padding: 10px 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    border-right: 2px solid transparent;
    text-align: left;
}

.folder-tab:last-child {
    border-bottom: none;
}

.folder-tab.active {
    color: white;
    background: rgba(102, 126, 234, 0.1);
    border-bottom-color: #667eea;
}

.close-panel-btn {
    width: 100%;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.close-panel-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.close-panel-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}

.close-panel-btn svg {
    width: 18px;
    height: 18px;
}

.folder-content {
    padding: 12px;
    height: calc(100% - 80px);
    overflow-y: auto;
}

.tab-content h4 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 500;
}

.song-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.song-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.song-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(102, 126, 234, 0.2);
}

.song-item.current {
    background: rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.4);
}

.song-item.played {
    opacity: 0.8;
}

.song-info {
    flex: 1;
    min-width: 0;
}

.song-name {
    font-size: 14px;
    color: white;
    font-weight: 500;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.song-artist {
    font-size: 12px;
    color: var(--text-tertiary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.song-duration {
    font-size: 12px;
    color: var(--text-tertiary);
    font-family: 'Courier New', monospace;
}

.song-action-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(102, 126, 234, 0.2);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: white;
    opacity: 0;
}

.song-item:hover .song-action-btn {
    opacity: 1;
}

.song-action-btn:hover {
    background: rgba(102, 126, 234, 0.4);
    transform: scale(1.1);
}

.song-action-btn svg {
    width: 14px;
    height: 14px;
}

.song-delete-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 100, 100, 0.1);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    opacity: 0;
    color: rgba(255, 100, 100, 0.7);
    flex-shrink: 0;
}

.song-item:hover .song-delete-btn {
    opacity: 1;
}

.song-delete-btn:hover {
    background: rgba(255, 100, 100, 0.3);
    color: #ff6b6b;
    transform: scale(1.1);
}

.song-delete-btn svg {
    width: 14px;
    height: 14px;
}

.empty-list {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-tertiary);
    font-size: 13px;
}

.library-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.library-header .btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* 导入歌曲 */
.import-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.import-form .form-group {
    margin-bottom: 0;
}

.file-input {
    width: 100%;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: white;
    font-size: 13px;
}

.file-input::file-selector-button {
    background: rgba(102, 126, 234, 0.3);
    border: 1px solid rgba(102, 126, 234, 0.5);
    border-radius: 4px;
    color: white;
    padding: 4px 8px;
    cursor: pointer;
    margin-right: 12px;
}

.file-info {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    padding: 8px 12px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 6px;
}

/* ==================== 未读消息组件 ==================== */
.messages-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 150px;
    overflow-y: auto;
}

.message-item {
    display: flex;
    gap: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.message-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.message-item.unread {
    border-left: 3px solid #667eea;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.message-content {
    flex: 1;
    min-width: 0;
}

.message-from {
    font-size: 13px;
    font-weight: 500;
    color: white;
    margin-bottom: 2px;
}

.message-text {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message-time {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.no-messages {
    text-align: center;
    padding: 20px;
    color: var(--text-tertiary);
    font-size: 13px;
}

/* ==================== 便签组件 ==================== */
.notes-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.note-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.note-list-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(102, 126, 234, 0.3);
}

.note-title {
    font-size: 14px;
    color: white;
    font-weight: 500;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 12px;
}

.note-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.note-date {
    font-size: 12px;
    color: var(--text-tertiary);
}

.note-delete-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    opacity: 0;
}

.note-list-item:hover .note-delete-btn {
    opacity: 1;
}

.note-delete-btn:hover {
    color: rgba(255, 100, 100, 0.9);
    background: rgba(255, 100, 100, 0.1);
    border-radius: 4px;
}

.note-delete-btn svg {
    width: 14px;
    height: 14px;
}

.notes-more {
    text-align: center;
    padding: 12px;
    font-size: 12px;
    color: var(--text-tertiary);
}

.no-notes {
    text-align: center;
    padding: 20px;
}

.create-first-note {
    padding: 8px 16px;
    background: rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(102, 126, 234, 0.4);
    border-radius: 8px;
    color: white;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
}

.create-first-note:hover {
    background: rgba(102, 126, 234, 0.4);
}

/* 便签编辑器模态框 */
.note-editor-overlay .modal-content {
    width: 95%;
    max-width: 900px;
    height: 90vh;
    max-height: none;
    display: flex;
    flex-direction: column;
}

.note-editor-overlay .modal-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.note-title-input {
    flex: 1;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 16px;
    font-weight: 500;
    outline: none;
    transition: all 0.3s;
}

.note-title-input:focus {
    border-color: rgba(102, 126, 234, 0.5);
    background: rgba(255, 255, 255, 0.15);
}

.note-title-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.note-editor-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.note-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
}

.toolbar-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.toolbar-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    color: white;
}

.toolbar-btn svg {
    width: 16px;
    height: 16px;
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 4px;
}

.note-editor-area {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    outline: none;
    min-height: 200px;
}

.note-editor-area:empty:before {
    content: attr(placeholder);
    color: var(--text-tertiary);
    font-style: italic;
}

.note-editor-area h1, .note-editor-area h2, .note-editor-area h3 {
    margin: 16px 0 12px;
    font-weight: 600;
}

.note-editor-area h1 {
    font-size: 24px;
}

.note-editor-area h2 {
    font-size: 20px;
}

.note-editor-area h3 {
    font-size: 18px;
}

.note-editor-area ul, .note-editor-area ol {
    margin: 12px 0;
    padding-left: 24px;
}

.note-editor-area li {
    margin: 6px 0;
}

.note-editor-area p {
    margin: 12px 0;
}

.note-editor-area strong, .note-editor-area b {
    font-weight: 600;
}

.note-editor-area em, .note-editor-area i {
    font-style: italic;
}

.note-editor-area u {
    text-decoration: underline;
}

/* ==================== 组件按钮 ==================== */
.widget-add-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(102, 126, 234, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    color: white;
}

.widget-add-btn:hover {
    background: rgba(102, 126, 234, 0.4);
    transform: scale(1.1);
}

.widget-settings-btn {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    color: white;
}

.widget-settings-btn:hover {
    background: rgba(102, 126, 234, 0.3);
    border-color: rgba(102, 126, 234, 0.5);
    transform: rotate(30deg);
}

/* ==================== 右键菜单 ==================== */
.context-menu {
    position: fixed;
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    padding: 6px 0;
    min-width: 180px;
    z-index: 9999;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: background 0.15s;
    font-size: 14px;
}

.menu-item:hover:not(.divider) {
    background: rgba(255, 255, 255, 0.1);
}

.menu-item.divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 6px 0;
    padding: 0;
    cursor: default;
}

/* ==================== 模态框 ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 0;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(12px);
}

.modal-header {
    padding: 20px 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: white;
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 5px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.modal-body {
    padding: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.modal-footer {
    padding: 0 20px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-primary {
    background: rgba(74, 158, 255, 0.8);
    color: white;
}

.btn-primary:hover {
    background: rgba(74, 158, 255, 1);
}

.btn-danger {
    background: rgba(255, 100, 100, 0.8);
    color: white;
}

.btn-danger:hover {
    background: rgba(255, 100, 100, 1);
}

/* 删除确认模态框 */
.delete-confirm-modal {
    max-width: 400px;
}

.delete-confirm-modal .modal-body {
    padding: 20px;
}

.delete-warning {
    color: rgba(255, 100, 100, 0.9);
    font-size: 12px;
}

/* 通知组件 */
.notification {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    color: white;
    z-index: 2000;
    animation: slideUp 0.3s ease;
}

.notification.success {
    background: rgba(76, 175, 80, 0.9);
}

.notification.error {
    background: rgba(244, 67, 54, 0.9);
}

.notification.info {
    background: rgba(33, 150, 243, 0.9);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* fade-slide-up 动画 */
.fade-slide-up-enter-active,
.fade-slide-up-leave-active {
    transition: all 0.3s ease;
}

.fade-slide-up-enter-from,
.fade-slide-up-leave-to {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
}

/* ==================== 滚动条样式 ==================== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ==================== 过渡动画 ==================== */
.fade-enter-active,
.fade-leave-active {
    transition: opacity 0.2s ease;
}

.fade-enter-from,
.fade-leave-to {
    opacity: 0;
}

/* 歌曲夹面板滑动过渡 - 向内滑入 */
.fade-slide-enter-active {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-slide-leave-active {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-slide-enter-from {
    opacity: 0;
    transform: translateY(-10px);
}

.fade-slide-leave-to {
    opacity: 0;
    transform: translateY(-10px);
}

/* ==================== 响应式调整 ==================== */
@media (max-width: 768px) {
    .widget-grid {
        grid-template-columns: 1fr;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .welcome-title {
        font-size: 24px;
    }
    
    .top-bar {
        padding: 0 10px;
        gap: 10px;
    }
    
    .search-container-top {
        max-width: 300px;
    }
    
    .user-name {
        display: none;
    }
    
    /* 音乐控制条响应式调整 */
    .music-control-bar {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .music-play-controls {
        order: -1;
        width: 100%;
        margin-bottom: 12px;
    }

    .volume-slider {
        width: 60px;
    }
}
