/* ===== CSS 变量 – 日间/夜间 ===== */
:root {
    --bg-body: linear-gradient(135deg, #e8ecf4 0%, #dce3f0 40%, #f0f4fa 100%);
    --orb-1: rgba(99, 142, 255, 0.18);
    --orb-2: rgba(168, 130, 255, 0.14);
    --orb-3: rgba(56, 189, 248, 0.12);
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --card-bg: rgba(255, 255, 255, 0.70);
    --card-border: rgba(255, 255, 255, 0.4);
    --card-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    --input-bg: #ffffff;
    --input-border: #e2e8f0;
    --input-focus-border: #2563eb;
    --btn-primary-bg: #2563eb;
    --btn-primary-hover: #1d4ed8;
    --btn-primary-shadow: rgba(37, 99, 235, 0.25);
    --engine-tab-bg: rgba(255, 255, 255, 0.5);
    --engine-tab-color: #64748b;
    --engine-tab-active-bg: #2563eb;
    --engine-tab-active-color: #ffffff;
    --nav-card-bg: rgba(255, 255, 255, 0.55);
    --nav-card-hover-bg: rgba(255, 255, 255, 0.85);
    --nav-card-border: rgba(255, 255, 255, 0.3);
    --nav-label-color: #334155;
    --footer-color: #94a3b8;
    --toggle-bg: #e2e8f0;
    --toggle-dot: #ffffff;
    --toggle-active: #2563eb;
    --category-tab-color: #64748b;
    --category-tab-active-bg: #2563eb;
    --category-tab-active-color: #ffffff;
    --top-btn-color: #64748b;
    --top-btn-hover-bg: rgba(255, 255, 255, 0.3);
    --modal-bg: rgba(0, 0, 0, 0.4);
    --modal-content-bg: rgba(255, 255, 255, 0.90);
    --modal-input-bg: #ffffff;
    --modal-input-border: #e2e8f0;
    --modal-btn-bg: #2563eb;
    --modal-btn-hover: #1d4ed8;
    --context-bg: rgba(255, 255, 255, 0.90);
}

html[data-theme="dark"] {
    --bg-body: linear-gradient(135deg, #0b0f1a 0%, #0f1729 40%, #131d33 100%);
    --orb-1: rgba(59, 90, 200, 0.12);
    --orb-2: rgba(120, 80, 200, 0.10);
    --orb-3: rgba(30, 130, 220, 0.08);
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --card-bg: rgba(255, 255, 255, 0.04);
    --card-border: rgba(255, 255, 255, 0.06);
    --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    --input-bg: #1e293b;
    --input-border: rgba(255, 255, 255, 0.1);
    --input-focus-border: #3b82f6;
    --btn-primary-bg: #2563eb;
    --btn-primary-hover: #3b82f6;
    --btn-primary-shadow: rgba(37, 99, 235, 0.30);
    --engine-tab-bg: rgba(255, 255, 255, 0.04);
    --engine-tab-color: rgba(255, 255, 255, 0.5);
    --engine-tab-active-bg: #2563eb;
    --engine-tab-active-color: #ffffff;
    --nav-card-bg: rgba(255, 255, 255, 0.04);
    --nav-card-hover-bg: rgba(255, 255, 255, 0.10);
    --nav-card-border: rgba(255, 255, 255, 0.04);
    --nav-label-color: rgba(255, 255, 255, 0.8);
    --footer-color: rgba(255, 255, 255, 0.2);
    --toggle-bg: #334155;
    --toggle-dot: #f1f5f9;
    --toggle-active: #3b82f6;
    --category-tab-color: rgba(255, 255, 255, 0.5);
    --category-tab-active-bg: #2563eb;
    --category-tab-active-color: #ffffff;
    --top-btn-color: rgba(255, 255, 255, 0.6);
    --top-btn-hover-bg: rgba(255, 255, 255, 0.08);
    --modal-bg: rgba(0, 0, 0, 0.6);
    --modal-content-bg: rgba(30, 41, 59, 0.95);
    --modal-input-bg: #1e293b;
    --modal-input-border: rgba(255, 255, 255, 0.1);
    --modal-btn-bg: #2563eb;
    --modal-btn-hover: #3b82f6;
    --context-bg: rgba(30, 41, 59, 0.95);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background: var(--bg-body);
    padding: 24px 20px 20px;
    transition: background 0.35s ease, color 0.3s ease;
    color: var(--text-primary);
    position: relative;
    overflow-x: hidden;
}

/* 光球浮动动画 */
@keyframes orbFloat1 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(60px, -40px); }
    66% { transform: translate(-30px, 30px); }
}
@keyframes orbFloat2 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(-50px, 50px); }
    66% { transform: translate(40px, -30px); }
}
@keyframes orbFloat3 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(30px, 40px); }
    66% { transform: translate(-60px, -20px); }
}

