/* ============================================================
   四叶草起始页 - 主样式文件
   ============================================================ */

/* ==================== CSS变量 ==================== */
:root {
    /* 浅色模式 */
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.25);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --glass-blur: blur(20px);

    --text-primary: #1a1a2e;
    --text-secondary: rgba(26, 26, 46, 0.7);
    --text-tertiary: rgba(26, 26, 46, 0.5);

    --accent: #4A90D9;
    --accent-hover: #357ABD;
    --accent-light: rgba(74, 144, 217, 0.15);

    --bg-overlay: rgba(0, 0, 0, 0.3);
    --modal-bg: rgba(255, 255, 255, 0.72);
    --input-bg: rgba(255, 255, 255, 0.6);
    --hover-bg: rgba(255, 255, 255, 0.2);

    --danger: #e74c3c;
    --success: #2ecc71;
    --warning: #f39c12;

    --border-radius: 16px;
    --border-radius-sm: 10px;
    --border-radius-lg: 24px;
    --border-radius-xl: 32px;

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    --transition-speed: 0.3s;

    /* 背景默认值 */
    --bg-color: #1a1a2e;
    --bg-gradient: none;
    --bg-image: none;
}

/* 深色模式 */
[data-theme="dark"] {
    --glass-bg: rgba(0, 0, 0, 0.25);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);

    --text-primary: rgba(255, 255, 255, 0.95);
    --text-secondary: rgba(255, 255, 255, 0.65);
    --text-tertiary: rgba(255, 255, 255, 0.4);

    --accent: #6BA3E3;
    --accent-hover: #4A90D9;
    --accent-light: rgba(107, 163, 227, 0.2);

    --bg-overlay: rgba(0, 0, 0, 0.5);
    --modal-bg: rgba(30, 30, 50, 0.82);
    --input-bg: rgba(255, 255, 255, 0.08);
    --hover-bg: rgba(255, 255, 255, 0.05);
}

/* ==================== 全局重置 ==================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: var(--font-family);
    color: var(--text-primary);
    background: var(--bg-color);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background var(--transition-speed) ease, color var(--transition-speed) ease;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}
a:hover { color: var(--accent-hover); }

/* ==================== 背景层 ==================== */
.background-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: var(--bg-color);
    transition: background var(--transition-speed) ease;
}

.background-layer.has-image {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.background-layer.has-gradient {
    background-size: cover;
}

.page-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: var(--bg-overlay);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.page-overlay.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
    pointer-events: auto;
}

/* ==================== 深色模式背景遮罩 ==================== */
.dark-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    pointer-events: none;
}

[data-theme="dark"] .dark-overlay {
    opacity: 1;
    visibility: visible;
}

/* ==================== 容器 ==================== */
.container {
    width: 100%;
    max-width: 1200px;
    height: 100vh;
    padding: 20px 40px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.container.slide-left {
    transform: translateX(-60px) scale(0.95);
    opacity: 0.6;
}

/* ==================== 顶部栏 ==================== */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    margin-bottom: 20px;
}

.top-bar-left {
    display: flex;
    align-items: center;
}

.site-logo {
    font-size: 16px;
    font-weight: 600;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-sm);
    padding: 6px 16px;
    letter-spacing: 0.5px;
}

.top-bar-right {
    display: flex;
    gap: 8px;
}

.top-bar-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed) ease;
}

.top-bar-btn:hover {
    background: var(--hover-bg);
    transform: scale(1.05);
    border-color: var(--accent);
}

.top-bar-btn svg {
    width: 18px;
    height: 18px;
    display: block;
}

.top-bar-btn i,
.top-bar-btn .bi {
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.top-bar-btn #langText {
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==================== 天气小组件 ==================== */
.weather-widget {
    position: relative;
    display: inline-block;
    padding: 6px 0;
    cursor: pointer;
    user-select: none;
    border-radius: var(--border-radius);
    transition: all var(--transition-speed) ease;
}

.weather-widget:hover {
    border-color: var(--accent);
    background: var(--hover-bg);
}

.weather-widget-main {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 16px;
}

.weather-widget-city {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.weather-widget-text {
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
}

.weather-widget-temp {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.weather-widget-icon {
    display: flex;
    align-items: center;
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1;
}

.weather-widget-detail {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 230px;
    padding: 10px 16px;
    background: var(--modal-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    box-shadow: var(--glass-shadow);
    z-index: 1200;
}

.weather-widget.active .weather-widget-detail {
    display: block;
    animation: weatherDetailIn 0.25s ease;
}

@keyframes weatherDetailIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.weather-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 3px 0;
    font-size: 12px;
    white-space: nowrap;
}

.weather-detail-label {
    color: var(--text-tertiary);
}

.weather-detail-value {
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
}

/* 天气加载/失败提示 */
.weather-widget .weather-widget-message {
    padding: 6px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* ==================== 毛玻璃基础类 ==================== */
.glass-effect {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    box-shadow: var(--glass-shadow);
}

/* ==================== 时间区域 ==================== */
.time-section {
    text-align: center;
    margin-bottom: 40px;
    padding-top: 40px;
}

.greeting {
    font-size: 20px;
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 8px;
    letter-spacing: 1px;
    text-shadow:
        0 0 8px rgba(0, 0, 0, 0.8),
        0 0 16px rgba(0, 0, 0, 0.5);
}

.time-display {
    display: inline-block;
    font-size: 80px;
    font-weight: 700;
    letter-spacing: 4px;
    line-height: 1;
    color: #ffffff;
    font-variant-numeric: tabular-nums;
    text-shadow:
        0 0 8px rgba(0, 0, 0, 0.8),
        0 0 16px rgba(0, 0, 0, 0.5);
}

.date-display {
    font-size: 16px;
    color: #ffffff;
    margin-top: 10px;
    letter-spacing: 2px;
    text-shadow:
        0 0 8px rgba(0, 0, 0, 0.8),
        0 0 16px rgba(0, 0, 0, 0.5);
}



/* ==================== 搜索区域 ==================== */
.search-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 50px;
}

.search-box {
    display: flex;
    align-items: center;
    width: 578px;
    max-width: 578px;
    flex-shrink: 0;
    padding: 4px;
    position: relative;
    z-index: 150;
    border-radius: var(--border-radius-lg);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    transition: all var(--transition-speed) ease;
}

.search-box:focus-within {
    border-color: var(--accent);
    box-shadow: 0 8px 32px rgba(74, 144, 217, 0.2), var(--glass-shadow);
    transform: translateY(-1px);
}

/* 启动台按钮（搜索栏右侧） */
.launchpad-open-btn {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    border-radius: var(--border-radius-lg);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed) ease;
}

.launchpad-open-btn:hover {
    background: var(--accent-light);
    border-color: var(--accent);
}

.search-engine-selector {
    position: relative;
    flex-shrink: 0;
}

.engine-current {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 42px;
    padding: 0 14px;
    border: none;
    background: var(--input-bg);
    border-radius: 20px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 14px;
    transition: all var(--transition-speed) ease;
    white-space: nowrap;
}

.engine-current:hover {
    background: var(--hover-bg);
}

.engine-name {
    font-weight: 500;
}

.engine-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 280px;
    background: var(--modal-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    box-shadow: var(--glass-shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.96);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 150;
    overflow: hidden;
}

.engine-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.engine-search-bar {
    padding: 12px;
    border-bottom: 1px solid var(--glass-border);
}

.engine-filter-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-sm);
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
}

