/**
 * style.css - 之马OPC主样式文件
 * 作者：之马工场
 * 创建日期：2026-01-01
 */

/* ========== 页面整体布局 ========== */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg-primary);
}

/* ========== 主导航栏（顶部） ========== */
.main-nav {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 48px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 20px;
    z-index: 100;
    transition: background var(--transition-normal), border-color var(--transition-normal);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    margin-right: 24px;
    flex-shrink: 0;
}

.nav-logo .logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-logo .logo-icon svg {
    width: 20px;
    height: 20px;
    color: #fff;
    fill: #fff;
}

/* 导航栏品牌文字：用更独立的 class，避免被各模块 css 误伤 */
.main-nav .nav-logo .nav-logo-text {
    font-family: var(--font-sans);
    font-size: 1.125rem !important;
    font-weight: 700 !important;
    line-height: 1;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    white-space: nowrap;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 2px;
}

/* 汉堡按钮（PC 端隐藏） */
.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    margin-left: auto;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 999px;
    transition: all 0.3s ease;
}

/* 遮罩层（PC 端隐藏） */
.nav-overlay {
    display: none;
}

/* 抽屉容器：PC 端透明包装 */
.nav-body {
    display: contents;
}

/* 抽屉头部（PC 端隐藏） */
.nav-body-header {
    display: none;
}

/* 关闭按钮（PC 端隐藏） */
.nav-close {
    display: none;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 0.9375rem;
    transition: all var(--transition-normal);
    cursor: pointer;
    text-decoration: none;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(29, 78, 216, 0.12) 0%, rgba(2, 132, 199, 0.12) 100%);
    color: var(--primary-color);
}

.nav-item.active::after,
.nav-dropdown.active .nav-dropdown-trigger::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -12px;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px 3px 0 0;
}

.nav-dropdown.active .nav-dropdown-trigger {
    background: linear-gradient(135deg, rgba(29, 78, 216, 0.12) 0%, rgba(2, 132, 199, 0.12) 100%);
    color: var(--primary-color);
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-item .nav-tooltip {
    display: none;
}

.nav-item .nav-text {
    font-size: 0.9375rem;
    font-weight: 500;
    white-space: nowrap;
}

/* 科研用工下拉菜单 */
.nav-dropdown {
    position: relative;
}

.nav-dropdown .nav-dropdown-trigger {
    gap: 6px;
}

.nav-dropdown .nav-dropdown-arrow {
    width: 14px;
    height: 14px;
    margin-left: 2px;
    opacity: 0.8;
    transition: transform var(--transition-normal);
}

.nav-dropdown:hover .nav-dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 2px;
    min-width: 160px;
    padding: 6px 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    display: none;
    z-index: 200;
}

/* 桥接区：填满触发与菜单之间的空隙，鼠标下移时 hover 不中断 */
.nav-dropdown-menu::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: 10px;
}

.nav-dropdown:hover .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-item {
    display: block;
    padding: 10px 16px;
    font-size: 0.9375rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: background var(--transition-normal), color var(--transition-normal);
}

.nav-dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--primary-color);
}

.nav-user {
    margin-left: auto;
    padding-left: 16px;
    border-left: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-user .nav-item {
    padding: 8px 12px;
    background: var(--bg-tertiary);
}

.nav-user .nav-item.active::after {
    display: none;
}

/* ========== 侧边栏（二级菜单） ========== */
.sidebar {
    position: fixed;
    left: 0;
    top: 48px;
    width: var(--sidebar-width);
    height: calc(100vh - 48px);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 90;
    transition: transform var(--transition-normal), background var(--transition-normal), border-color var(--transition-normal);
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-title svg {
    width: 20px;
    height: 20px;
    color: var(--primary-color);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.sidebar-section {
    margin-bottom: 16px;
}

.sidebar-section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding: 0 10px;
    margin-bottom: 6px;
}

.sidebar-section-link {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.sidebar-section-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    cursor: pointer;
    text-decoration: none;
}

.sidebar-menu-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar-menu-item.active {
    background: linear-gradient(135deg, rgba(29, 78, 216, 0.1) 0%, rgba(2, 132, 199, 0.1) 100%);
    color: var(--primary-color);
}

.sidebar-menu-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.sidebar-menu-item span {
    flex: 1;
    font-size: 0.875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 新建对话按钮 */
.btn-new-chat {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: white;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 15px rgba(29, 78, 216, 0.25);
}

.btn-new-chat:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.3);
}

.btn-new-chat svg {
    width: 16px;
    height: 16px;
}

/* ========== 主内容区域 ========== */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: 48px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 48px);
    transition: margin-left var(--transition-normal);
}

