/* ========== Pure Notion Theme ========== */

/* 全局 CSS 变量 - 真正的 Notion 配色 */
:root {
    /* Notion 中性色系 - 亮色模式 */
    --notion-text-default: #37352f;
    --notion-text-gray: #787774;
    --notion-text-light: #9b9a97;

    --notion-bg-default: #ffffff;
    --notion-bg-gray: #f7f6f3;
    --notion-bg-hover: #f1f0ee;
    --notion-bg-active: #e9e9e7;

    --notion-border: #e9e9e7;
    --notion-border-hover: #d3d1cb;

    /* 语义色 - 仅用于状态 */
    --notion-blue: #0b6e99;
    --notion-blue-bg: #e3f2fd;
    --notion-green: #448361;
    --notion-green-bg: #edf3ec;
    --notion-red: #d44c47;
    --notion-red-bg: #fbe4e2;
    --notion-yellow: #cb912f;
    --notion-yellow-bg: #fbf3db;

    /* 阴影 */
    --notion-shadow-sm: 0 1px 2px rgba(15, 15, 15, 0.1);
    --notion-shadow-md: rgba(15, 15, 15, 0.1) 0px 0px 0px 1px, rgba(15, 15, 15, 0.1) 0px 2px 4px;
    --notion-shadow-lg: rgba(15, 15, 15, 0.05) 0px 0px 0px 1px, rgba(15, 15, 15, 0.1) 0px 3px 6px, rgba(15, 15, 15, 0.2) 0px 9px 24px;

    /* 圆角 - Notion 使用很小的圆角 */
    --notion-radius-sm: 3px;
    --notion-radius-md: 3px;
    --notion-radius-lg: 3px;

    /* 过渡 */
    --notion-transition: all 20ms ease-in 0s;
}

/* Notion 暗色模式 - 真实版本 */
[data-theme="dark"] {
    /* 真正的Notion暗色 - 深黑背景 */
    --notion-text-default: #ffffff;
    --notion-text-gray: #9b9a97;
    --notion-text-light: #5a5a5a;

    --notion-bg-default: #191919;
    --notion-bg-gray: #0f0f0f;
    --notion-bg-hover: #2c2c2c;
    --notion-bg-active: #383838;

    --notion-border: #2e2e2e;
    --notion-border-hover: #3a3a3a;

    /* 语义色 - 保持鲜艳 */
    --notion-blue: #2e80f2;
    --notion-blue-bg: rgba(46, 128, 242, 0.2);
    --notion-green: #0f9d58;
    --notion-green-bg: rgba(15, 157, 88, 0.2);
    --notion-red: #db4437;
    --notion-red-bg: rgba(219, 68, 55, 0.2);
    --notion-yellow: #f4b400;
    --notion-yellow-bg: rgba(244, 180, 0, 0.2);

    /* 暗色阴影 */
    --notion-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.6);
    --notion-shadow-md: rgba(0, 0, 0, 0.5) 0px 0px 0px 1px, rgba(0, 0, 0, 0.6) 0px 2px 4px;
    --notion-shadow-lg: rgba(0, 0, 0, 0.5) 0px 0px 0px 1px, rgba(0, 0, 0, 0.6) 0px 3px 6px, rgba(0, 0, 0, 0.7) 0px 9px 24px;
}

/* 全局样式 - 覆盖 style.css */
body {
    font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol" !important;
    background: var(--notion-bg-gray) !important;
    color: var(--notion-text-default) !important;
    line-height: 1.5;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    padding: 0 !important;
}

/* 容器全宽显示，移除居中限制 */
.container {
    max-width: 100% !important;
    margin: 0 !important;
    background: var(--notion-bg-gray) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
}

/* ========== 顶部导航 ========== */
.top-nav {
    background: var(--notion-bg-default);
    border-bottom: 1px solid var(--notion-border);
    padding: 0 20px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--notion-shadow-sm);
}

@media (max-width: 768px) {
    .nav-right .btn { display: none; }
    .nav-right #navStartBtn { display: inline-flex; }
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* 桌面隐藏移动端菜单按钮 */
#sidebarToggleBtn { display: none; }
@media (max-width: 768px) {
    #sidebarToggleBtn { display: inline-flex; }
}

.app-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 16px;
    color: var(--notion-text-default);
}

.logo-icon {
    font-size: 24px;
}

.nav-stats {
    display: flex;
    gap: 16px;
    padding-left: 16px;
    border-left: 1px solid var(--notion-border);
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-label {
    font-size: 11px;
    color: var(--notion-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--notion-text-default);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ========== 按钮系统 ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    border: none;
    border-radius: var(--notion-radius-sm);
    background: transparent;
    color: var(--notion-text-default);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--notion-transition);
    white-space: nowrap;
    user-select: none;
}

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

.btn:active {
    background: var(--notion-bg-active);
}

/* 主要按钮 - 深色填充 */
.btn-primary, .btn.primary {
    background: var(--notion-text-default);
    color: #ffffff;
    box-shadow: var(--notion-shadow-sm);
}

.btn-primary:hover, .btn.primary:hover {
    background: rgba(55, 53, 47, 0.9);
}

.btn-primary:active, .btn.primary:active {
    background: rgba(55, 53, 47, 0.8);
}

/* 暗色模式下的主按钮 */
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn.primary {
    background: #2e80f2;
    color: #ffffff;
    border: none;
}

[data-theme="dark"] .btn-primary:hover,
[data-theme="dark"] .btn.primary:hover {
    background: #1a73e8;
}

[data-theme="dark"] .btn-primary:active,
[data-theme="dark"] .btn.primary:active {
    background: #1557b0;
}

/* 成功按钮 */
.btn-success {
    background: var(--notion-green);
    color: white;
    box-shadow: var(--notion-shadow-sm);
}

.btn-success:hover {
    background: var(--notion-green);
    opacity: 0.9;
}