/* 光球 1 */
body::before {
    content: '';
    position: fixed;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: var(--orb-1);
    filter: blur(80px);
    top: -10%;
    left: -8%;
    opacity: 0.7;
    z-index: 0;
    pointer-events: none;
    animation: orbFloat1 18s ease-in-out infinite;
    transition: background 0.5s;
}

/* 光球 2 & 3 通过 .container 伪元素实现 */
.container::before {
    content: '';
    position: fixed;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: var(--orb-2);
    filter: blur(80px);
    bottom: -5%;
    right: -5%;
    opacity: 0.65;
    z-index: 0;
    pointer-events: none;
    animation: orbFloat2 14s ease-in-out infinite;
    transition: background 0.5s;
}
.container::after {
    content: '';
    position: fixed;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: var(--orb-3);
    filter: blur(80px);
    top: 40%;
    right: 20%;
    opacity: 0.6;
    z-index: 0;
    pointer-events: none;
    animation: orbFloat3 20s ease-in-out infinite;
    transition: background 0.5s;
}

.container {
    width: 100%;
    max-width: 920px;
    padding: 12px 0;
    position: relative;
    z-index: 1;
}

/* ===== 顶部栏 ===== */
.header {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
    gap: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-bottom: 28px;
}

.header-logo {
    height: 50px;
    max-width: 220px;
    object-fit: contain;
    border-radius: 6px;
    flex-shrink: 0;
    margin-right: auto;
}

.header-actions-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.header-left {
    display: flex;
    flex-direction: column;
    margin-bottom: 32px;
}

.header .time {
    font-size: 96px;
    font-weight: 800;
    letter-spacing: 6px;
    color: var(--text-primary);
    line-height: 0.9;
    font-variant-numeric: tabular-nums;
    transition: color 0.3s;
}

.header .greeting {
    font-size: 18px;
    font-weight: 400;
    color: var(--text-secondary);
    margin-top: 12px;
    letter-spacing: 0.5px;
    transition: color 0.3s;
}

.top-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    border-radius: 30px;
    background: transparent;
    color: var(--top-btn-color);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
    border: 1px solid transparent;
}

.top-btn:hover {
    background: var(--top-btn-hover-bg);
    color: var(--text-primary);
    border-color: var(--card-border);
}

.top-btn i {
    font-size: 14px;
}

.top-btn.active-btn {
    background: var(--btn-primary-bg);
    color: #fff;
    border-color: var(--btn-primary-bg);
}
.top-btn.active-btn:hover {
    background: var(--btn-primary-hover);
}