.engine-filter-input:focus {
    border-color: var(--accent);
}

.engine-list {
    max-height: 320px;
    overflow-y: auto;
    padding: 4px;
}

.engine-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: background var(--transition-speed) ease;
}

.engine-item:hover {
    background: var(--hover-bg);
}

.engine-item.active {
    background: var(--accent-light);
    color: var(--accent);
}

.engine-item-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}

.engine-dropdown-footer {
    padding: 10px 12px;
    border-top: 1px solid var(--glass-border);
}

.engine-manage-btn {
    width: 100%;
    padding: 8px;
    border: 1px dashed var(--glass-border);
    border-radius: var(--border-radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    transition: all var(--transition-speed) ease;
}

.engine-manage-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    height: 42px;
    padding: 0 14px;
    font-size: 16px;
    background: transparent;
    color: var(--text-primary);
    min-width: 0;
    font-family: var(--font-family);
}

.search-input::placeholder {
    color: var(--text-tertiary);
}

.search-btn {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border: none;
    background: var(--accent);
    color: var(--accent-text, #fff);
    border-radius: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed) ease;
    margin: 2px;
}

.search-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

.search-btn svg {
    width: 20px;
    height: 20px;
}

/* ==================== 网页捷径区域 ==================== */
.shortcuts-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.shortcuts-grid {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.shortcut-item {
    width: 80px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    position: relative;
    border-radius: var(--border-radius);
    padding: 8px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 82px;
}

.shortcut-item:hover .shortcut-icon-wrapper {
    background: var(--accent-light);
    border-color: var(--accent);
}

.shortcut-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-bg);
    flex-shrink: 0;
    transition: background var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

.shortcut-icon-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--border-radius);
}

.shortcut-char {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 600;
    color: white;
    border-radius: 14px;
}

.shortcut-title {
    font-size: 12px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 76px;
    margin-top: 4px;
    text-align: center;
    transition: color var(--transition-speed) ease;
}

.shortcut-item:hover .shortcut-title {
    color: var(--text-primary);
}

.shortcut-actions {
    position: absolute;
    top: -6px;
    right: -6px;
    display: none;
    gap: 2px;
}

.shortcut-item:hover .shortcut-actions {
    display: flex;
}

.shortcut-action-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: var(--modal-bg);
    backdrop-filter: var(--glass-blur);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed) ease;
}

.shortcut-action-btn:hover {
    transform: scale(1.15);
}

.shortcut-action-btn.edit-btn { color: var(--accent); }
.shortcut-action-btn.delete-btn { color: var(--danger); }

/* ==================== 启动台 ==================== */
.launchpad-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(40px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
}

.launchpad-overlay.active {
    opacity: 1;
    visibility: visible;
}

.launchpad-container {
    width: 100%;
    max-width: 1280px;
    padding: 80px 20px 40px;
    transform: scale(0.8);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.launchpad-overlay.active .launchpad-container {
    transform: scale(1);
}

.launchpad-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
    padding: 0 10px;
}

.launchpad-manage-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.1);
    color: white;
    cursor: pointer;
    padding: 0;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition-speed) ease;
}

.launchpad-manage-btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.5);
}

.launchpad-manage-btn i {
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.launchpad-search {
    flex: 1;
    max-width: 400px;
    padding: 12px 20px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--border-radius-lg);
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 16px;
    outline: none;
    transition: border-color var(--transition-speed) ease;
}

.launchpad-search::placeholder { color: rgba(255,255,255,0.5); }
.launchpad-search:focus { border-color: rgba(255,255,255,0.5); }

.launchpad-close {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.1);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    transition: all var(--transition-speed) ease;
}

.launchpad-close:hover {
    background: rgba(255,255,255,0.2);
}

.launchpad-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 96px);
    grid-auto-rows: 96px;
    grid-auto-flow: dense;
    gap: 8px;
    padding: 10px;
    max-height: 70vh;
    overflow-y: auto;
}

.launchpad-item {
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    min-width: 0;
    min-height: 0;
}

/* 内容包裹层：激活背景填满整个网格块，内容（图标+标题）居中；内边距紧凑以放大图标、收紧左右间距 */
.launchpad-item-body {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 2px;
    border-radius: var(--border-radius);
    transition: background 0.2s ease;
    box-sizing: border-box;
    overflow: hidden;
}

.launchpad-item:hover .launchpad-item-body {
    background: rgba(255,255,255,0.1);
}

.launchpad-item.dragging {
    opacity: 0.3;
}

.launchpad-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: white;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    overflow: hidden;
    flex-shrink: 0;
}