[data-theme="dark"] .btn-success {
    background: #0f9d58;
    color: #ffffff;
}

[data-theme="dark"] .btn-success:hover {
    background: #0d8549;
}

/* 危险按钮 */
.btn-danger {
    background: var(--notion-red);
    color: white;
    box-shadow: var(--notion-shadow-sm);
}

.btn-danger:hover {
    background: var(--notion-red);
    opacity: 0.9;
}

[data-theme="dark"] .btn-danger {
    background: #db4437;
    color: #ffffff;
}

[data-theme="dark"] .btn-danger:hover {
    background: #c33d2e;
}

/* 次要按钮 */
.btn-secondary {
    background: transparent;
    color: var(--notion-text-gray);
}

.btn-secondary:hover {
    background: var(--notion-bg-hover);
    color: var(--notion-text-default);
}

/* 信息按钮 */
.btn-info {
    background: transparent;
    color: var(--notion-text-gray);
}

.btn-info:hover {
    background: var(--notion-bg-hover);
}

/* 警告按钮 */
.btn-warning {
    background: var(--notion-yellow);
    color: white;
}

.btn-warning:hover {
    background: var(--notion-yellow);
    opacity: 0.9;
}

[data-theme="dark"] .btn-warning {
    background: #f4b400;
    color: #ffffff;
}

[data-theme="dark"] .btn-warning:hover {
    background: #db9e00;
}

/* 小按钮 */
.btn-sm {
    padding: 4px 8px;
    font-size: 13px;
}

/* ========== 表单控件 ========== */
.form-control {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--notion-border);
    border-radius: var(--notion-radius-sm);
    background: var(--notion-bg-default);
    color: var(--notion-text-default);
    font-size: 14px;
    transition: var(--notion-transition);
}

.form-control:hover {
    border-color: var(--notion-border-hover);
}

.form-control:focus {
    outline: none;
    border-color: var(--notion-text-default);
    box-shadow: 0 0 0 1px var(--notion-text-default);
}

.form-control::placeholder {
    color: var(--notion-text-light);
}

/* 暗色模式下的表单 */
[data-theme="dark"] .form-control {
    background: #2c2c2c;
    border-color: #2e2e2e;
    color: #ffffff;
}

[data-theme="dark"] .form-control:hover {
    background: #323232;
    border-color: #3a3a3a;
}

[data-theme="dark"] .form-control:focus {
    background: #2c2c2c;
    border-color: #2e80f2;
    box-shadow: 0 0 0 1px #2e80f2;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

.form-hint {
    font-size: 12px;
    color: var(--notion-text-light);
    margin-top: 4px;
    line-height: 1.4;
}

.form-group {
    margin-bottom: 16px;
}

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

/* ========== 面板和容器 ========== */
.panel {
    background: var(--notion-bg-default);
    border: 1px solid var(--notion-border);
    border-radius: var(--notion-radius-sm);
    padding: 16px;
    margin-bottom: 12px;
}

.panel h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--notion-text-default);
    margin-bottom: 12px;
}

/* ========== 模态框 ========== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 15, 15, 0.6);
}

.modal-content {
    background-color: var(--notion-bg-default);
    margin: clamp(24px, 6vh, 64px) auto;
    border-radius: var(--notion-radius-sm);
    width: clamp(320px, 92vw, 1100px);
    max-width: 1100px;
    box-shadow: var(--notion-shadow-lg);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - clamp(96px, 20vh, 160px));
}

.modal-content.modal-large {
    max-width: min(90vw, 1300px);  /* 自适应：最大90%视口宽度或1300px */
    width: 90vw;
}

/* 英文版需要更多空间 - 自适应 */
html[lang="en"] .modal-content.modal-large {
    max-width: min(92vw, 1400px);
    width: clamp(85vw, 90vw, 92vw);  /* 自适应宽度 */
    max-height: clamp(calc(100vh - 120px), calc(100vh - 100px), calc(100vh - 80px)) !important;  /* 自适应高度 */
}

.modal-content.modal-xlarge {
    max-width: 1400px;
}

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

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--notion-text-default);
    margin: 0;
}

.modal-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

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

.close, .modal-close {
    color: var(--notion-text-light);
    font-size: 24px;
    font-weight: 400;
    cursor: pointer;
    transition: var(--notion-transition);
    background: none;
    border: none;
    padding: 4px 8px;
    border-radius: var(--notion-radius-sm);
}

.close:hover,
.close:focus,
.modal-close:hover {
    color: var(--notion-text-default);
    background: var(--notion-bg-hover);
}

/* ========== 表格 ========== */
.prompts-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--notion-bg-default);
    border: 1px solid var(--notion-border);
    border-radius: var(--notion-radius-sm);
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.prompts-table thead {
    background: var(--notion-bg-gray);
    position: sticky;
    top: 0;
    z-index: 10;
}

.prompts-table th {
    padding: 8px 12px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--notion-text-gray);
    border-bottom: 1px solid var(--notion-border);
    background: var(--notion-bg-gray);
}

.prompts-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--notion-border);
    font-size: 14px;
    color: var(--notion-text-default);
}

.prompts-table tbody tr:hover {
    background: var(--notion-bg-gray);
}

.prompts-table tbody tr:last-child td {
    border-bottom: none;
}