/* 主题切换开关 */
.theme-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 10px;
    border-radius: 30px;
    background: var(--engine-tab-bg);
    border: 1px solid var(--card-border);
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
    color: var(--top-btn-color);
    font-size: 13px;
    font-weight: 500;
}
.theme-toggle-btn:hover {
    background: var(--top-btn-hover-bg);
    color: var(--text-primary);
}
.theme-toggle-btn .toggle-switch {
    width: 36px;
    height: 20px;
    background: var(--toggle-bg);
    border-radius: 40px;
    position: relative;
    transition: background 0.3s;
    flex-shrink: 0;
}
.theme-toggle-btn .toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: var(--toggle-dot);
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
html[data-theme="dark"] .theme-toggle-btn .toggle-switch::after {
    transform: translateX(16px);
}
.theme-toggle-btn .toggle-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* ===== 搜索引擎切换 ===== */
.engine-tabs {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 16px;
    background: var(--engine-tab-bg);
    padding: 5px;
    border-radius: 14px;
    backdrop-filter: blur(4px);
    border: 1px solid var(--card-border);
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    transition: background 0.3s, border-color 0.3s;
}

.engine-tab {
    padding: 8px 22px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--engine-tab-color);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.engine-tab i {
    font-size: 13px;
    opacity: 0.7;
}
.engine-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}
.engine-tab.active {
    background: var(--engine-tab-active-bg);
    color: var(--engine-tab-active-color);
    box-shadow: 0 6px 20px var(--btn-primary-shadow);
}
.engine-tab.active i {
    opacity: 1;
}

/* ===== 搜索框 ===== */
.search-box {
    background: var(--input-bg);
    border-radius: 18px;
    padding: 4px 4px 4px 24px;
    display: flex;
    align-items: center;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--input-border);
    transition: box-shadow 0.3s, border-color 0.3s, transform 0.2s, background 0.3s;
    margin-bottom: 6px;
}
.search-box:focus-within {
    box-shadow: 0 20px 56px var(--btn-primary-shadow), 0 0 0 2px var(--input-focus-border);
    transform: scale(1.01);
    border-color: var(--input-focus-border);
}
.search-box .search-icon {
    color: var(--text-muted);
    font-size: 18px;
    margin-right: 14px;
    flex-shrink: 0;
    transition: color 0.3s;
}
.search-box input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 18px;
    padding: 16px 0;
    font-weight: 400;
    color: var(--text-primary);
    font-family: inherit;
    min-width: 0;
    transition: color 0.3s;
}
.search-box input::placeholder {
    color: var(--text-muted);
    font-weight: 300;
    letter-spacing: 0.2px;
}
.search-box .search-btn {
    background: var(--btn-primary-bg);
    border: none;
    border-radius: 14px;
    padding: 12px 28px;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 4px 16px var(--btn-primary-shadow);
    letter-spacing: 0.5px;
}
.search-box .search-btn:hover {
    background: var(--btn-primary-hover);
    transform: scale(1.02);
    box-shadow: 0 8px 28px var(--btn-primary-shadow);
}
.search-box .search-btn:active {
    transform: scale(0.97);
}
.search-box .search-btn i {
    font-size: 15px;
}

/* ===== 导航区域 ===== */
.nav-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--card-border);
}
.nav-section.pure-hidden {
    display: none;
}

/* 分类标签 */
.category-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.category-tab {
    padding: 6px 20px;
    border: none;
    border-radius: 30px;
    background: transparent;
    color: var(--category-tab-color);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
    border: 1px solid transparent;
}
.category-tab:hover {
    color: var(--text-primary);
    background: var(--nav-card-hover-bg);
    border-color: var(--card-border);
}
.category-tab.active {
    background: var(--category-tab-active-bg);
    color: var(--category-tab-active-color);
    box-shadow: 0 4px 16px var(--btn-primary-shadow);
}

/* 添加分类按钮 */
.category-tab.add-cat-btn {
    background: transparent;
    color: var(--text-muted);
    border: 1px dashed var(--input-border);
    padding: 6px 14px;
    font-size: 13px;
}
.category-tab.add-cat-btn:hover {
    color: var(--btn-primary-bg);
    border-color: var(--btn-primary-bg);
    background: var(--top-btn-hover-bg);
}