.launchpad-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.launchpad-item-title {
    max-width: 44px;
    font-size: 12px;
    line-height: 14px;
    color: rgba(255,255,255,0.85);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============ 启动台项目布局规格（图标形状跟随规格，均居中不拉伸；标题文字统一12px） ============ */
/* 1x1：默认单格，图标正方形 44px */
.launchpad-item.layout-1x1 {
    grid-column: span 1;
    grid-row: span 1;
}

/* 1x2：竖向（宽1格 高2格），grid span 决定尺寸 */
.launchpad-item.layout-1x2 {
    grid-column: span 1;
    grid-row: span 2;
}

.launchpad-item.layout-1x2 .launchpad-item-body {
    gap: 8px;
}

/* 2x1：横向（宽2格 高1格），grid span 决定尺寸 */
.launchpad-item.layout-2x1 {
    grid-column: span 2;
    grid-row: span 1;
}

.launchpad-item.layout-2x1 .launchpad-item-body {
    gap: 8px;
}

/* 2x2：大块（宽2格 高2格），grid span 决定尺寸 */
.launchpad-item.layout-2x2 {
    grid-column: span 2;
    grid-row: span 2;
}

.launchpad-item.layout-2x2 .launchpad-item-body {
    gap: 8px;
}

/* 规格名称宽度（标题文字统一12px，与1x1一致；左右间距由 body padding 控制，标题不再额外 margin） */
.launchpad-item.layout-1x1 .launchpad-item-title,
.launchpad-item.layout-1x2 .launchpad-item-title,
.launchpad-item.layout-2x1 .launchpad-item-title,
.launchpad-item.layout-2x2 .launchpad-item-title {
    font-size: 12px;
}

/* 窄规格(1x1/1x2)标题限约5个汉字/9个英文的宽度（12px字号下约62px），超出省略 */
.launchpad-item.layout-1x1 .launchpad-item-title,
.launchpad-item.layout-1x2 .launchpad-item-title {
    max-width: 62px;
}

/* 宽规格(2x1/2x2)标题不限字，按卡片宽度显示 */
.launchpad-item.layout-2x1 .launchpad-item-title,
.launchpad-item.layout-2x2 .launchpad-item-title {
    max-width: 176px;
}

/* 1x1 正方形图标（70px，左右间距约13px） */
.launchpad-item.layout-1x1 .launchpad-icon {
    width: 70px;
    height: 70px;
    border-radius: 16px;
    font-size: 26px;
    flex-shrink: 0;
}

/* 1x2 竖长方形图标：宽=1x1宽(70) 高=2x2高(170) */
.launchpad-item.layout-1x2 .launchpad-icon {
    width: 70px;
    height: 170px;
    border-radius: 18px;
    font-size: 36px;
    flex-shrink: 0;
}

/* 2x1 横长方形图标：宽=2x2宽(170) 高=1x1高(70) */
.launchpad-item.layout-2x1 .launchpad-icon {
    width: 170px;
    height: 70px;
    border-radius: 18px;
    font-size: 36px;
    flex-shrink: 0;
}

/* 2x2 正方形大图标（170px，左右间距约15px） */
.launchpad-item.layout-2x2 .launchpad-icon {
    width: 170px;
    height: 170px;
    border-radius: 24px;
    font-size: 52px;
}

/* 文件夹卡片：圆角矩形图标（9 格预览）在上，名称显示在图标框下方 */
.launchpad-item.folder-item .launchpad-item-body {
    padding: 8px;
    gap: 8px;
}

/* 圆角矩形图标框：包裹前 9 个项目图标 */
.folder-preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    width: 50px;
    aspect-ratio: 1 / 1;
    padding: 3px;
    box-sizing: border-box;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

[data-theme="dark"] .folder-preview {
    border-color: rgba(0,0,0,0.55);
    background: rgba(0,0,0,0.25);
}

.folder-preview-cell {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 7px;
    font-weight: 600;
    color: white;
    overflow: hidden;
    background: var(--accent);
}

.folder-preview-cell.empty {
    background: rgba(255,255,255,0.08);
}

/* 拖拽悬停到文件夹上：高亮可放入 */
.launchpad-item.drag-over {
    background: rgba(255,255,255,0.18);
    border: 1px dashed var(--accent);
}

/* 文件夹弹窗：名称外部居中 + 面板 + 右侧关闭按钮 */
.launchpad-folder-outer {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.launchpad-folder-name {
    display: block;
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 14px;
    cursor: pointer;
    max-width: 80vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
    text-align: center;
    line-height: 1.4;
}

.launchpad-folder-name:hover {
    color: rgba(255,255,255,0.85);
}

.launchpad-folder-name input {
    font-size: 18px;
    font-weight: 600;
    font-family: var(--font-family);
    color: var(--text-primary);
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-sm);
    padding: 6px 12px;
    outline: none;
    width: 260px;
    max-width: 70vw;
    text-align: center;
}

.launchpad-folder-panel {
    width: min(520px, 88vw);
    padding: 12px;
    border-radius: var(--border-radius-lg);
    /* 浅色模式下背景更不透明，保证黑色文字清晰 */
    background: rgba(255, 255, 255, 0.88);
}

[data-theme="dark"] .launchpad-folder-panel {
    background: var(--glass-bg);
}

.launchpad-folder-list {
    max-height: 62vh;
    overflow-y: auto;
}

/* 文件夹弹窗内容：3 列基准自适应网格（像手机桌面文件夹） */
.launchpad-folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 12px;
    padding: 8px 0;
}

.launchpad-folder-cell {
    position: relative;
    text-align: center;
    cursor: pointer;
    padding: 8px 4px;
    border-radius: var(--border-radius);
    transition: background var(--transition-speed) ease;
}

.launchpad-folder-cell:hover {
    background: var(--hover-bg);
}

.launchpad-folder-cell-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 6px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.launchpad-folder-cell-title {
    font-size: 12px;
    max-width: 64px;
    margin: 0 auto;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 启动台组件添加：分类面板 */
.launchpad-add-panel {
    display: none;
    margin-top: 4px;
}

.launchpad-add-panel.active {
    display: block;
    animation: weatherDetailIn 0.25s ease;
}

/* 预设捷径网格（添加预设捷径面板） */
.launchpad-preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 12px;
    padding: 8px 0;
    max-height: 320px;
    overflow-y: auto;
}

.launchpad-preset-cell {
    position: relative;
    text-align: center;
    cursor: pointer;
    padding: 10px 4px;
    border-radius: var(--border-radius);
    transition: all var(--transition-speed) ease;
}

.launchpad-preset-cell:hover {
    background: var(--hover-bg);
}

.launchpad-preset-cell-icon {
    width: 46px;
    height: 46px;
    margin: 0 auto 6px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 600;
    color: white;
    overflow: hidden;
    background: var(--accent);
}

.launchpad-preset-cell-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.launchpad-preset-cell-title {
    font-size: 12px;
    max-width: 64px;
    margin: 0 auto;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.launchpad-preset-cell .launchpad-preset-add {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: var(--success);
    color: white;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 2;
}

.launchpad-preset-cell:hover .launchpad-preset-add {
    display: flex;
}

.launchpad-add-form {
    margin-top: 16px;
}

.launchpad-widget-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 8px;
}

.launchpad-widget-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 18px 10px;
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    background: var(--glass-bg);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 13px;
    transition: all var(--transition-speed) ease;
}