/* ========== 状态标签 ========== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border-radius: var(--notion-radius-sm);
    font-size: 12px;
    font-weight: 500;
}

.status-badge.status-waiting {
    background: var(--notion-yellow-bg);
    color: var(--notion-yellow);
}

.status-badge.status-processing {
    background: var(--notion-blue-bg);
    color: var(--notion-blue);
}

.status-badge.status-success {
    background: var(--notion-green-bg);
    color: var(--notion-green);
}

.status-badge.status-error {
    background: var(--notion-red-bg);
    color: var(--notion-red);
}

.status-badge.status-interrupted {
    background: var(--notion-yellow-bg);
    color: var(--notion-yellow);
}

/* ========== Toast 通知 ========== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--notion-text-default);
    color: white;
    padding: 12px 16px;
    border-radius: var(--notion-radius-sm);
    box-shadow: var(--notion-shadow-lg);
    z-index: 2000;
    font-size: 14px;
}

.toast.success {
    background: var(--notion-green);
}

.toast.error {
    background: var(--notion-red);
}

.toast.info {
    background: var(--notion-blue);
}

/* ========== 进度信息 ========== */
.progress-info {
    background: var(--notion-bg-default);
    border: 1px solid var(--notion-border);
    border-radius: var(--notion-radius-sm);
    padding: 16px;
    margin-bottom: 16px;
}

.progress-stats-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.stats-badges {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.stat-badge {
    display: inline-flex;
    flex-direction: column;
    padding: 8px 12px;
    background: var(--notion-bg-gray);
    border-radius: var(--notion-radius-sm);
    gap: 4px;
}

.stat-badge .stat-label {
    font-size: 11px;
    color: var(--notion-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-badge strong {
    font-size: 18px;
    font-weight: 600;
    color: var(--notion-text-default);
}

.stat-badge.stat-success strong {
    color: var(--notion-green);
}

.stat-badge.stat-fail strong {
    color: var(--notion-red);
}

.stat-badge.stat-processing strong {
    color: var(--notion-blue);
}

/* ========== 进度条 ========== */
.progress-bar-container {
    width: 100%;
    height: 6px;
    background: var(--notion-bg-active);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 12px;
}

.progress-bar {
    height: 100%;
    background: var(--notion-text-default);
    transition: width 0.3s ease;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-text {
    font-size: 11px;
    color: white;
    font-weight: 600;
}

.current-task {
    margin-top: 12px;
    padding: 8px 12px;
    background: var(--notion-bg-gray);
    border-radius: var(--notion-radius-sm);
    font-size: 13px;
    color: var(--notion-text-gray);
}

.current-task-label {
    font-weight: 600;
    margin-right: 8px;
}

/* ========== 视图切换 ========== */
.view-switcher {
    display: inline-flex;
    gap: 2px;
    background: var(--notion-bg-gray);
    padding: 2px;
    border-radius: var(--notion-radius-sm);
}

.view-btn {
    padding: 4px 10px;
    border: none;
    background: transparent;
    color: var(--notion-text-gray);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--notion-radius-sm);
    transition: var(--notion-transition);
}

.view-btn:hover {
    color: var(--notion-text-default);
    background: var(--notion-bg-hover);
}

.view-btn.active {
    background: var(--notion-bg-default);
    color: var(--notion-text-default);
    box-shadow: var(--notion-shadow-sm);
}

/* ========== 筛选按钮 ========== */
.filter-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 4px 10px;
    border: 1px solid var(--notion-border);
    border-radius: var(--notion-radius-sm);
    background: var(--notion-bg-default);
    color: var(--notion-text-gray);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--notion-transition);
}

.filter-btn:hover {
    background: var(--notion-bg-hover);
    color: var(--notion-text-default);
}

.filter-btn.active {
    background: var(--notion-text-default);
    color: white;
    border-color: var(--notion-text-default);
}

/* ========== 工具栏 ========== */
.toolbar {
    background: var(--notion-bg-default);
    border: 1px solid var(--notion-border);
    border-radius: var(--notion-radius-sm);
    padding: 12px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

/* 移动端精简工具栏显示，隐藏原工具栏 */
@media (max-width: 768px) {
    .toolbar { display: none; }
    #toolbarMobile { display: block !important; }
}

.toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
}

.toolbar-spacer {
    flex: 1;
}

/* 下拉菜单 */
.dropdown-container {
    position: relative;
}

.status-dropdown,
.batch-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: var(--notion-bg-default);
    border: 1px solid var(--notion-border);
    border-radius: var(--notion-radius-sm);
    box-shadow: var(--notion-shadow-lg);
    padding: 8px;
    min-width: 280px;
    z-index: 100;
}

.batch-section {
    padding: 8px 0;
}

.batch-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--notion-text-gray);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section-icon {
    font-size: 14px;
}

.batch-cards {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.batch-card {
    flex: 1;
    min-width: 80px;
    padding: 12px;
    background: var(--notion-bg-gray);
    border: 1px solid var(--notion-border);
    border-radius: var(--notion-radius-sm);
    cursor: pointer;
    transition: var(--notion-transition);
    text-align: center;
}

.batch-card:hover {
    background: var(--notion-bg-hover);
    box-shadow: var(--notion-shadow-sm);
}

.batch-card.delete-card:hover {
    border-color: var(--notion-red);
    background: var(--notion-red-bg);
}

.batch-card.retry-card:hover {
    border-color: var(--notion-blue);
    background: var(--notion-blue-bg);
}

.card-emoji {
    font-size: 24px;
    margin-bottom: 4px;
}

.card-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--notion-text-default);
    margin-bottom: 2px;
}

.card-count {
    font-size: 18px;
    font-weight: 600;
    color: var(--notion-text-default);
}

.card-sublabel {
    font-size: 10px;
    color: var(--notion-text-light);
    margin-top: 2px;
}

.dropdown-divider {
    height: 1px;
    background: var(--notion-border);
    margin: 8px 0;
}

/* ========== 提示词容器 ========== */
.prompts-container {
    background: var(--notion-bg-default);
    border: 1px solid var(--notion-border);
    border-radius: var(--notion-radius-sm);
    overflow-y: auto;  /* ✅ 改为 auto，支持 sticky */
    overflow-x: auto;
    max-height: calc(100vh - 450px);
    min-height: 400px;
    padding: 0;
    margin: 0;
}