.main-content.no-sidebar {
    margin-left: 0;
}

/* 顶部工具栏 */
.top-bar {
    position: sticky;
    top: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 24px;
    background: var(--bg-secondary);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 80;
    transition: background var(--transition-normal), border-color var(--transition-normal);
}

[data-theme="dark"] .top-bar {
    background: rgba(10, 15, 26, 0.8);
}

.model-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.model-selector:hover {
    border-color: var(--primary-color);
}

.model-icon {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.model-icon svg {
    width: 14px;
    height: 14px;
    color: white;
}

.model-info {
    display: flex;
    flex-direction: column;
}

.model-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.model-desc {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.model-selector svg.chevron {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-bar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    transition: all var(--transition-fast);
    background: transparent;
    border: none;
    cursor: pointer;
}

.top-bar-btn svg {
    width: 18px;
    height: 18px;
}

.top-bar-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* ========== 聊天区域 ========== */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 0 32px;
}

.chat-welcome {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    animation: fadeIn 0.6s ease;
}

.welcome-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    box-shadow: 0 0 40px rgba(29, 78, 216, 0.3);
}

.welcome-icon svg {
    width: 40px;
    height: 40px;
    color: white;
}

.welcome-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.welcome-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin-bottom: 0;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    max-width: 600px;
    width: 100%;
}

.quick-action {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.quick-action:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.quick-action-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

.quick-action-icon svg {
    width: 22px;
    height: 22px;
}

.quick-action-title {
    font-weight: 500;
    color: var(--text-primary);
}

.quick-action-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* 消息列表 */
.chat-messages {
    flex: 1;
    padding: 24px 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}

.message {
    display: flex;
    gap: 16px;
    animation: slideInUp 0.3s ease;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message.user .message-avatar {
    background: var(--accent-color);
    color: white;
}

.message.assistant .message-avatar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.message-content {
    flex: 1;
    max-width: calc(100% - 52px);
}

.message-text {
    padding: 16px 20px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    line-height: 1.7;
}

.message.user .message-text {
    background: var(--bg-tertiary);
}

/* ========== 输入区域 ========== */
.chat-input-container {
    position: sticky;
    bottom: 0;
    padding: 24px 0 32px;
    background: linear-gradient(180deg, transparent 0%, var(--bg-primary) 30%);
    transition: background var(--transition-normal);
}

.chat-input-wrapper {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    transition: all var(--transition-fast);
}

.chat-input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.1);
}

.chat-input-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px 0;
}

.input-tool-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.input-tool-btn:hover {
    background: var(--bg-tertiary);
    color: var(--primary-color);
}

.input-tool-btn svg {
    width: 20px;
    height: 20px;
}

.chat-input {
    width: 100%;
    min-height: 56px;
    max-height: 200px;
    padding: 16px 60px 16px 20px;
    background: transparent;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.5;
    resize: none;
}

.chat-input::placeholder {
    color: var(--text-muted);
}

.chat-send-btn {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.25);
}

.chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(29, 78, 216, 0.35);
}

.chat-send-btn svg {
    width: 20px;
    height: 20px;
}

/* ========== 页面标题区域 ========== */
.page-header {
    padding: 40px 48px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-normal), border-color var(--transition-normal);
}

.page-header.has-quote {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.page-header h1 {
    font-size: 1.75rem;
    margin-bottom: 8px;
}

.page-header p {
    color: var(--text-secondary);
    margin: 0;
}

.page-body {
    flex: 1;
    padding: 32px 48px;
}

/* ========== 卡片网格 ========== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--transition-normal);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.card:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.card-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, rgba(29, 78, 216, 0.15) 0%, rgba(2, 132, 199, 0.15) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: var(--primary-color);
}

.card-icon svg {
    width: 28px;
    height: 28px;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.card-desc {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.card-tag {
    display: inline-block;
    padding: 4px 10px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 12px;
}

/* ========== 大按钮样式 ========== */
.big-btn-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
    max-width: 800px;
    margin: 0 auto;
}