/* 导航卡片网格 */
.nav-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.nav-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: var(--nav-card-bg);
    border-radius: 12px;
    padding: 10px 4px 8px;
    transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 1px solid var(--nav-card-border);
    backdrop-filter: blur(4px);
    min-height: 70px;
    cursor: pointer;
    position: relative;
}
.nav-card:hover {
    background: var(--nav-card-hover-bg);
    transform: translateY(-4px);
    border-color: var(--card-border);
    box-shadow: var(--card-shadow);
}
.nav-card .nav-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 18px;
    margin-bottom: 4px;
    transition: background 0.2s;
    color: var(--text-secondary);
}
.nav-card .nav-icon img {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: contain;
}
.nav-card:hover .nav-icon {
    background: rgba(255, 255, 255, 0.12);
}
.nav-card .nav-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--nav-label-color);
    letter-spacing: 0.2px;
    text-align: center;
    transition: color 0.2s;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nav-card:hover .nav-label {
    color: var(--text-primary);
}

/* 品牌色 */
.nav-card[data-category="common"] .nav-icon { color: #3b82f6; }
.nav-card[data-category="social"] .nav-icon { color: #8b5cf6; }
.nav-card[data-category="dev"] .nav-icon { color: #10b981; }
.nav-card[data-category="entertain"] .nav-icon { color: #f59e0b; }

/* 添加卡片 */
.nav-card.add-card {
    border-style: dashed;
    border-color: var(--input-border);
    opacity: 0.6;
}
.nav-card.add-card:hover {
    opacity: 1;
}
.nav-card.add-card .nav-icon i {
    color: var(--text-muted);
}

/* 卡片隐藏/显示 (分类切换) */
.nav-card.hidden-card {
    display: none;
}

/* 移动端编辑按钮 */
.nav-card .edit-btn {
    position: absolute;
    top: 2px;
    right: 3px;
    background: transparent;
    border: 0;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    padding: 2px;
}
.nav-card .edit-btn:hover {
    color: var(--text-primary);
}
.nav-card .edit-btn img {
    width: 14px;
    height: 14px;
}

/* ===== 弹窗 ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background: var(--modal-bg);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--modal-content-bg);
    margin: 10% auto;
    padding: 24px;
    border: 1px solid var(--card-border);
    border-radius: 16px;
    width: 80%;
    max-width: 500px;
    backdrop-filter: blur(12px);
    box-shadow: var(--card-shadow);
}

.modal-content h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.modal-content label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.modal-content input,
.modal-content select {
    display: block;
    margin-bottom: 12px;
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--modal-input-border);
    border-radius: 10px;
    background: var(--modal-input-bg);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    max-width: 100%;
}
.modal-content input:focus,
.modal-content select:focus {
    border-color: var(--input-focus-border);
}

.modal-content button {
    background: var(--modal-btn-bg);
    color: #fff;
    padding: 10px 20px;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    transition: background 0.2s;
    width: 100%;
}
.modal-content button:hover {
    background: var(--modal-btn-hover);
}

.close {
    color: var(--text-muted);
    float: right;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}
.close:hover,
.close:focus {
    color: var(--text-primary);
}

/* ===== 登录弹窗 ===== */
#loginModal .modal-content {
    max-width: 380px !important;
    padding: 32px 28px 24px !important;
    border-radius: 20px !important;
    position: relative;
}

#loginModal .close {
    position: absolute;
    top: 14px;
    right: 16px;
    font-size: 18px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: transparent;
    transition: background 0.2s, color 0.2s;
    z-index: 10;
}
#loginModal .close:hover {
    background: rgba(0,0,0,0.06);
    color: var(--text-primary);
}
html[data-theme="dark"] #loginModal .close:hover {
    background: rgba(255,255,255,0.08);
}

.login-panel h2 {
    text-align: center;
    margin: 0 0 24px 0 !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    color: var(--text-primary);
}