.view-content {
    min-height: 400px;
    max-height: calc(100vh - 450px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    margin: 0;
}

/* 滚动条样式 */
.view-content::-webkit-scrollbar {
    width: 8px;
}

.view-content::-webkit-scrollbar-track {
    background: var(--notion-bg-gray);
    border-radius: 4px;
}

.view-content::-webkit-scrollbar-thumb {
    background: var(--notion-border);
    border-radius: 4px;
}

.view-content::-webkit-scrollbar-thumb:hover {
    background: var(--notion-text-light);
}

/* ========== 网格视图 ========== */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
    padding: 16px;
}

.grid-card {
    background: var(--notion-bg-default);
    border: 1px solid var(--notion-border);
    border-radius: var(--notion-radius-sm);
    overflow: hidden;
    cursor: pointer;
    transition: var(--notion-transition);
}

.grid-card:hover {
    box-shadow: var(--notion-shadow-md);
}

.grid-card-header {
    padding: 12px;
    border-bottom: 1px solid var(--notion-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.grid-card-body {
    padding: 12px;
}

.grid-card-footer {
    padding: 12px;
    border-top: 1px solid var(--notion-border);
    display: flex;
    gap: 8px;
}

.grid-card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: var(--notion-bg-gray);
}

.grid-card-prompt {
    font-size: 13px;
    color: var(--notion-text-gray);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========== 主内容区 ========== */
.main-content {
    display: flex;
    min-height: calc(100vh - 56px);
    background: var(--notion-bg-gray);
}

.workspace {
    flex: 1;
    padding: 20px;
    background: var(--notion-bg-gray);
    overflow-y: auto;
}

/* ========== 侧边栏 ========== */
.sidebar {
    background: var(--notion-bg-default);
    border-right: 1px solid var(--notion-border);
    padding: 20px;
}

.sidebar-overlay {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    display: none;
    z-index: 1100;
}

@media (max-width: 768px) {
    .sidebar.open + .workspace { pointer-events: none; }
}

/* ========== 提示词模板库 ========== */
.template-library-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    height: calc(100vh - 300px);
    max-height: 700px;
    min-height: 500px;
}

.template-top-bar {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 12px;
    background: var(--notion-bg-default);
    border: 1px solid var(--notion-border);
    border-radius: var(--notion-radius-sm);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.template-tabs {
    display: flex;
    gap: 2px;
    background: var(--notion-bg-gray);
    padding: 2px;
    border-radius: var(--notion-radius-sm);
}

.template-tab {
    padding: 6px 12px;
    background: transparent;
    border: none;
    color: var(--notion-text-gray);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--notion-transition);
    border-radius: var(--notion-radius-sm);
}

.template-tab:hover {
    color: var(--notion-text-default);
    background: var(--notion-bg-hover);
}

.template-tab.active {
    background: var(--notion-bg-default);
    color: var(--notion-text-default);
    box-shadow: var(--notion-shadow-sm);
}

.template-search-box {
    flex: 1;
    max-width: 400px;
}

.template-main-content {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 16px;
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
    margin-top: 16px;
}

.template-categories-panel {
    background: var(--notion-bg-default);
    border: 1px solid var(--notion-border);
    border-radius: var(--notion-radius-sm);
    padding: 12px;
    align-self: flex-start;
    position: sticky;
    top: 0;
}

.template-panel-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--notion-text-light);
    margin: 0 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.template-categories-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.template-category-item {
    padding: 6px 10px;
    background: transparent;
    border-radius: var(--notion-radius-sm);
    cursor: pointer;
    transition: var(--notion-transition);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--notion-text-default);
}

.template-category-item:hover {
    background: var(--notion-bg-hover);
}

.template-category-item.active {
    background: var(--notion-bg-active);
}

.category-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.category-info {
    flex: 1;
}

.category-name {
    font-size: 14px;
    font-weight: 500;
}

.category-count {
    font-size: 12px;
    color: var(--notion-text-light);
}

.template-content-panel {
    background: var(--notion-bg-default);
    border: 1px solid var(--notion-border);
    border-radius: var(--notion-radius-sm);
    padding: 16px;
}

.template-view {
    display: none;
}

.template-view.active {
    display: block;
}

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

.template-card {
    background: var(--notion-bg-default);
    border: 1px solid var(--notion-border);
    border-radius: var(--notion-radius-sm);
    padding: 12px;
    cursor: pointer;
    transition: var(--notion-transition);
    overflow: hidden;
    position: relative;
}

.template-card:hover {
    box-shadow: var(--notion-shadow-md);
    border-color: var(--notion-text-default);
}

/* 提示用户可以悬停查看完整提示词 */
.template-card::after {
    content: '💡 悬停查看完整提示词';
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 11px;
    color: var(--notion-text-gray);
    background: var(--notion-bg-gray);
    padding: 2px 6px;
    border-radius: 3px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.template-card:hover::after {
    opacity: 1;
}

.template-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.template-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--notion-text-default);
    line-height: 1.4;
}

.template-favorite-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 2px;
    opacity: 0.5;
    transition: var(--notion-transition);
}

.template-favorite-btn:hover {
    opacity: 1;
}

.template-favorite-btn.active {
    opacity: 1;
}

.template-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

.template-tag {
    padding: 2px 8px;
    background: var(--notion-bg-gray);
    color: var(--notion-text-gray);
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--notion-radius-sm);
}

.template-description {
    font-size: 13px;
    color: var(--notion-text-gray);
    line-height: 1.5;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.template-prompt-preview {
    padding: 8px;
    background: var(--notion-bg-gray);
    border-radius: var(--notion-radius-sm);
    font-size: 12px;
    color: var(--notion-text-light);
    line-height: 1.5;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

.template-card-footer {
    display: flex;
    gap: 6px;
}

.template-apply-btn {
    flex: 1;
    padding: 6px 12px;
    background: var(--notion-text-default);
    border: none;
    border-radius: var(--notion-radius-sm);
    color: white;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--notion-transition);
}

.template-apply-btn:hover {
    background: rgba(55, 53, 47, 0.9);
}

.template-preview-btn {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--notion-border);
    border-radius: var(--notion-radius-sm);
    color: var(--notion-text-gray);
    font-size: 13px;
    cursor: pointer;
    transition: var(--notion-transition);
}