.big-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 48px 32px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.big-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.big-btn-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 8px 24px rgba(29, 78, 216, 0.3);
}

.big-btn-icon svg {
    width: 36px;
    height: 36px;
}

.big-btn-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.big-btn-desc {
    font-size: 1rem;
    color: var(--text-secondary);
    text-align: center;
}

/* ========== 列表样式 ========== */
.list-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: background var(--transition-normal), border-color var(--transition-normal);
}

.list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.list-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.list-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
}

.list-item:last-child {
    border-bottom: none;
}

.list-item:hover {
    background: var(--bg-hover);
}

.list-item-icon {
    width: 44px;
    height: 44px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

.list-item-content {
    flex: 1;
}

.list-item-title {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.list-item-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.list-item-action {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ========== 按钮样式 ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all var(--transition-normal);
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(29, 78, 216, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(29, 78, 216, 0.35);
}

/* 链接形态的按钮需覆盖 basic.css 的 a:hover 字色，避免 hover 时文字与背景对比度不足 */
a.btn {
    text-decoration: none;
}

a.btn-primary,
a.btn-primary:hover,
a.btn-primary:focus {
    color: #fff;
}

a.btn-secondary,
a.btn-secondary:hover,
a.btn-secondary:focus {
    color: var(--text-primary);
}

a.btn-outline,
a.btn-outline:hover,
a.btn-outline:focus {
    color: var(--primary-color);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-outline:hover {
    background: rgba(29, 78, 216, 0.1);
}

.btn svg {
    width: 18px;
    height: 18px;
}

/* ========== 状态标签 ========== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 500;
}

.status-badge.pending {
    background: rgba(253, 203, 110, 0.15);
    color: var(--warning-color);
}

.status-badge.active {
    background: rgba(0, 184, 148, 0.15);
    color: var(--success-color);
}

.status-badge.completed {
    background: rgba(2, 132, 199, 0.15);
    color: var(--accent-light);
}

/* ========== 表单样式 ========== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.form-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* ========== 响应式设计 ========== */
@media (max-width: 1200px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
}

@media (max-width: 992px) {
    .nav-item .nav-text {
        display: none;
    }
    
    .nav-item {
        padding: 10px;
    }
}

@media (max-width: 768px) {
    /* --- 顶栏：固定高度，只显示 Logo + 汉堡 --- */
    .main-nav {
        height: 48px;
        padding: 0 16px;
    }

    .main-nav > .nav-logo {
        margin-right: 0;
    }

    .main-nav .nav-logo .nav-logo-text {
        font-size: 1rem !important;
    }

    .nav-toggle {
        display: flex;
    }

    /* --- 遮罩层 --- */
    .nav-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 998;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        -webkit-backdrop-filter: blur(2px);
        backdrop-filter: blur(2px);
    }

    .main-nav.nav-open .nav-overlay {
        opacity: 1;
        visibility: visible;
    }

    /* --- 抽屉面板 --- */
    .nav-body {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: 0;
        width: 280px;
        max-width: 80vw;
        height: 100vh;
        height: 100dvh;
        background: var(--bg-secondary);
        z-index: 999;
        transform: translateX(100%);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -8px 0 30px rgba(0, 0, 0, 0.15);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .main-nav.nav-open .nav-body {
        transform: translateX(0);
    }

    /* --- 抽屉头部 --- */
    .nav-body-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 16px;
        border-bottom: 1px solid var(--border-color);
        flex-shrink: 0;
    }

    .nav-body-header .nav-logo {
        margin-right: 0;
    }

    .nav-close {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border: none;
        border-radius: var(--radius-md);
        background: var(--bg-tertiary);
        color: var(--text-muted);
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .nav-close:hover {
        background: var(--bg-hover);
        color: var(--text-primary);
    }

    .nav-close svg {
        width: 20px;
        height: 20px;
    }

    /* --- 菜单区（竖排） --- */
    .nav-menu {
        flex: 1;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px 0;
    }

    .nav-item {
        padding: 12px 20px;
        border-radius: 0;
        font-size: 0.9375rem;
    }

    .nav-item .nav-text {
        display: inline !important;
    }

    .nav-item svg {
        width: 20px;
        height: 20px;
    }

    .nav-item.active::after,
    .nav-dropdown.active .nav-dropdown-trigger::after {
        display: none;
    }

    .nav-item.active {
        border-radius: 0;
    }

    /* --- 下拉菜单在移动端：点击展开 --- */
    .nav-dropdown:hover .nav-dropdown-menu {
        display: none;
    }

    .nav-dropdown .nav-dropdown-trigger {
        padding: 12px 20px;
        border-radius: 0;
    }

    .nav-dropdown .nav-dropdown-arrow {
        margin-left: auto;
        transition: transform 0.3s ease;
    }

    .nav-dropdown.mobile-open .nav-dropdown-arrow {
        transform: rotate(180deg);
    }

    .nav-dropdown-menu {
        position: static;
        margin-top: 0;
        min-width: 0;
        padding: 0;
        background: var(--bg-tertiary);
        border: none;
        border-radius: 0;
        box-shadow: none;
        display: none;
    }

    .nav-dropdown-menu::before {
        display: none;
    }

    .nav-dropdown.mobile-open .nav-dropdown-menu {
        display: block;
    }

    .nav-dropdown-item {
        padding: 11px 20px 11px 52px;
        font-size: 0.875rem;
        color: var(--text-secondary);
        border-bottom: none;
    }

    .nav-dropdown-item:hover,
    .nav-dropdown-item.active {
        background: transparent;
        color: var(--primary-color);
    }

    /* --- 用户区（底部） --- */
    .nav-user {
        margin-left: 0;
        padding: 12px 20px 20px;
        border-left: none;
        border-top: 1px solid var(--border-color);
        gap: 8px;
        flex-shrink: 0;
    }

    .nav-user .nav-item {
        padding: 10px 14px;
        border-radius: var(--radius-md);
        font-size: 0.875rem;
    }

    .nav-user .nav-item .nav-text {
        display: inline !important;
    }

    /* --- 其他页面元素 --- */
    .sidebar {
        top: 48px;
        height: calc(100vh - 48px);
    }

    .main-content {
        margin-top: 48px;
        min-height: calc(100vh - 48px);
    }

    .top-bar {
        top: 48px;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .big-btn-group {
        grid-template-columns: 1fr;
    }

    .page-header {
        padding: 24px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .page-header-actions {
        align-self: flex-end;
    }

    .page-body {
        padding: 24px 20px;
    }
}

/* ========== 功能更新提示弹窗 ========== */
.update-notice-popup {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.un-header {
    position: relative;
}

.un-header-bar {
    height: 4px;
    background: linear-gradient(135deg, #1d4ed8, #0284c7);
    border-radius: 4px 4px 0 0;
}

.un-title {
    padding: 20px 24px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
}

.un-body {
    padding: 16px 24px 8px;
}

.un-content {
    color: var(--text-secondary, #475569);
    font-size: 14px;
    line-height: 1.7;
}

.un-quote {
    margin-top: 16px;
    padding: 12px 16px;
    background: var(--bg-secondary, #f8fafc);
    border-left: 3px solid var(--primary, #1d4ed8);
    border-radius: 0 6px 6px 0;
    font-size: 13px;
    color: var(--text-muted, #94a3b8);
    font-style: italic;
    line-height: 1.5;
}

.un-quote-author {
    display: block;
    margin-top: 4px;
    font-style: normal;
    font-size: 12px;
}

.un-footer {
    padding: 8px 24px 20px;
    text-align: right;
}

.un-btn {
    padding: 8px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.un-btn-primary {
    background: linear-gradient(135deg, #1d4ed8, #0284c7);
    color: #fff;
}

.un-btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* ========== 每日名言（导航栏下方） ========== */
.page-header-quote {
    max-width: 280px;
    text-align: right;
    flex-shrink: 0;
}

.page-header-quote .phq-text {
    font-size: 0.85rem;
    font-style: italic;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.page-header-quote .phq-author {
    display: block;
    margin-top: 6px;
    font-size: 0.75rem;
    font-style: normal;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .page-header-quote {
        max-width: 100%;
        text-align: left;
    }
}