.launchpad-widget-option:hover {
    background: var(--hover-bg);
    border-color: var(--accent);
}

.launchpad-widget-option.active {
    border-color: var(--accent);
    background: var(--accent-light);
    color: var(--accent);
}

.launchpad-widget-option i {
    font-size: 22px;
}

/* 启动台组件实时卡片 */
.launchpad-item.widget-item {
    padding: 6px;
}

/* 启动台网格空位（平时不可见，拖动时显示虚线框指示空位） */
.launchpad-empty-cell {
    width: 96px;
    aspect-ratio: 1 / 1;
    visibility: hidden;
}

.launchpad-empty-cell.drag-visible {
    visibility: visible;
    border: 1px dashed rgba(255,255,255,0.3);
    border-radius: var(--border-radius);
}

/* 拖拽跟随克隆 */
.launchpad-drag-clone {
    position: fixed;
    z-index: 4000;
    pointer-events: none;
    opacity: 0.85;
    width: 96px;
    aspect-ratio: 1 / 1;
    border-radius: var(--border-radius);
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    transform: scale(0.92);
}

.launchpad-drag-clone .launchpad-item-body {
    padding: 8px;
    gap: 8px;
}

.launchpad-widget-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
}

.launchpad-widget-body i {
    font-size: 22px;
    color: rgba(255,255,255,0.95);
}

.widget-clock-time {
    font-size: 20px;
    font-weight: 700;
    color: rgba(255,255,255,0.95);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.widget-clock-date,
.widget-calendar-date {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
}

.widget-calendar-day {
    font-size: 22px;
    font-weight: 700;
    color: rgba(255,255,255,0.95);
    line-height: 1.1;
}

.widget-weather-temp {
    font-size: 18px;
    font-weight: 700;
    color: rgba(255,255,255,0.95);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.widget-weather-city {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
}

.widget-weather-text {
    font-size: 12px;
    color: rgba(255,255,255,0.8);
}

/* 小组件配置弹窗 */
#widgetConfigModal .modal-body {
    padding: 24px;
}

#widgetConfigModal .modal-body .form-group {
    margin-bottom: 18px;
}

/* 小组件按规格递进：规格越大，主内容字号越大 */
.launchpad-item.widget-item.layout-1x2 .widget-clock-time,
.launchpad-item.widget-item.layout-1x2 .widget-calendar-day,
.launchpad-item.widget-item.layout-1x2 .widget-weather-temp {
    font-size: 34px;
}

.launchpad-item.widget-item.layout-2x1 .widget-clock-time,
.launchpad-item.widget-item.layout-2x1 .widget-calendar-day,
.launchpad-item.widget-item.layout-2x1 .widget-weather-temp {
    font-size: 30px;
}

.launchpad-item.widget-item.layout-2x2 .widget-clock-time,
.launchpad-item.widget-item.layout-2x2 .widget-calendar-day,
.launchpad-item.widget-item.layout-2x2 .widget-weather-temp {
    font-size: 44px;
}

/* 时钟 2x2 星期 */
.widget-clock-weekday,
.widget-calendar-weekday,
.widget-calendar-lunar {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
}

/* 天气 2x2 详情行 */
.widget-weather-detail-row {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-size: 11px;
    color: rgba(255,255,255,0.7);
}

.widget-weather-detail-label { color: rgba(255,255,255,0.5); }
.widget-weather-detail-value { color: rgba(255,255,255,0.9); font-variant-numeric: tabular-nums; }

/* 倒数日 */
.widget-countdown-title {
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.widget-countdown-number {
    font-size: 28px;
    font-weight: 700;
    color: rgba(255,255,255,0.95);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.widget-countdown-date {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
}

.launchpad-item.widget-item.layout-1x2 .widget-countdown-number { font-size: 42px; }
.launchpad-item.widget-item.layout-2x1 .widget-countdown-number { font-size: 36px; }
.launchpad-item.widget-item.layout-2x2 .widget-countdown-number { font-size: 60px; }

/* 备忘录 */
.widget-memo-title {
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.widget-memo-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 100%;
    overflow: hidden;
    align-items: flex-start;
}

.widget-memo-item {
    font-size: 11px;
    color: rgba(255,255,255,0.85);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}

.widget-memo-more {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
}

/* 右键菜单 */
.context-menu {
    position: fixed;
    z-index: 3000;
    min-width: 140px;
    padding: 6px;
    margin: 0;
    background: var(--modal-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    box-shadow: var(--glass-shadow);
    display: none;
    opacity: 0;
    transform: scale(0.95);
    transform-origin: top left;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.context-menu.active {
    display: block;
    opacity: 1;
    transform: scale(1);
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background var(--transition-speed) ease;
}

.context-menu-item:hover {
    background: var(--hover-bg);
}

.context-menu-item i {
    font-size: 14px;
    line-height: 1;
}

.context-menu-item.danger {
    color: var(--danger);
}

.context-menu-item.danger:hover {
    background: rgba(231, 76, 60, 0.12);
}

/* 右键菜单：侧拉子菜单（修改布局规格） */
.context-menu-item.has-submenu {
    position: relative;
    justify-content: space-between;
}

.context-menu-item.has-submenu .submenu-arrow {
    font-size: 12px;
    margin-left: 16px;
    opacity: 0.6;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.context-submenu {
    position: absolute;
    left: 100%;
    top: -6px;
    min-width: 130px;
    padding: 6px;
    background: var(--modal-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    box-shadow: var(--glass-shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-6px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
    z-index: 3010;
}

.context-menu-item.has-submenu:hover .context-submenu,
.context-menu-item.has-submenu:focus-within .context-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.context-submenu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background var(--transition-speed) ease;
    white-space: nowrap;
}

.context-submenu-item:hover {
    background: var(--hover-bg);
}

.context-submenu-item.active {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 600;
}

.context-submenu-item.active i {
    color: var(--accent);
}

/* ==================== 全局确认弹窗 ==================== */
.confirm-modal-text {
    font-size: 14px;
    color: var(--text-primary);
    text-align: center;
    padding: 8px 0 16px;
    line-height: 1.6;
    word-break: break-word;
}

#confirmModal .modal-footer {
    justify-content: center;
    gap: 12px;
}

/* ==================== 页脚 ==================== */
.footer {
    text-align: center;
    padding: 16px 24px;
    margin-top: auto;
}

.footer-text {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    transition: all var(--transition-speed) ease;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

.footer-link:hover {
    color: var(--accent);
}

.footer-separator {
    color: var(--text-tertiary);
    opacity: 0.5;
}

/* ==================== 弹窗 ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    width: 90%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    background: var(--modal-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

/* ==================== 设置面板滚动条 ==================== */
#settingsOverlay .modal-content {
    overflow: hidden;
}

#settingsOverlay .modal-body {
    overflow-y: auto;
    max-height: calc(85vh - 64px);
    scrollbar-gutter: stable;
    padding: 24px;
}

#settingsOverlay .modal-body::-webkit-scrollbar {
    width: 6px;
}

#settingsOverlay .modal-body::-webkit-scrollbar-track {
    background: transparent;
}

#settingsOverlay .modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

#settingsOverlay .modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ==================== 账户面板滚动条（标题栏固定） ==================== */
#accountOverlay .modal-content {
    overflow: hidden;
}

#accountOverlay .modal-body {
    overflow-y: auto;
    max-height: calc(85vh - 64px);
    scrollbar-gutter: stable;
    padding: 24px;
}