/* 覆盖全局 modal-content 对登录表单的影响 */
#loginModal .login-field input,
#loginModal .login-field select {
    display: block !important;
    width: 100% !important;
    padding: 13px 14px 13px 10px !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--text-primary) !important;
    font-size: 14px !important;
    box-shadow: none !important;
    outline: none !important;
    flex: 1;
    min-width: 0;
}
#loginModal .login-field input::placeholder {
    color: var(--text-muted);
    font-weight: 300;
}
#loginModal .login-field input:focus {
    box-shadow: none !important;
    border-color: transparent !important;
}

/* 覆盖 checkbox 的全局样式 */
#loginModal input[type="checkbox"] {
    width: 16px !important;
    height: 16px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid var(--input-border) !important;
    border-radius: 4px !important;
    background: var(--input-bg) !important;
    display: inline-block !important;
    vertical-align: middle;
    accent-color: var(--btn-primary-bg);
    cursor: pointer;
}

/* 覆盖按钮的全局样式 */
#loginModal .login-submit-btn {
    display: block !important;
    width: 100% !important;
    padding: 13px 20px !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 12px !important;
    background: var(--btn-primary-bg) !important;
    color: #fff !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    letter-spacing: 1px;
    box-shadow: 0 4px 16px var(--btn-primary-shadow);
    transition: background 0.25s, transform 0.15s, box-shadow 0.25s;
}
#loginModal .login-submit-btn:hover {
    background: var(--btn-primary-hover) !important;
    box-shadow: 0 8px 28px var(--btn-primary-shadow);
}
#loginModal .login-submit-btn:active {
    transform: scale(0.97);
}

/* 输入框行 */
.login-field {
    position: relative;
    margin-bottom: 16px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    transition: border-color 0.25s, box-shadow 0.25s;
    overflow: hidden;
}
.login-field:focus-within {
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 3px var(--btn-primary-shadow);
}
.login-field > i:first-child {
    padding: 0 0 0 14px;
    color: var(--text-muted);
    font-size: 15px;
    flex-shrink: 0;
    line-height: 1;
    transition: color 0.25s;
}
.login-field:focus-within > i:first-child {
    color: var(--btn-primary-bg);
}

/* 密码眼睛 */
.login-eye {
    padding: 0 14px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 15px;
    flex-shrink: 0;
    transition: color 0.2s;
}
.login-eye:hover {
    color: var(--text-primary);
}

/* 验证码行 */
.login-captcha-field {
    display: flex;
    align-items: center;
    gap: 10px;
}
.login-captcha-field > i:first-child {
    color: var(--text-muted);
    transition: color 0.25s;
}
.login-captcha-field:focus-within > i:first-child {
    color: var(--btn-primary-bg);
}
.login-captcha-field input {
    flex: 1;
    min-width: 0;
}
.login-captcha-img {
    height: 44px;
    width: auto;
    border-radius: 10px;
    cursor: pointer;
    flex-shrink: 0;
    border: 1px solid var(--input-border);
    transition: border-color 0.2s;
    margin-right: 4px;
}
.login-captcha-img:hover {
    border-color: var(--input-focus-border);
}

/* 邮箱验证码输入+发送按钮行 */
.login-mailcode-field {
    display: flex;
    align-items: stretch;
    gap: 0;
}
.login-mailcode-field > i:first-child {
    color: var(--text-muted);
    align-self: center;
    transition: color 0.25s;
}
.login-mailcode-field:focus-within > i:first-child {
    color: var(--btn-primary-bg);
}
.login-mailcode-field input {
    flex: 1;
    min-width: 0;
}
.login-send-code {
    padding: 0 14px;
    font-size: 12px;
    border-radius: 0 11px 11px 0;
    border: none;
    background: var(--btn-primary-bg);
    color: #fff;
    cursor: pointer;
    white-space: nowrap;
    width: auto !important;
    letter-spacing: 0;
    font-weight: 500;
    flex-shrink: 0;
    transition: background 0.2s;
}
.login-send-code:hover {
    background: var(--btn-primary-hover);
}
.login-send-code:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 选项行 */
.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 4px 0 20px 0;
    font-size: 13px;
}
.login-remember {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    margin: 0;
}
.login-remember input[type="checkbox"] {
    flex-shrink: 0;
}
.login-forgot {
    color: var(--btn-primary-bg);
    cursor: pointer;
    font-weight: 500;
}
.login-forgot:hover {
    text-decoration: underline;
}