.template-preview-btn:hover {
    background: var(--notion-bg-hover);
}

.template-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--notion-text-light);
}

.template-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.template-empty-text {
    font-size: 14px;
    color: var(--notion-text-gray);
    margin-bottom: 6px;
}

.template-empty-hint {
    font-size: 13px;
    color: var(--notion-text-light);
}

.search-results-header {
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--notion-border);
}

.search-results-header h4 {
    font-size: 14px;
    color: var(--notion-text-default);
    margin: 0;
    font-weight: 600;
}

.template-footer-info {
    flex: 1;
    font-size: 12px;
    color: var(--notion-text-light);
}

/* ========== 响应式 ========== */
@media (max-width: 1024px) {
    .template-main-content {
        grid-template-columns: 180px 1fr;
    }

    .template-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-group {
        justify-content: space-between;
    }

    .grid-container {
        grid-template-columns: 1fr;
    }

    .template-top-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .template-main-content {
        grid-template-columns: 1fr;
    }

    .template-categories-panel {
        padding: 8px;
    }

    .template-categories-list {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .template-grid {
        grid-template-columns: 1fr;
    }
}

/* ========== 模型管理样式 ========== */
/* 模型复选框项 */
#discoveredModels label,
#customModelsList > div {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    margin-bottom: 8px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#discoveredModels label:hover,
#customModelsList > div:hover {
    background: #f8f9fa;
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
    transform: translateX(4px);
}

#discoveredModels input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    cursor: pointer;
    accent-color: #667eea;
}

#discoveredModels .model-badge,
#customModelsList .model-badge {
    display: inline-block;
    padding: 3px 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 11px;
    font-weight: 500;
    border-radius: 12px;
    margin-left: 8px;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

/* 输入框获取焦点效果 */
.form-control:focus {
    outline: none;
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
}

/* 模型状态指示器 */
.model-status-success {
    color: #4caf50;
    font-weight: 500;
}

.model-status-error {
    color: #f44336;
    font-weight: 500;
}

/* 空状态显示 */
.model-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.model-empty-state-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.model-empty-state-text {
    font-size: 14px;
    color: #666;
}

/* ========== 项目分组样式 ========== */
.project-header {
    position: sticky;
    top: 30px;
    z-index: 9;
    background: #f0f0f0;
}

.project-header:first-of-type {
    margin-top: 0;
}

.project-action-btn {
    padding: 4px 12px;
    margin-left: 8px;
    font-size: 12px;
    border: 1px solid var(--notion-border);
    background: white;
    border-radius: var(--notion-radius-sm);
    cursor: pointer;
    transition: var(--notion-transition);
}

.project-action-btn:hover {
    background: var(--notion-bg-gray);
    border-color: var(--notion-text-default);
}

.project-action-btn.delete {
    color: var(--notion-red);
    border-color: var(--notion-red);
}

.project-action-btn.delete:hover {
    background: var(--notion-red-bg);
}

/* ========== 任务进度条样式 ========== */
.task-progress-bar {
    position: relative;
    width: 100%;
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 8px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.task-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.task-progress-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0.3) 50%,
        rgba(255,255,255,0) 100%
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.task-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: 600;
    color: #333;
    text-shadow: 0 0 3px rgba(255,255,255,0.8);
    z-index: 1;
}

.task-progress-message {
    margin-top: 6px;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

/* ========== 网格视图优化 ========== */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    padding: 16px;
}

.grid-card {
    background: var(--notion-bg-default);
    border: 2px solid var(--notion-border);
    border-radius: var(--notion-radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.grid-card:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    transform: translateY(-4px);
    border-color: var(--notion-text-default);
}

.grid-card-header {
    padding: 14px;
    border-bottom: 2px solid var(--notion-border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    background: var(--notion-bg-gray);
}

.grid-card-number {
    font-weight: 600;
    font-size: 13px;
    color: var(--notion-text-default);
    font-family: monospace;
}

.grid-card-body {
    padding: 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.grid-card-prompt {
    font-size: 13px;
    color: var(--notion-text-default);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.grid-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--notion-bg-gray);
    border-radius: var(--notion-radius-sm);
}

.grid-card-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--notion-text-gray);
    font-size: 14px;
    border-radius: var(--notion-radius-sm);
}

.grid-card-footer {
    padding: 12px 14px;
    border-top: 2px solid var(--notion-border);
    display: flex;
    gap: 8px;
    align-items: center;
    background: var(--notion-bg-gray);
}

.grid-card-status {
    flex: 1;
}

.grid-card-actions {
    display: flex;
    gap: 6px;
}

.grid-card-actions button {
    padding: 6px 10px;
    font-size: 12px;
    border: none;
    border-radius: var(--notion-radius-sm);
    cursor: pointer;
    transition: var(--notion-transition);
}

.grid-card-meta {
    font-size: 11px;
    color: var(--notion-text-gray);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.grid-card-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ========== 模板库滚动条美化 ========== */
.template-main-content::-webkit-scrollbar {
    width: 8px;
}

.template-main-content::-webkit-scrollbar-track {
    background: var(--notion-bg-gray);
    border-radius: 10px;
}

.template-main-content::-webkit-scrollbar-thumb {
    background: var(--notion-border);
    border-radius: 10px;
    transition: background 0.3s ease;
}

.template-main-content::-webkit-scrollbar-thumb:hover {
    background: var(--notion-text-gray);
}

/* 模板库模态框特殊样式：禁用modal-body的滚动 */
#templateLibraryModal .modal-body {
    overflow: hidden;
    max-height: none;
}