#accountOverlay .modal-body::-webkit-scrollbar {
    width: 6px;
}

#accountOverlay .modal-body::-webkit-scrollbar-track {
    background: transparent;
}

#accountOverlay .modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

#accountOverlay .modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

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

.modal-title {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--hover-bg);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed) ease;
}

.modal-close:hover {
    background: var(--danger);
    color: white;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--glass-border);
    justify-content: flex-end;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-sm);
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    font-family: var(--font-family);
    transition: all var(--transition-speed) ease;
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.form-input-color {
    width: 48px;
    height: 48px;
    border: 2px solid var(--glass-border);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    padding: 2px;
    background: none;
}

.form-input-color-large {
    width: 100%;
    height: 56px;
    border: 2px solid var(--glass-border);
    border-radius: var(--border-radius);
    cursor: pointer;
    padding: 4px;
    background: none;
}

.form-input-file {
    width: 100%;
    padding: 10px;
    border: 2px dashed var(--glass-border);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    background: var(--input-bg);
    color: var(--text-secondary);
}

.form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-sm);
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    cursor: pointer;
    font-family: var(--font-family);
    appearance: auto;
    -webkit-appearance: auto;
}

/* 深色模式下拉框选项样式 */
[data-theme="dark"] .form-select {
    background: rgba(35, 35, 55, 0.9);
    color: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 0.12);
}

/* ==================== 自定义下拉框 ==================== */
.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select-wrapper .form-select {
    display: none;
}

.custom-select-trigger {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-sm);
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    font-family: var(--font-family);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    user-select: none;
    transition: border-color var(--transition-speed) ease;
    box-sizing: border-box;
}

.custom-select-trigger:hover {
    border-color: var(--accent);
}

.custom-select-arrow {
    font-size: 12px;
    opacity: 0.6;
    transition: transform 0.25s ease;
    line-height: 1;
}

.custom-select-wrapper.active .custom-select-arrow {
    transform: rotate(180deg);
}

.custom-select-options {
    position: absolute;
    top: calc(100% + 4px);
    left: 4px;
    right: 4px;
    z-index: 100;
    background: var(--modal-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-sm);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    max-height: 220px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(0.96);
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    scrollbar-gutter: stable;
    padding: 4px;
}

.custom-select-wrapper.active .custom-select-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.custom-select-option {
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-family);
    transition: background 0.15s ease;
    margin-bottom: 2px;
}

.custom-select-option:last-child {
    margin-bottom: 0;
}

.custom-select-option:hover {
    background: var(--hover-bg);
}

.custom-select-option.selected {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 600;
}

[data-theme="dark"] .custom-select-trigger {
    background: rgba(35, 35, 55, 0.9);
    color: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .custom-select-options {
    background: rgba(30, 30, 50, 0.95);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .custom-select-option:hover {
    background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .custom-select-option.selected {
    background: rgba(74, 144, 217, 0.25);
    color: #6BA3E3;
}

/* ==================== 图标类型选择 ==================== */
.icon-type-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.icon-type-tab {
    padding: 6px 12px;
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    transition: all var(--transition-speed) ease;
}

.icon-type-tab:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.icon-type-tab.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.icon-type-content {
    display: none;
}

.icon-type-content.active {
    display: block;
}

.icon-preview {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}

.icon-preview-box {
    width: 64px;
    height: 64px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    color: white;
    background: var(--accent);
    overflow: hidden;
}

.icon-preview-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==================== 按钮 ==================== */
.btn {
    padding: 10px 24px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    font-family: var(--font-family);
}

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

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(74, 144, 217, 0.3);
}

.btn-secondary {
    background: var(--hover-bg);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: var(--glass-bg);
}

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

.btn-danger:hover {
    background: #c0392b;
}

.btn-full {
    width: 100%;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

/* ==================== 设置面板 ==================== */
.settings-overlay {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    z-index: 1500;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.settings-overlay.active {
    opacity: 1;
    visibility: visible;
}

.settings-panel {
    position: fixed;
    top: 0;
    right: -440px;
    width: 420px;
    height: 100%;
    z-index: 1501;
    background: var(--modal-bg);
    backdrop-filter: blur(30px);
    border-left: 1px solid var(--glass-border);
    padding: 24px;
    overflow-y: auto;
    scrollbar-gutter: stable;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-overlay.active .settings-panel {
    right: 0;
}

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

.settings-header h2 {
    font-size: 22px;
    font-weight: 700;
}

.settings-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--hover-bg);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed) ease;
}

.settings-close:hover {
    background: var(--danger);
    color: white;
}

.settings-section {
    margin-bottom: 28px;
}

.settings-section h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 14px;
    color: var(--text-primary);
}

/* Bing壁纸预览 */
.bing-preview {
    margin-top: 10px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

.bing-preview img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    max-height: 180px;
}

/* 主题选项 */
.theme-options {
    display: flex;
    gap: 12px;
}

.theme-option {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--glass-border);
    border-radius: var(--border-radius);
    background: transparent;
    cursor: pointer;
    text-align: center;
    transition: all var(--transition-speed) ease;
}

.theme-option:hover {
    border-color: var(--accent);
}

.theme-option.active {
    border-color: var(--accent);
    background: var(--accent-light);
}

.theme-option-preview {
    width: 100%;
    height: 48px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 8px;
    overflow: hidden;
}

.theme-auto {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
}
.theme-auto::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, transparent 50%);
}