/* 协议 */
.login-agreement {
    margin: 4px 0 18px 0;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
}
.login-agreement label {
    display: flex !important;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
}
.login-agreement input[type="checkbox"] {
    flex-shrink: 0;
    margin-top: 3px !important;
}
.login-agreement a {
    color: var(--btn-primary-bg);
    text-decoration: none;
}
.login-agreement a:hover {
    text-decoration: underline;
}

/* 底部链接 */
.login-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--card-border);
    font-size: 13px;
    color: var(--text-muted);
}
.login-footer a {
    color: var(--btn-primary-bg);
    text-decoration: none;
    font-weight: 600;
}
.login-footer a:hover {
    text-decoration: underline;
}

/* ===== 右键菜单 ===== */
.context-menu {
    position: absolute;
    background: var(--context-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    padding: 6px 0;
    z-index: 200;
    display: none;
    min-width: 100px;
    backdrop-filter: blur(12px);
}
.context-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.context-menu li {
    padding: 10px 20px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 13px;
    color: var(--text-primary);
}
.context-menu li:hover {
    background: var(--top-btn-hover-bg);
}

/* ===== 底部 ===== */
.footer-note {
    text-align: center;
    margin-top: 32px;
    font-size: 12px;
    color: var(--footer-color);
    letter-spacing: 0.4px;
    font-weight: 300;
    transition: color 0.3s;
}

/* ===== Switch 开关 ===== */
.switch-container {
    display: flex;
    align-items: center;
    margin-bottom: 14px;
}
.switch {
    position: relative;
    display: inline-block;
    width: 30px;
    height: 16px;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
}
.slider:before {
    position: absolute;
    content: "";
    height: 10px;
    width: 10px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
}
input:checked + .slider {
    background-color: #2196f3;
}
input:focus + .slider {
    box-shadow: 0 0 1px #2196f3;
}
input:checked + .slider:before {
    transform: translateX(14px);
}
.slider.round {
    border-radius: 34px;
    width: 35px;
}
.slider.round:before {
    border-radius: 50%;
}
.switch-label {
    margin-left: 8px;
    color: var(--text-secondary);
    font-size: 13px;
}

/* ===== iframe 内嵌弹窗 ===== */
.iframe-content {
    width: 90%;
    max-width: 1100px;
    height: 80vh;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    margin: 5vh auto;
    background: var(--modal-content-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.iframe-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--modal-content-bg);
    border-bottom: 1px solid var(--card-border);
    border-radius: 16px 16px 0 0;
    flex-shrink: 0;
}

.iframe-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 12px;
}

.iframe-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.iframe-action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.iframe-action-btn:hover {
    background: var(--top-btn-hover-bg);
    color: var(--text-primary);
}

.iframe-body {
    flex: 1;
    overflow: hidden;
}

.iframe-body iframe {
    width: 100%;
    height: 100%;
    border: 0;
    background: var(--input-bg);
}

html[data-theme="dark"] .iframe-body iframe {
    background: #1e293b;
}

/* 全屏状态 */
.iframe-content:fullscreen {
    border-radius: 0;
    height: 100vh;
    max-height: 100vh;
    margin: 0;
}
.iframe-content:fullscreen .iframe-toolbar {
    border-radius: 0;
}

/* ===== 应用商店弹窗 ===== */
#appStoreModal .modal-content {
    max-width: 600px;
}
#appStoreContainer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    max-height: 50vh;
    overflow-y: auto;
    padding: 10px;
}
#appStoreContainer .app-card {
    width: 120px;
    text-align: center;
    margin: 10px;
}
#appStoreContainer .app-card img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: contain;
}
#appStoreContainer .app-card p {
    font-size: 12px;
    color: var(--text-primary);
    margin: 6px 0;
}
#appStoreContainer .app-card .add-app-btn {
    width: auto;
    padding: 4px 14px;
    font-size: 12px;
    border-radius: 6px;
}