/* ========== Mobile-first / Touch Improvements (updated) ========== */
/* 统一将<=768px视为移动/平板：侧边栏抽屉、导航精简、触控友好 */
@media (max-width: 768px) {
    /* 顶部导航简化 */
    .nav-stats { display: none !important; }
    .nav-left .app-logo { font-size: 15px; }
    .app-logo span:not(.logo-icon) { display: none; }

    /* 侧边栏：默认收起，可通过 JS 切换 .sidebar.open 展示 */
    .sidebar {
        position: fixed;
        top: 56px;
        left: -280px;
        width: 280px;
        height: calc(100vh - 56px);
        padding: 16px;
        transition: left 240ms ease;
        z-index: 1200;
        box-shadow: 0 8px 24px rgba(0,0,0,0.12);
        overflow-y: auto;
    }
    .sidebar.open { left: 0; }

    /* 主内容适配：避免内容在侧栏下被遮挡 */
    .main-content { margin-left: 0; }

    /* 工具栏与按钮触控友好 */
    .toolbar { padding: 10px; gap: 10px; }
    .btn, .template-apply-btn, .template-preview-btn { min-height: 44px; min-width: 44px; padding: 10px 14px; font-size: 15px; }
    .btn-sm { padding: 8px 12px; }

    /* 网格视图与卡片调整 */
    .grid-container { grid-template-columns: 1fr; gap: 12px; padding: 12px; }
    .grid-card-image, .grid-card-placeholder { height: 160px; }
    .grid-card-body { padding: 12px; }

    /* 模态框占满更大屏幕空间 */
    .modal-content { width: 96%; margin: 8% auto; max-width: 720px; }

    /* 提示词容器减小高度以适配小屏 */
    .prompts-container { max-height: calc(100vh - 300px); min-height: 260px; }

    /* 提高触控目标的间距，避免误触 */
    .toolbar-group > *, .filter-buttons > *, .template-card-footer > * { touch-action: manipulation; }

    /* 增强滚动区域识别 */
    .view-content, .template-main-content { -webkit-overflow-scrolling: touch; }
}
#aboutModal .about-grid {
    display: grid;
    /* 固定三列布局 */
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    align-items: start;  /* 改为start，避免高度不一致时的问题 */
}

/* 英文版保持三列，但优化字体和间距 */
html[lang="en"] #aboutModal .about-grid {
    gap: 12px;
}

#aboutModal .about-col {
    display: grid;
    gap: 16px;
    min-width: 0;  /* 允许内容收缩，防止溢出 */
}

/* 小于1024px时改为单列 */
@media (max-width: 1024px) {
    #aboutModal .about-grid {
        grid-template-columns: 1fr;
    }
    #aboutModal .about-col {
        grid-auto-flow: row;
    }
}

@media (max-width: 768px) {
    #aboutModal .about-grid {
        gap: 12px;
        grid-template-columns: 1fr;
    }
    #aboutModal .about-col > div { margin-bottom: 12px; }
    #aboutModal .about-changelog { max-height: none; }
}
#loadingPage.loading-page { position: fixed; inset: 0; background: #f7f7fb; display: none; align-items: center; justify-content: center; z-index: 2000; }
.loading-page { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 2000; background: transparent; }
.loading-page.fade-in { animation: lp_fade .25s ease-out; }
@keyframes lp_fade { from { opacity: 0 } to { opacity: 1 } }
.loading-iframe { width: 100vw; height: 100vh; border: none; border-radius: 0; box-shadow: none; background: transparent; }
@media (max-width: 768px) { .loading-card { width: 96vw; padding: 16px; } .loading-grid { grid-template-columns: 1fr; } .loading-feature-row { grid-template-columns: repeat(2, 1fr); } }
#aboutModal .about-col:last-child > div {
    height: 100%;
    display: flex;
    flex-direction: column;
}

#aboutModal .about-changelog {
    line-height: 1.8;
    font-size: 13px;
    flex: 1;
    overflow-y: auto;
    padding-right: 6px;
    border-bottom: 1px solid var(--notion-border);
    max-height: 400px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

#aboutModal .about-changelog ul {
    padding-left: 18px;
    margin: 8px 0;
}

#aboutModal .about-changelog li {
    margin-bottom: 4px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* English version specific adjustments - 自适应版本 */
html[lang="en"] #aboutModal .about-changelog {
    font-size: clamp(12px, 1.2vw, 13px);     /* 自适应字体 12-13px */
    line-height: clamp(1.5, 1.6, 1.7);       /* 自适应行高 */
    max-height: clamp(400px, 60vh, 600px);   /* 自适应高度 */
    overflow-y: auto !important;
    padding-bottom: clamp(15px, 3vh, 25px);  /* 自适应底部间距 */
}

html[lang="en"] #aboutModal .about-changelog li {
    margin-bottom: clamp(2px, 0.3vh, 4px);   /* 自适应列表间距 */
    font-size: clamp(11.5px, 1.1vw, 12.5px); /* 自适应字体 */
}

html[lang="en"] #aboutModal .about-changelog div[style*="font-weight:600"] {
    font-size: clamp(13px, 1.3vw, 14px) !important;      /* 自适应标题字体 */
    margin-top: clamp(4px, 0.8vh, 8px) !important;       /* 自适应上边距 */
    margin-bottom: clamp(3px, 0.6vh, 6px) !important;    /* 自适应下边距 */
    font-weight: 700 !important;
}

/* English version - 大字体舒适版 */
html[lang="en"] #aboutModal .about-col > div {
    padding: 12px !important;   /* 恢复接近原始内边距 */
    font-size: 13.5px;          /* 接近中文版大小 */
}