.theme-light {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.theme-dark {
    background: linear-gradient(135deg, #2c3e50 0%, #1a1a2e 100%);
}

.theme-option span {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* 背景类型选项 */
.bg-type-options {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.bg-type-option {
    flex: 1;
    padding: 8px;
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    transition: all var(--transition-speed) ease;
}

.bg-type-option:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.bg-type-option.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.bg-setting-content {
    display: none;
}

.bg-setting-content.active {
    display: block;
}

.gradient-inputs {
    display: flex;
    gap: 12px;
}

.gradient-inputs > div {
    flex: 1;
}

.gradient-inputs label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

/* 开关 */
.toggle-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    cursor: pointer;
}

.toggle-item span:first-child {
    font-size: 14px;
    color: var(--text-primary);
}

.toggle-desc {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.toggle-input {
    display: none;
}

.toggle-slider {
    display: inline-block;
    width: 44px;
    height: 24px;
    background: var(--glass-border);
    border-radius: 12px;
    position: relative;
    transition: all var(--transition-speed) ease;
    flex-shrink: 0;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: all var(--transition-speed) ease;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.toggle-input:checked + .toggle-slider {
    background: var(--accent);
}

.toggle-input:checked + .toggle-slider::after {
    left: 22px;
}

/* ==================== 注册提醒 ==================== */
.register-reminder {
    padding: 14px;
    border-radius: var(--border-radius-sm);
    background: var(--accent-light);
    border: 1px solid rgba(74, 144, 217, 0.2);
}

.register-reminder p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.register-reminder.success {
    background: rgba(46, 204, 113, 0.15);
    border-color: rgba(46, 204, 113, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.register-reminder.success p {
    color: #1a7a3a;
    flex: 1;
}

/* ==================== 用户信息卡片 ==================== */
.user-info-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 0;
}

.user-info-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-info-details {
    flex: 1;
    min-width: 0;
}

.user-info-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.user-info-phone {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.user-info-gender {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

/* ==================== 认证表单 ==================== */
.auth-modal {
    max-width: 420px;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-switch-text {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-switch-text a {
    color: var(--accent);
    font-weight: 500;
}

/* ==================== 协议勾选 ==================== */
.agreement-checkbox {
    margin: 4px 0 14px;
}

.agreement-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    cursor: pointer;
    user-select: none;
}

.agreement-checkbox-input {
    margin-top: 3px;
    accent-color: var(--accent);
    flex-shrink: 0;
    cursor: pointer;
}

.agreement-link {
    color: var(--accent);
    font-weight: 500;
    margin: 0 2px;
}

.agreement-link:hover {
    text-decoration: underline;
}

/* ==================== 协议内容（富文本排版） ==================== */
.agreement-content {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-primary);
    word-break: break-word;
    max-height: 55vh;
    overflow-y: auto;
    padding-right: 6px;
}

.agreement-content h1,
.agreement-content h2,
.agreement-content h3,
.agreement-content h4 {
    margin: 18px 0 10px;
    font-weight: 600;
    line-height: 1.4;
}

.agreement-content h1 { font-size: 22px; }
.agreement-content h2 { font-size: 19px; }
.agreement-content h3 { font-size: 17px; }
.agreement-content h4 { font-size: 15px; }

.agreement-content p {
    margin: 8px 0;
}

.agreement-content ul,
.agreement-content ol {
    margin: 8px 0;
    padding-left: 24px;
}

.agreement-content li {
    margin: 4px 0;
}

.agreement-content strong,
.agreement-content b {
    font-weight: 600;
}

.agreement-content a {
    color: var(--accent);
}

.agreement-content blockquote {
    margin: 10px 0;
    padding: 8px 16px;
    border-left: 3px solid var(--accent);
    background: var(--accent-light);
    color: var(--text-secondary);
}

.agreement-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

.agreement-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 13px;
}

.agreement-content table th,
.agreement-content table td {
    border: 1px solid var(--glass-border);
    padding: 8px 12px;
    text-align: left;
}

.agreement-content table th {
    background: var(--accent-light);
    font-weight: 600;
}

.agreement-content code {
    background: var(--accent-light);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'Consolas', 'Courier New', monospace;
}

.sms-input-group {
    display: flex;
    gap: 8px;
}

.sms-input-group .form-input {
    flex: 1;
}

.captcha-img {
    height: 40px;
    width: 120px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid var(--glass-border);
    flex-shrink: 0;
    display: block;
}

.sms-input-group .btn {
    flex-shrink: 0;
    white-space: nowrap;
}

.gender-options {
    display: flex;
    gap: 12px;
}

.gender-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 14px;
    transition: all var(--transition-speed) ease;
}

.gender-option:hover {
    border-color: var(--accent);
}

.gender-option input:checked + span {
    color: var(--accent);
}

/* ==================== Toast消息 ==================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    color: white;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    animation: toastSlideIn 0.3s ease;
    max-width: 320px;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--accent); }
.toast.warning { background: var(--warning); }

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ==================== 滚动条美化 ==================== */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

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

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

/* 浅色模式滚动条（深色半透明） */
[data-theme="light"] ::-webkit-scrollbar-thumb,
:root:not([data-theme="dark"]) ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover,
:root:not([data-theme="dark"]) ::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    .container {
        padding: 16px 20px;
    }

    .time-display {
        font-size: 48px;
    }

    .greeting {
        font-size: 16px;
    }

    .search-box {
        max-width: none;
        flex-shrink: 1;
    }

    .settings-panel {
        width: 100%;
        right: -100%;
    }

    .shortcut-item {
        width: 68px;
    }

    .shortcut-icon-wrapper {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    .launchpad-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 12px;
    }

    .launchpad-icon {
        width: 40px;
        height: 40px;
        font-size: 17px;
    }

    .modal-content {
        width: 95%;
        max-width: 400px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 12px 12px;
    }

    .time-display {
        font-size: 36px;
    }

    .top-bar {
        margin-bottom: 10px;
    }

    .site-logo {
        font-size: 13px;
        padding: 4px 12px;
    }

    /* 天气小组件移动端适配 */
    .weather-widget-main {
        gap: 6px;
        padding: 5px 10px;
    }

    .weather-widget-city {
        font-size: 12px;
    }

    .weather-widget-text {
        font-size: 12px;
    }

    .weather-widget-temp {
        font-size: 13px;
    }

    .weather-widget-detail {
        min-width: 190px;
        padding: 8px 12px;
    }

    .shortcuts-grid {
        gap: 10px;
    }

    .shortcut-item {
        width: 56px;
        padding: 4px 2px;
    }

    .shortcut-icon-wrapper {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .shortcut-title {
        font-size: 10px;
        max-width: 52px;
    }

    .footer-text {
        font-size: 11px;
    }
}

/* ==================== 设置Tab导航 ==================== */
.settings-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    background: var(--glass-bg);
    padding: 4px;
    border-radius: var(--border-radius);
    border: 1px solid var(--glass-border);
}

.settings-tab {
    flex: 1;
    padding: 10px 8px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 12px;
    transition: all var(--transition-speed) ease;
}

.settings-tab:hover {
    color: var(--text-primary);
    background: var(--hover-bg);
}

.settings-tab.active {
    background: var(--accent);
    color: var(--accent-text, #fff);
    font-weight: 600;
}

.settings-tab-content {
    display: none;
}

.settings-tab-content.active {
    display: block;
}

/* ==================== 分段控制 ==================== */
.segmented-control {
    display: flex;
    background: var(--input-bg);
    border-radius: var(--border-radius-sm);
    padding: 3px;
    border: 1px solid var(--glass-border);
}

.segmented-option {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all var(--transition-speed) ease;
}

.segmented-option:hover {
    color: var(--text-primary);
}

.segmented-option.active {
    background: var(--accent);
    color: var(--accent-text, #fff);
    font-weight: 600;
}

/* ==================== 字体大小滑动器 ==================== */
.font-size-slider {
    padding: 4px 0;
}

.slider-input {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--input-bg);
    border-radius: 3px;
    outline: none;
    border: 1px solid var(--glass-border);
}

.slider-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.slider-input::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: 2px solid white;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-tertiary);
}

/* ==================== 主题色选择器 ==================== */
.accent-color-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.accent-color-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.accent-color-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.accent-color-btn.active {
    border-color: var(--text-primary);
    transform: scale(1.15);
    box-shadow: 0 0 0 2px white, 0 4px 12px rgba(0,0,0,0.2);
}

/* ==================== Bing画质选项 ==================== */
.bing-quality-options {
    margin-top: 10px;
    display: flex;
    gap: 12px;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}

.radio-item input[type="radio"] {
    accent-color: var(--accent);
}

.bing-date-select {
    margin-top: 8px;
}

.bing-date-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.bing-date-btn {
    padding: 6px 12px;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.bing-date-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.bing-date-btn.active {
    background: var(--accent);
    color: var(--accent-text, #fff);
    border-color: var(--accent);
}

/* ==================== 搜索历史 ==================== */
.search-history-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--modal-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    box-shadow: var(--glass-shadow);
    z-index: 150;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.search-history-dropdown.active {
    display: block;
}

.search-history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 14px;
    transition: background var(--transition-speed) ease;
}

.search-history-item:hover {
    background: var(--hover-bg);
}

.search-history-item .history-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-history-item .history-delete {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.search-history-item:hover .history-delete:hover {
    background: var(--hover-bg);
    color: var(--danger);
}

.search-history-clear {
    padding: 8px 14px;
    text-align: center;
    border-top: 1px solid var(--glass-border);
    font-size: 13px;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: color var(--transition-speed) ease;
}

.search-history-clear:hover {
    color: var(--danger);
}

/* ==================== 按钮辅助类 ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

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

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

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

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

.btn-danger:hover {
    background: #c0392b;
}

.btn-full {
    width: 100%;
}

/* ==================== 时间闪烁分隔符 ==================== */
/* 闪烁模式：瞬间切换 */
@keyframes blink-separator {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* 渐显模式：丝滑淡入淡出 */
@keyframes fade-separator {
    0% { opacity: 1; }
    50% { opacity: 0; }
    100% { opacity: 1; }
}

.time-display .separator {
    display: inline-block;
    vertical-align: middle;
    transform: translateY(-14px);
}

.time-display.blink .separator {
    animation: blink-separator 1s step-end infinite;
}

.time-display.fade .separator {
    animation: fade-separator 1s ease-in-out infinite;
}

/* ==================== AM/PM 样式 ==================== */
.ampm-same {
    font-size: inherit;
    font-weight: inherit;
    opacity: 1;
    vertical-align: baseline;
}

.ampm-small-bottom {
    font-size: 0.4em;
    font-weight: 500;
    opacity: 1;
    vertical-align: bottom;
    line-height: 1;
    display: inline-block;
    margin-bottom: 0.3em;
}

.ampm-small-middle {
    font-size: 0.4em;
    font-weight: 500;
    opacity: 1;
    vertical-align: middle;
    display: inline-block;
}

/* ==================== 组件市场 ==================== */
.marketplace-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2500;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.marketplace-overlay.active {
    opacity: 1;
    visibility: visible;
}

.marketplace-window {
    width: 1250px;
    max-width: 95vw;
    height: 750px;
    max-height: 88vh;
    border-radius: 20px;
    background: var(--modal-bg);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid var(--glass-border);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.92) translateY(20px);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.marketplace-overlay.active .marketplace-window {
    transform: scale(1) translateY(0);
}

/* 组件市场标题栏 */
.marketplace-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 28px;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.marketplace-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.marketplace-close {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed) ease;
    flex-shrink: 0;
}

.marketplace-close:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
}

/* 组件市场主体 */
.marketplace-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* 左侧边栏 */
.marketplace-sidebar {
    width: 180px;
    flex-shrink: 0;
    padding: 16px 10px;
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .marketplace-sidebar {
    background: rgba(255, 255, 255, 0.02);
}

.marketplace-sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-family);
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}

.marketplace-sidebar-item:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.marketplace-sidebar-item.active {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 600;
}

.marketplace-sidebar-item i {
    font-size: 18px;
    flex-shrink: 0;
    line-height: 1;
    display: flex;
    align-items: center;
}

/* 右侧内容区 */
.marketplace-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* 内容面板 */
.marketplace-panel {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.marketplace-panel.active {
    display: flex;
    animation: marketplacePanelIn 0.25s ease;
}

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

/* 面板顶部区域（分类按钮 + 搜索栏） */
.marketplace-panel-top {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 24px 12px;
    flex-shrink: 0;
}

.marketplace-category-scroll {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    min-width: 0;
}

/* 分类药丸按钮组（默认隐藏溢出，展开时换行显示；top padding 为气泡留出显示空间） */
.marketplace-category-pills {
    flex: 1;
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    white-space: nowrap;
    overflow: hidden;
    min-width: 0;
    padding: 10px 0 4px;
}

.marketplace-category-pills.wrap {
    flex-wrap: wrap;
    overflow: visible;
}

.marketplace-view-all {
    flex-shrink: 0;
}

.marketplace-pill {
    position: relative;
    padding: 7px 16px;
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    background: var(--glass-bg);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-family);
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.marketplace-pill:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

.marketplace-pill.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    font-weight: 600;
}

/* 分类按钮右上角气泡 */
.marketplace-pill-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 9px;
    font-weight: 700;
    color: #fff;
    line-height: 1.4;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.marketplace-pill-badge[data-color="red"] { background: #e74c3c; }
.marketplace-pill-badge[data-color="green"] { background: #2ecc71; }
.marketplace-pill-badge[data-color="orange"] { background: #f39c12; }
.marketplace-pill-badge[data-color="blue"] { background: #3498db; }
.marketplace-pill-badge[data-color="purple"] { background: #9b59b6; }
.marketplace-pill-badge[data-color="yellow"] { background: #f1c40f; }
.marketplace-pill-badge[data-color="black"] { background: #2c3e50; }
.marketplace-pill-badge[data-color="pink"] { background: #e91e63; }

/* 动态渐变气泡（流动渐变动画） */
.marketplace-pill-badge[data-style="dynamic"][data-color="red"] {
    background: linear-gradient(135deg, #ff4d4d, #c0392b);
    background-size: 200% 200%;
    animation: marketplaceBadgeFlow 2s linear infinite;
}
.marketplace-pill-badge[data-style="dynamic"][data-color="green"] {
    background: linear-gradient(135deg, #55efc4, #27ae60);
    background-size: 200% 200%;
    animation: marketplaceBadgeFlow 2s linear infinite;
}
.marketplace-pill-badge[data-style="dynamic"][data-color="orange"] {
    background: linear-gradient(135deg, #ffb347, #e67e22);
    background-size: 200% 200%;
    animation: marketplaceBadgeFlow 2s linear infinite;
}
.marketplace-pill-badge[data-style="dynamic"][data-color="blue"] {
    background: linear-gradient(135deg, #74b9ff, #2980b9);
    background-size: 200% 200%;
    animation: marketplaceBadgeFlow 2s linear infinite;
}
.marketplace-pill-badge[data-style="dynamic"][data-color="purple"] {
    background: linear-gradient(135deg, #a29bfe, #8e44ad);
    background-size: 200% 200%;
    animation: marketplaceBadgeFlow 2s linear infinite;
}
.marketplace-pill-badge[data-style="dynamic"][data-color="yellow"] {
    background: linear-gradient(135deg, #ffeaa7, #f39c12);
    background-size: 200% 200%;
    animation: marketplaceBadgeFlow 2s linear infinite;
}
.marketplace-pill-badge[data-style="dynamic"][data-color="black"] {
    background: linear-gradient(135deg, #636e72, #2d3436);
    background-size: 200% 200%;
    animation: marketplaceBadgeFlow 2s linear infinite;
}
.marketplace-pill-badge[data-style="dynamic"][data-color="pink"] {
    background: linear-gradient(135deg, #fd79a8, #d63031);
    background-size: 200% 200%;
    animation: marketplaceBadgeFlow 2s linear infinite;
}

@keyframes marketplaceBadgeFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 搜索栏 */
.marketplace-search-wrap {
    position: relative;
    flex-shrink: 0;
    width: 200px;
}

.marketplace-search-input {
    width: 100%;
    padding: 7px 34px 7px 14px;
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-family);
    outline: none;
    transition: border-color var(--transition-speed) ease;
}

.marketplace-search-input:focus {
    border-color: var(--accent);
}

.marketplace-search-input::placeholder {
    color: var(--text-tertiary);
}

.marketplace-search-wrap i {
    position: absolute;
    right: 11px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--text-tertiary);
    line-height: 1;
    pointer-events: none;
}

/* 预设捷径网格 */
.marketplace-preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    padding: 8px 24px 20px;
    overflow-y: auto;
    flex: 1;
    align-content: start;
}

.marketplace-preset-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 8px;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

/* 已添加气泡 */
.marketplace-preset-added {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    background: var(--success);
    color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    z-index: 2;
    pointer-events: none;
}

.marketplace-preset-card.added {
    border-color: var(--success);
    opacity: 0.75;
    cursor: default;
}

.marketplace-preset-card.added:hover {
    border-color: var(--success);
    background: var(--glass-bg);
    transform: none;
    box-shadow: none;
}

.marketplace-preset-card:hover {
    border-color: var(--accent);
    background: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.marketplace-preset-card-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: white;
    overflow: hidden;
    flex-shrink: 0;
}

.marketplace-preset-card-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.marketplace-preset-card-title {
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 500;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

.marketplace-preset-card-badge {
    font-size: 10px;
    color: var(--accent);
    font-weight: 600;
    opacity: 0.8;
}

/* 小组件网格 */
.marketplace-widget-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
    padding: 8px 24px 20px;
    overflow-y: auto;
    flex: 1;
    align-content: start;
}

.marketplace-widget-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 24px 16px;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.marketplace-widget-card:hover {
    border-color: var(--accent);
    background: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.marketplace-widget-card i {
    font-size: 32px;
    color: var(--accent);
    line-height: 1;
}

.marketplace-widget-card-title {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 600;
}

.marketplace-widget-card-desc {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* 小组件功能暂时隐藏：隐藏分类按钮区，网格居中显示提示 */
#marketplacePanelWidgets .marketplace-panel-top {
    display: none;
}

#marketplacePanelWidgets .marketplace-widget-grid {
    display: flex;
    align-items: center;
    justify-content: center;
}

.marketplace-widget-hidden {
    padding: 16px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 14px;
    line-height: 1.6;
}

/* 自定义网址表单 */
.marketplace-custom-form {
    padding: 24px 28px;
    max-width: 480px;
}

.marketplace-custom-form .form-group {
    margin-bottom: 20px;
}

.marketplace-custom-form .btn {
    margin-top: 8px;
}

/* 添加文件夹表单 */
.marketplace-folder-form {
    padding: 24px 28px;
    max-width: 480px;
}

.marketplace-folder-form .form-group {
    margin-bottom: 20px;
}

.marketplace-folder-form .btn {
    margin-top: 8px;
}

/* 空结果提示 */
.marketplace-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-tertiary);
    font-size: 14px;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}