/* === Custom Font === */
@font-face {
    font-family: 'AiDianQuYaYuan';
    src: url('../lib/font/AiDianQuYaYuan.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'SanJiYuanTiJian';
    src: url('../lib/font/SanJiYuanTiJian.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'SJxuniyishiqinghuan';
    src: url('../lib/font/SJxuniyishiqinghuan.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'AiDianQuYaYuan_Latin';
    src: url('../lib/font/AiDianQuYaYuan.ttf') format('truetype');
    unicode-range: U+0020-007E;
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* === CSS Variables === */
:root {
    --bg-main: #ffffff;
    --bg-workspace: #f8fafc;
    --bg-subtle: #f1f5f9;
    --bg-hover: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;
    --accent-color: #67778D;
    --accent-hover: #5a687c;
    --accent-light: rgba(103, 119, 141, 0.08);
    --accent-highlight: rgba(103, 119, 141, 0.12);
    --success-color: #22c55e;
    --success-light: rgba(34, 197, 94, 0.1);
    --error-bg: #fef2f2;
    --error-text: #dc2626;
    --error-border: #fecaca;
    --warning-bg: #fef3c7;
    --warning-text: #d97706;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.12);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;
    --preview-font-family: 'SanJiYuanTiJian', sans-serif;
}

[data-theme="dark"] {
    --bg-main: #0f172a;
    --bg-workspace: #1e293b;
    --bg-subtle: #334155;
    --bg-hover: #475569;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #334155;
    --border-hover: #475569;
    --accent-light: rgba(99, 102, 241, 0.15);
    --accent-highlight: rgba(99, 102, 241, 0.2);
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* === Base Styles === */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-font-smoothing: antialiased !important; -moz-osx-font-smoothing: grayscale !important; }

/* 全局字体：正常字体使用爱点趣雅圆 */
html, body {
    font-family: 'AiDianQuYaYuan', sans-serif;
    font-weight: 100;
}

input, textarea, select, button {
    font-family: inherit;
    font-weight: 100;
}

/* 全局加粗元素使用三极圆体简 */
b, strong {
    font-family: 'AiDianQuYaYuan', sans-serif;
    font-weight: 400;
}

/* 预览区字体切换 - 由JS动态控制CSS变量 */
.scene-printable-content {
    --normal-font: 'AiDianQuYaYuan_Latin', 'SanJiYuanTiJian', sans-serif;
    --bold-font: 'AiDianQuYaYuan', sans-serif;
    --bold-weight: 200;
    font-family: var(--normal-font);
    font-weight: 100;
    user-select: text;
    -webkit-user-select: text;
    cursor: text;
}

/* 预览区子元素继承字体 - 排除粗体元素 */
.scene-printable-content * {
    font-family: inherit;
}

/* 预览区选区字体覆盖 — 显式继承颜色，避免 span 包裹打破 CSS 变量继承链 */
.scene-printable-content .custom-font-override {
    font-family: var(--custom-font-override, inherit) !important;
    color: inherit;
}

/* 预览区选区字重覆盖 */
.scene-printable-content .custom-weight-override {
    font-weight: var(--custom-weight-override, inherit) !important;
    color: inherit;
}

/* 预览区选区字号覆盖 */
.scene-printable-content .custom-size-override {
    font-size: var(--custom-size-override, inherit) !important;
    color: inherit;
}

/* 预览区时间元素使用CSS变量 */
.scene-printable-content .exp-date {
    font-family: var(--normal-font);
}

/* 预览区加粗文字使用加粗字体变量 - 优先级最高 */
.scene-printable-content b,
.scene-printable-content strong,
.scene-printable-content .bold-text,
.scene-printable-content .section-title,
.scene-printable-content .product-name,
.scene-printable-content .advantage-title,
.scene-printable-content .function-title,
.scene-printable-content .scene-title,
.scene-printable-content .resume-name,
.scene-printable-content .resume-section-title,
.scene-printable-content .exp-role,
.scene-printable-content .proj-name {
    font-weight: var(--bold-weight, 700);
    font-family: var(--bold-font) !important;
}

/* 选区字体：用户手动指定的字体优先级最高，覆盖全局变量 */
.scene-printable-content .custom-font-override,
.scene-printable-content .custom-font-override b,
.scene-printable-content .custom-font-override strong {
    font-family: var(--custom-font-override) !important;
    color: inherit;
}

/* 选区字重：用户手动指定的字重优先级最高 */
.scene-printable-content .custom-weight-override,
.scene-printable-content .custom-weight-override b,
.scene-printable-content .custom-weight-override strong {
    font-weight: var(--custom-weight-override) !important;
    color: inherit;
}

/* 选区字号：用户手动指定的字号优先级最高 */
.scene-printable-content .custom-size-override {
    font-size: var(--custom-size-override) !important;
    color: inherit;
}
/* 等宽数字元素使用系统 monospace */
.scene-printable-content .item-meta,
.scene-printable-content .skill-level-num,
.item-meta, .skill-level-num, .lang-preview-btn .lang-text, .select-trigger.mini {
    font-family: monospace !important;
}

/* === 全局隐藏滚动条 === */
* { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { width: 0; height: 0; display: none; }
html, body { height: 100%; margin: 0; padding: 0; font-family: 'AiDianQuYaYuan', sans-serif; overflow: hidden; }

/* === 水印样式 === */
.anti-theft-watermark {
    position: absolute;
    pointer-events: none;
    z-index: 0;
    user-select: none;
    white-space: nowrap;
    font-family: 'AiDianQuYaYuan', sans-serif;
    opacity: 0.3;
}
.editor-anti-theft {
    position: absolute;
    pointer-events: none;
    z-index: 10;
    user-select: none;
    white-space: nowrap;
    font-family: 'AiDianQuYaYuan', sans-serif;
    opacity: 0.15;
}
.preview-anti-theft {
    position: absolute;
    pointer-events: none;
    z-index: -1;
    user-select: none;
    white-space: nowrap;
    font-family: 'AiDianQuYaYuan', sans-serif;
    opacity: 0.2;
}

#app { height: 100%; width: 100%; background-color: var(--bg-main); color: var(--text-primary); display: flex; flex-direction: column; }
.app-container { height: 100%; width: 100%; display: flex; flex-direction: column; overflow: hidden; }
.main-content-wrapper { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.main-layout { display: grid; grid-template-columns: 44.4% 1.5rem 1fr; flex: 1 1 0; min-height: 0; gap: 15px; padding: 0.5rem 15px; min-width: 0; transition: grid-template-columns 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
@media (max-width: 1440px) {
    .main-layout { grid-template-columns: 40% 1.5rem 1fr; }
}
.main-layout.is-resizing { transition: none !important; }

/* === Naive UI Popover 距离调整 === */
body .n-popover,
body .n-popover__content,
.n-popover.n-popover--bottom,
.n-popover[data-placement="bottom"] { margin-top: 5px !important; }

/* ==========================================
   响应式标题 - 所有模块标题随页面宽度流式缩放
   使用 var(--scale-factor) 实现等比缩放
   ========================================== */

/* --- 甜美模块标题 --- */
/* (Removed hardcoded font-sizes overriding sweet modules) */

/* --- 产品模块标题 --- */
.module-wrapper .section-title {
    font-size: calc(32px * var(--scale-factor, 1)) !important;
}
.module-wrapper .product-overview-title,
.module-wrapper .overview-title {
    font-size: calc(33px * var(--scale-factor, 1)) !important;
}
.module-wrapper .overview-subtitle,
.module-wrapper .overview-highlight,
.module-wrapper .product-overview-subtitle,
.module-wrapper .product-overview-highlight {
    font-size: calc(17px * var(--scale-factor, 1)) !important;
}
.module-wrapper .advantage-title {
    font-size: calc(17px * var(--scale-factor, 1)) !important;
}
.module-wrapper .function-title {
    font-size: calc(25px * var(--scale-factor, 1)) !important;
}
.module-wrapper .scene-title {
    font-size: calc(16px * var(--scale-factor, 1)) !important;
}
.module-wrapper .notice-title {
    font-size: calc(16px * var(--scale-factor, 1)) !important;
}
.module-wrapper .spec-title {
    font-size: calc(16px * var(--scale-factor, 1)) !important;
}

/* --- 简历模块标题 --- */
.module-wrapper .resume-section-title {
    font-size: calc(28px * var(--scale-factor, 1)) !important;
}