html[lang="en"] #aboutModal .about-col > div > div {
    font-size: 13.5px;
    line-height: 1.7;
}

/* 英文版按钮字体 */
html[lang="en"] #aboutModal .btn {
    font-size: 12px;        /* 与中文版相同 */
    padding: 8px 14px;
}

/* 英文版标题字体 */
html[lang="en"] #aboutModal .about-col > div > div[style*="font-weight: 600"] {
    font-size: 14px !important;
}

html[lang="en"] #aboutModal .about-grid {
    gap: 15px;  /* 增加列间距 */
}

/* Ensure modal content doesn't overflow */
#aboutModal .modal-body {
    overflow-x: hidden;
    overflow-y: auto;
    max-height: 75vh;
}

#aboutModal .about-grid {
    overflow-x: hidden;
}

#aboutModal .about-col {
    min-width: 0;
    overflow-wrap: break-word;
}

/* Better responsive handling for medium screens */
@media (max-width: 1400px) and (min-width: 1025px) {
    #aboutModal .about-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
    }

    #aboutModal .about-col > div {
        padding: 10px !important;
        font-size: 12px;
    }

    #aboutModal .about-changelog {
        font-size: 11px;
        line-height: 1.5;
        max-height: 350px;
    }
}

/* ===== 加载页面样式 ===== */
#loadingPage.loading-page {
    position: fixed;
    inset: 0;
    background: #f7f7fb;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.loading-page {
    position: fixed;
    inset: 0;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 16px;
    overflow: hidden;
}

/* 背景装饰 */
.loading-bg-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.4;
    pointer-events: none;
}

.loading-bg-glow-1 {
    position: absolute;
    top: 0;
    left: 25%;
    width: 384px;
    height: 384px;
    background: rgba(191, 219, 254, 0.4);
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
    mix-blend-mode: multiply;
    animation: loading-pulse 3s ease-in-out infinite;
}

.loading-bg-glow-2 {
    position: absolute;
    bottom: 0;
    right: 25%;
    width: 384px;
    height: 384px;
    background: rgba(233, 213, 255, 0.4);
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
    mix-blend-mode: multiply;
}

@keyframes loading-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 主卡片 */
.loading-card {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1152px;
    max-height: 85vh;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.5s;
}