/* ===== 消息弹窗 ===== */
#messageModal .modal-content {
    text-align: center;
}
#messageModal .modal-content p {
    margin-bottom: 20px;
    color: var(--text-primary);
    font-size: 14px;
}
#messageModal .modal-content button {
    width: auto;
    padding: 8px 24px;
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ===== 响应式 ===== */
@media (max-width: 820px) {
    .nav-grid { grid-template-columns: repeat(4, 1fr); }
    .header .time { font-size: 56px; }
    .header .greeting { font-size: 14px; }
    .search-box input { font-size: 16px; padding: 14px 0; }
    .search-box .search-btn { padding: 10px 20px; font-size: 14px; }
    .engine-tab { padding: 6px 16px; font-size: 13px; }
    .top-btn { padding: 6px 10px; font-size: 12px; }
    .theme-toggle-btn { padding: 4px 10px 4px 8px; }
    .theme-toggle-btn .toggle-switch { width: 30px; height: 18px; }
    .theme-toggle-btn .toggle-switch::after { width: 14px; height: 14px; }
    html[data-theme="dark"] .theme-toggle-btn .toggle-switch::after { transform: translateX(12px); }
}

@media (max-width: 580px) {
    .container { padding: 8px 0; }
    .header { flex-direction: column; gap: 8px; }
    .header-actions { justify-content: flex-start; flex-wrap: wrap; }
    .header-logo { height: 50px; max-width: 160px; }
    .header .time { font-size: 44px; }
    .nav-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
    .nav-card { padding: 8px 2px 6px; min-height: 60px; }
    .nav-card .nav-icon { width: 26px; height: 26px; font-size: 14px; }
    .nav-card .nav-label { font-size: 10px; }
    .search-box { flex-wrap: wrap; background: transparent; box-shadow: none; border: none; padding: 0; gap: 10px; }
    .search-box:focus-within { transform: none; box-shadow: none; border: none; }
    .search-box input { background: var(--input-bg); border-radius: 14px; padding: 14px 18px; width: 100%; box-shadow: var(--card-shadow); border: 1px solid var(--input-border); }
    .search-box .search-icon { display: none; }
    .search-box .search-btn { width: 100%; justify-content: center; padding: 12px; border-radius: 12px; }
    .engine-tabs { gap: 4px; padding: 4px; width: 100%; justify-content: space-around; }
    .engine-tab { padding: 5px 10px; font-size: 12px; flex: 1; justify-content: center; }
    .engine-tab i { display: none; }
    .category-tabs { gap: 4px; }
    .category-tab { padding: 4px 14px; font-size: 12px; }
    .footer-note { font-size: 10px; margin-top: 20px; }
    .top-btn { padding: 4px 8px; font-size: 11px; }
    .top-btn i { font-size: 12px; }
    .theme-toggle-btn { padding: 4px 8px 4px 6px; font-size: 11px; }
    .theme-toggle-btn .toggle-switch { width: 26px; height: 16px; }
    .theme-toggle-btn .toggle-switch::after { width: 12px; height: 12px; top: 2px; left: 2px; }
    html[data-theme="dark"] .theme-toggle-btn .toggle-switch::after { transform: translateX(10px); }
    .iframe-content { max-width: 95%; width: 95%; }
}

@media (max-width: 380px) {
    .nav-grid { grid-template-columns: repeat(3, 1fr); }
    .header-actions { gap: 4px; }
    .header-logo { height: 50px; max-width: 120px; margin-right: 4px; }
    .top-btn { padding: 3px 6px; font-size: 10px; }
    .top-btn .btn-text { display: none; }
    .theme-toggle-btn .toggle-label { display: none; }
}