/* Header Section */
.loading-header-section {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(12px);
    padding: 24px 32px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.loading-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.loading-icon-wrapper {
    position: relative;
}

.loading-icon-glow {
    position: absolute;
    inset: -4px;
    background: linear-gradient(to right, #2563eb, #4f46e5);
    border-radius: 12px;
    filter: blur(4px);
    opacity: 0.25;
    transition: opacity 0.2s;
}

.loading-icon-wrapper:hover .loading-icon-glow {
    opacity: 0.5;
}

.loading-icon {
    position: relative;
    background: white;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    font-size: 24px;
    line-height: 1;
}

.loading-title {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.loading-beta-badge {
    background: #f3f4f6;
    color: #6b7280;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 9999px;
    border: 1px solid #d1d5db;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-weight: 500;
}

.loading-subtitle {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.loading-terminal-icon {
    font-size: 12px;
}

.loading-header-right {
    text-align: right;
}

.loading-enterprise-badge {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
    color: #111827;
}

.loading-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: loading-pulse 2s ease-in-out infinite;
}

.loading-sle-text {
    font-size: 10px;
    color: #9ca3af;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    margin-top: 2px;
}

/* 内容区域 */
.loading-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px 32px 64px;
    min-height: 0;
}

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

.loading-content::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.loading-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.loading-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.loading-content-inner {
    max-width: 100%;
}

/* Feature Cards */
.loading-features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.loading-feature-card {
    background: #f9fafb;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    transition: all 0.2s;
}

.loading-feature-card:hover {
    border-color: #d1d5db;
}

.loading-feature-icon {
    font-size: 24px;
    transition: transform 0.2s;
}

.loading-feature-card:hover .loading-feature-icon {
    transform: scale(1.1);
}

.loading-feature-label {
    font-size: 12px;
    font-weight: 700;
    opacity: 0.9;
}

.loading-feature-blue {
    background: #eff6ff;
}
.loading-feature-blue .loading-feature-label { color: #2563eb; }

.loading-feature-purple {
    background: #faf5ff;
}
.loading-feature-purple .loading-feature-label { color: #9333ea; }

.loading-feature-green {
    background: #ecfdf5;
}
.loading-feature-green .loading-feature-label { color: #059669; }

.loading-feature-orange {
    background: #fff7ed;
}
.loading-feature-orange .loading-feature-label { color: #ea580c; }

/* Main Grid */
.loading-main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.loading-left-column, .loading-right-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Section */
.loading-section {
    background: white;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s;
}

.loading-section-hover:hover {
    box-shadow: 0 4px 6px rgba(0,0,0,0.07);
}

.loading-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #374151;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
}

.loading-section-icon {
    font-size: 16px;
    opacity: 0.6;
}

/* Specifications */
.loading-spec-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.loading-spec-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f9fafb;
}

.loading-spec-label {
    color: #6b7280;
    font-size: 14px;
}

.loading-spec-value {
    font-size: 14px;
}

.loading-spec-mono {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    background: #f3f4f6;
    color: #374151;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #d1d5db;
    font-size: 12px;
}

.loading-spec-link {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    color: #2563eb;
    font-weight: 600;
    cursor: pointer;
}

.loading-spec-link:hover {
    text-decoration: underline;
}

.loading-spec-small {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    color: #4b5563;
    font-size: 12px;
}

.loading-spec-description {
    margin-top: 16px;
    padding-top: 16px;
    font-size: 12px;
    color: #9ca3af;
    line-height: 1.6;
}

/* Modules */
.loading-modules-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.loading-module-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 500;
    color: #4b5563;
    background: #f9fafb;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s;
    cursor: default;
}

.loading-module-item:hover {
    background: #f3f4f6;
    color: #2563eb;
}

.loading-module-icon {
    font-size: 14px;
}

/* Authorization Card */
.loading-auth-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #d1d5db;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    overflow: hidden;
    position: relative;
    transition: box-shadow 0.2s;
}

.loading-auth-card:hover {
    box-shadow: 0 4px 6px rgba(0,0,0,0.07);
}

.loading-auth-accent {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    background: linear-gradient(to bottom, #3b82f6, #7c3aed);
}

.loading-auth-content {
    padding: 20px 20px 20px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.loading-auth-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.loading-auth-icon-wrapper {
    background: #eff6ff;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #bfdbfe;
    flex-shrink: 0;
    transition: background 0.2s;
}

.loading-auth-card:hover .loading-auth-icon-wrapper {
    background: #dbeafe;
}

.loading-auth-icon {
    font-size: 20px;
}

.loading-auth-label {
    font-size: 10px;
    color: #9ca3af;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-bottom: 4px;
}

.loading-auth-links {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.loading-auth-link-primary {
    font-size: 14px;
    font-weight: 900;
    color: #111827;
    letter-spacing: -0.02em;
    text-decoration: none;
    transition: color 0.2s;
}

.loading-auth-link-primary:hover {
    color: #1d4ed8;
}

.loading-auth-separator {
    color: #d1d5db;
    font-weight: 300;
}

.loading-auth-link-secondary {
    font-size: 14px;
    font-weight: 500;
    color: #4b5563;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    text-decoration: none;
    transition: color 0.2s;
}

.loading-auth-link-secondary:hover {
    color: #7c3aed;
}

.loading-auth-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.loading-auth-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
    color: #4b5563;
}

.loading-auth-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    animation: loading-pulse 2s ease-in-out infinite;
}

.loading-auth-copyright {
    font-size: 10px;
    color: #9ca3af;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

/* Changelog */
.loading-changelog-section {
    display: flex;
    flex-direction: column;
    min-height: 400px;
}

.loading-changelog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.loading-latest-badge {
    background: #d1fae5;
    color: #065f46;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 9999px;
    font-weight: 700;
}

.loading-timeline {
    position: relative;
    padding-left: 16px;
    border-left: 1px solid #d1d5db;
    display: flex;
    flex-direction: column;
    gap: 32px;
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
    margin-right: -8px;
}

.loading-timeline-item {
    position: relative;
}

.loading-timeline-dot {
    position: absolute;
    left: -21px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #d1d5db;
    border: 2px solid white;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.loading-timeline-dot-active {
    background: #3b82f6;
}

.loading-timeline-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 4px;
}

.loading-timeline-version {
    font-size: 12px;
    font-weight: 700;
    color: #111827;
}

.loading-timeline-date {
    font-size: 10px;
    color: #9ca3af;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

.loading-timeline-text {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.6;
    margin: 0;
}

/* Footer Section */
.loading-footer-section {
    background: rgba(249, 250, 251, 0.8);
    backdrop-filter: blur(12px);
    padding: 20px 32px;
    border-top: 1px solid #d1d5db;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.loading-footer-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.loading-ready-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #065f46;
    background: #d1fae5;
    padding: 6px 12px;
    border-radius: 9999px;
    border: 1px solid rgba(6, 95, 70, 0.2);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    position: relative;
}

.loading-ready-ping {
    position: absolute;
    left: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    opacity: 0.75;
    animation: loading-ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes loading-ping {
    75%, 100% {
        transform: scale(2);
        opacity: 0;
    }
}

.loading-ready-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    position: relative;
}

.loading-enter-hint {
    font-size: 10px;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 4px;
}

.loading-kbd {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    background: #d1d5db;
    padding: 2px 4px;
    border-radius: 3px;
    color: #4b5563;
    font-weight: 700;
    font-size: 10px;
}

.loading-enter-btn {
    position: relative;
    overflow: hidden;
    background: #111827;
    color: white;
    padding: 12px 32px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1), 0 10px 15px -3px rgba(59, 130, 246, 0.2);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.loading-enter-btn:hover {
    background: #000;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 20px 25px -5px rgba(59, 130, 246, 0.2);
}

.loading-enter-btn:active {
    transform: scale(0.95);
}

.loading-btn-shimmer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.1), transparent);
    transform: translateX(-100%);
}

.loading-enter-btn:hover .loading-btn-shimmer {
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    100% {
        transform: translateX(100%);
    }
}

.loading-btn-arrow {
    font-size: 16px;
    transition: transform 0.2s;
}

.loading-enter-btn:hover .loading-btn-arrow {
    transform: translateX(4px);
}

/* Version Footer */
.loading-version-footer {
    margin-top: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 10px;
    color: #9ca3af;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    opacity: 0.7;
    position: relative;
    z-index: 10;
}

/* 响应式 */
@media (max-width: 1024px) {
    .loading-main-grid {
        grid-template-columns: 1fr;
    }

    .loading-header-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .loading-header-right {
        text-align: left;
    }
}

@media (max-width: 768px) {
    .loading-card {
        width: 96vw;
        padding: 16px;
    }

    .loading-features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .loading-header-section,
    .loading-content,
    .loading-footer-section {
        padding-left: 20px;
        padding-right: 20px;
    }

    .loading-modules-grid {
        grid-template-columns: 1fr;
    }

    .loading-auth-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .loading-auth-right {
        align-items: flex-start;
    }

    .loading-enter-hint {
        display: none;
    }
}

/* 英文版 About 对话框 modal-body 增加高度 */
html[lang="en"] #aboutModal .modal-body {
    max-height: calc(100vh - 180px) !important;
    overflow-y: auto !important;
}

/* 英文版 about-grid 确保充分利用空间 */
html[lang="en"] #aboutModal .about-grid {
    min-height: 500px !important;
}
