      /* CSS 变量兼容垫片 (修复 d03c9548 改名遗留) */
      :root {
        /* color-* 家族 → 新设计系统 */
        --color-bg-deep: var(--bg-deep, #0a0a0f);
        --color-bg-surface: var(--bg-surface, #12121a);
        --color-bg-subtle: var(--bg-card, #1a1a24);
        --color-bg-card: var(--bg-card, #1a1a24);
        --color-bg-input: var(--bg-input, #0e0e14);
        --color-text-primary: var(--text-primary, #e8e8ed);
        --color-text-secondary: var(--text-secondary, #8888a0);
        --color-text-muted: var(--text-muted, #55556a);
        --color-border-default: var(--border-subtle, #2a2a3a);
        --color-border-subtle: var(--border-subtle, #2a2a3a);
        --color-border-strong: var(--border-strong, #3a3a4a);
        --color-accent-primary: var(--accent-cyan, #00f5d4);
        --color-accent-secondary: var(--accent-magenta, #f72585);
        --color-accent-tertiary: var(--accent-blue, #4cc9f0);
        --color-accent-cyan: var(--accent-cyan, #00f5d4);
        --color-accent-purple: var(--accent-purple, #8b5cf6);
        --color-accent-pink: var(--accent-magenta, #f72585);
        --color-accent-orange: #ff9f1c;
        --color-success: var(--accent-green, #10b981);
        --color-warning: var(--accent-yellow, #fbbf24);
        --color-error: var(--accent-red, #f43f5e);
        --color-danger: var(--accent-red, #f43f5e);
        --color-info: var(--accent-blue, #4cc9f0);
        --color-safe: var(--accent-green, #10b981);

        /* 玻璃拟态 */
        --glass-bg: rgba(26, 26, 36, 0.72);
        --glass-border: rgba(255, 255, 255, 0.08);
        --glass-blur: 24px;
        --glass-saturate: 180%;
        --glass-radius: 16px;
        --glass-border-width: 1px;
        --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);

        /* 间距尺度 */
        --space-1: 4px;
        --space-2: 8px;
        --space-3: 12px;
        --space-4: 16px;
        --space-5: 20px;
        --space-6: 24px;
        --space-8: 32px;
        --spacing-sm: 8px;
        --spacing-md: 16px;
        --spacing-lg: 24px;
        --spacing-card: 16px;

        /* 阴影 */
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
        --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
        --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
        --shadow-glow: 0 0 20px rgba(0, 245, 212, 0.15);
        --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);

        /* 辉光 */
        --glow-cyan: 0 0 20px rgba(0, 245, 212, 0.4);
        --glow-purple: 0 0 20px rgba(139, 92, 246, 0.4);
        --glow-green: 0 0 20px rgba(16, 185, 129, 0.4);
        --glow-red: 0 0 20px rgba(244, 63, 94, 0.4);
        --glow-magenta: 0 0 20px rgba(247, 37, 133, 0.4);
        --accent-glow: 0 0 20px rgba(0, 245, 212, 0.4);

        /* 过渡 */
        --transition-fast: 150ms ease;
        --transition-normal: 250ms ease;
        --transition: 200ms ease;

        /* 圆角 */
        --radius-full: 9999px;
        --radius-xl: 24px;
        --border-radius: 8px;

        /* 布局 */
        --nav-height: 56px;
        --container-max: 1400px;
        --container-bg: var(--bg-card, #1a1a24);
        --safe-area-top: env(safe-area-inset-top, 0px);
        --safe-area-bottom: env(safe-area-inset-bottom, 0px);

        /* 单名旧约定 */
        --bg-color: var(--bg-deep, #0a0a0f);
        --bg-secondary: var(--bg-surface, #12121a);
        --bg-tertiary: var(--bg-card, #1a1a24);
        --bg-elevated: var(--bg-card-hover, #22222e);
        --bg-hover: var(--bg-card-hover, #22222e);
        --bg-card-hover: #22222e;
        --bg-gradient: linear-gradient(135deg, #0a0a0f 0%, #12121a 100%);
        --primary-gradient: linear-gradient(135deg, #00f5d4 0%, #4cc9f0 100%);
        --text-color: var(--text-primary, #e8e8ed);
        --primary-color: var(--accent-cyan, #00f5d4);
        --primary-focus: rgba(0, 245, 212, 0.25);
        --secondary-color: var(--accent-magenta, #f72585);
        --tertiary-color: var(--text-muted, #55556a);
        --accent-color: var(--accent-cyan, #00f5d4);
        --accent-hover: #2dffe2;
        --accent-light: rgba(0, 245, 212, 0.15);
        --accent-pink: var(--accent-magenta, #f72585);
        --accent-orange: #ff9f1c;
        --accent-gold: #ffd166;
        --accent-brown: #a0522d;
        --success-color: var(--accent-green, #10b981);
        --good-color: var(--accent-green, #10b981);
        --warning-color: var(--accent-yellow, #fbbf24);
        --error-color: var(--accent-red, #f43f5e);
        --danger-color: var(--accent-red, #f43f5e);
        --info-color: var(--accent-blue, #4cc9f0);
        --muted-color: var(--text-muted, #55556a);
        --muted-border-color: var(--border-subtle, #2a2a3a);
        --hover-color: var(--accent-cyan, #00f5d4);
        --border-default: var(--border-subtle, #2a2a3a);
        --border-focus: var(--accent-cyan, #00f5d4);
        --border-accent: var(--accent-cyan, #00f5d4);
        --card-background-color: var(--bg-card, #1a1a24);
        --code-background-color: var(--bg-input, #0e0e14);

        /* Pico CSS 框架默认 */
        --pico-background-color: var(--bg-deep, #0a0a0f);
        --pico-color: var(--text-primary, #e8e8ed);
        --pico-muted-color: var(--text-muted, #55556a);
        --pico-muted-border-color: var(--border-subtle, #2a2a3a);
        --pico-muted-background: var(--bg-surface, #12121a);
        --pico-card-background-color: var(--bg-card, #1a1a24);
        --pico-code-background-color: var(--bg-input, #0e0e14);
        --pico-primary: var(--accent-cyan, #00f5d4);
        --pico-primary-background: var(--accent-cyan, #00f5d4);
        --pico-primary-inverse: #0a0a0f;
        --pico-primary-focus: rgba(0, 245, 212, 0.25);
        --pico-primary-rgb: 0, 245, 212;
        --pico-secondary: var(--text-secondary, #8888a0);
        --pico-secondary-background: var(--bg-card, #1a1a24);
        --pico-border-radius: 8px;
        --pico-contrast: var(--text-primary, #e8e8ed);
        --pico-contrast-background: var(--bg-card-hover, #22222e);
        --pico-del-color: var(--accent-red, #f43f5e);
        --pico-ins-color: var(--accent-green, #10b981);
        --pico-form-element-border-color: var(--border-strong, #3a3a4a);
        --pico-form-element-background-color: var(--bg-input, #0e0e14);
      }

      /* 浅色主题覆盖：glass/shadow/glow 等主题敏感变量 */
      [data-theme="light"] {
        /* 玻璃拟态 — 浅色版（半透明白） */
        --glass-bg: rgba(255, 255, 255, 0.78);
        --glass-border: rgba(0, 0, 0, 0.06);
        --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);

        /* 阴影 — 浅色版（更淡） */
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
        --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
        --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
        --shadow-glow: 0 0 20px rgba(0, 184, 148, 0.12);
        --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);

        /* 辉光 — 浅色版（透明度降低） */
        --glow-cyan: 0 0 16px rgba(0, 184, 148, 0.18);
        --glow-purple: 0 0 16px rgba(139, 92, 246, 0.18);
        --glow-green: 0 0 16px rgba(16, 185, 129, 0.18);
        --glow-red: 0 0 16px rgba(244, 63, 94, 0.18);
        --glow-magenta: 0 0 16px rgba(247, 37, 133, 0.18);
        --accent-glow: 0 0 16px rgba(0, 184, 148, 0.18);

        /* 渐变 — 浅色版 */
        --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #fff 100%);

        /* hover/elevated 替换为浅色调 */
        --bg-card-hover: #f1f5f9;
        --bg-elevated: #fff;
        --bg-hover: #f1f5f9;
        --accent-light: rgba(0, 184, 148, 0.12);
        --accent-hover: #00d4aa;

        /* Pico 浅色覆盖（默认 Pico 行为） */
        --pico-primary-inverse: #fff;
        --pico-contrast-background: #f1f5f9;
      }

      :root {
        --bg-deep: #0a0a0f;
        --bg-surface: #12121a;
        --bg-card: #1a1a24;
        --bg-input: #0e0e14;
        --text-primary: #e8e8ed;
        --text-secondary: #8888a0;
        --text-muted: #55556a;
        --border-subtle: #2a2a3a;
        --border-strong: #3a3a4a;
        --accent-cyan: #00f5d4;
        --accent-magenta: #f72585;
        --accent-green: #10b981;
        --accent-red: #f43f5e;
        --accent-yellow: #fbbf24;
        --accent-blue: #4cc9f0;
        --accent-purple: #7b2cbf;
        --radius-sm: 4px;
        --radius-md: 8px;
        --radius-lg: 12px;
        --font-sans:
          "Space Grotesk", -apple-system, blinkmacsystemfont, "Segoe UI", roboto, sans-serif;
        --font-mono: "JetBrains Mono", "Courier New", monospace;
        --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
      }

      [data-theme="light"] {
        --bg-deep: #fafafa;
        --bg-surface: #fff;
        --bg-card: #fff;
        --bg-input: #f5f5f5;
        --text-primary: #1a1a1a;
        --text-secondary: #666;
        --text-muted: #999;
        --border-subtle: #e5e5e5;
        --border-strong: #d5d5d5;
        --accent-cyan: #00d4b8;
        --accent-magenta: #e63975;
        --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
      }

      :root {
        --primary-color: #1095c1;
      }

      body {
        padding: 1rem;
      }

      .header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1rem;
      }

      .header h1 {
        margin: 0;
      }

      .theme-toggle {
        cursor: pointer;
        font-size: 1.5rem;
        background: none;
        border: none;
        padding: 0.5rem;
      }

      .container-grid {
        display: grid;
        grid-template-columns: 350px 1fr;
        gap: 1rem;
      }

      @media (max-width: 900px) {
        .container-grid {
          grid-template-columns: 1fr;
        }
      }

      .card {
        background: var(--pico-card-background-color);
        border-radius: var(--pico-border-radius);
        padding: 1rem;
        margin-bottom: 1rem;
      }

      .card h3 {
        margin-top: 0;
        border-bottom: 1px solid var(--pico-muted-border-color);
        padding-bottom: 0.5rem;
      }

      .template-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
      }

      .template-btn {
        padding: 0.75rem;
        border: 2px solid var(--pico-muted-border-color);
        border-radius: 8px;
        background: var(--pico-card-background-color);
        cursor: pointer;
        text-align: center;
        transition: all 0.2s;
      }

      .template-btn:hover {
        border-color: var(--primary-color);
      }

      .template-btn.active {
        border-color: var(--primary-color);
        background: var(--pico-primary-focus);
      }

      .template-btn .icon {
        font-size: 1.5rem;
        display: block;
        margin-bottom: 0.25rem;
      }

      .template-btn .name {
        font-size: 0.85rem;
      }

      .color-picker-group {
        display: flex;
        gap: 0.5rem;
        align-items: center;
      }

      .color-picker-group input[type="color"] {
        width: 50px;
        height: 40px;
        padding: 0;
        border: none;
        cursor: pointer;
      }

      .color-picker-group label {
        flex: 1;
        margin-bottom: 0;
      }

      .form-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
      }

      .action-buttons {
        display: flex;
        gap: 0.5rem;
        flex-wrap: wrap;
      }

      .action-buttons button {
        flex: 1;
      }

      /* 证书预览区域 */
      .preview-wrapper {
        overflow: auto;
        padding: 1rem;
        background: #e0e0e0;
        border-radius: var(--pico-border-radius);
        min-height: 500px;
        display: flex;
        justify-content: center;
        align-items: flex-start;
      }

      [data-theme="dark"] .preview-wrapper {
        background: #2a2a2a;
      }

      /* 证书基础样式 */
      .certificate {
        width: 800px;
        min-height: 566px;
        padding: 40px;
        box-sizing: border-box;
        position: relative;
        font-family: SimSun, STSong, serif;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
      }

      .certificate-inner {
        height: 100%;
        padding: 30px;
        position: relative;
      }

      .certificate-header {
        text-align: center;
        margin-bottom: 30px;
      }

      .certificate-logo {
        max-height: 60px;
        margin-bottom: 10px;
      }

      .certificate-org {
        font-size: 1.2rem;
        letter-spacing: 2px;
        margin-bottom: 10px;
      }

      .certificate-title {
        font-size: 2.5rem;
        font-weight: bold;
        letter-spacing: 8px;
        margin: 20px 0;
      }

      .certificate-body {
        text-align: center;
        line-height: 2;
        font-size: 1.1rem;
      }

      .certificate-name {
        font-size: 2rem;
        font-weight: bold;
        margin: 20px 0;
        display: inline-block;
        border-bottom: 2px solid currentcolor;
        padding: 0 40px 5px;
      }

      .certificate-content {
        max-width: 600px;
        margin: 0 auto;
        text-align: justify;
        text-indent: 2em;
      }

      .certificate-footer {
        position: absolute;
        bottom: 40px;
        left: 40px;
        right: 40px;
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
      }

      .certificate-date {
        font-size: 0.95rem;
      }

      .certificate-seal {
        text-align: center;
      }

      .seal-placeholder {
        width: 100px;
        height: 100px;
        border: 2px dashed #999;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.75rem;
        color: #999;
      }

      .certificate-number {
        position: absolute;
        top: 20px;
        right: 30px;
        font-size: 0.8rem;
        color: #666;
      }

      /* 模板样式 - 荣誉证书 */
      .template-honor {
        background: linear-gradient(135deg, #fff9e6 0%, #fff5cc 100%);
        border: 8px double #c9a227;
      }

      .template-honor .certificate-inner {
        border: 2px solid #c9a227;
      }

      .template-honor .certificate-title {
        color: #8b0000;
      }

      .template-honor .certificate-name {
        color: #c9a227;
      }

      /* 模板样式 - 结业证书 */
      .template-completion {
        background: linear-gradient(135deg, #f0f8ff 0%, #e6f2ff 100%);
        border: 6px solid #1a5276;
      }

      .template-completion .certificate-inner {
        border: 2px solid #1a5276;
      }

      .template-completion .certificate-title {
        color: #1a5276;
      }

      .template-completion .certificate-name {
        color: #1a5276;
      }

      /* 模板样式 - 培训证书 */
      .template-training {
        background: linear-gradient(135deg, #f5fff5 0%, #e6ffe6 100%);
        border: 6px solid #228b22;
      }

      .template-training .certificate-inner {
        border: 2px solid #228b22;
      }

      .template-training .certificate-title {
        color: #228b22;
      }

      .template-training .certificate-name {
        color: #2e8b2e;
      }

      /* 模板样式 - 优秀员工 */
      .template-employee {
        background: linear-gradient(135deg, #fff5f5 0%, #ffe6e6 100%);
        border: 6px solid #8b0000;
      }

      .template-employee .certificate-inner {
        border: 2px solid #8b0000;
      }

      .template-employee .certificate-title {
        color: #8b0000;
      }

      .template-employee .certificate-name {
        color: #b22222;
      }

      /* 模板样式 - 志愿者 */
      .template-volunteer {
        background: linear-gradient(135deg, #fff0f5 0%, #ffe4ec 100%);
        border: 6px solid #c71585;
      }

      .template-volunteer .certificate-inner {
        border: 2px solid #c71585;
      }

      .template-volunteer .certificate-title {
        color: #c71585;
      }

      .template-volunteer .certificate-name {
        color: #db7093;
      }

      /* 模板样式 - 奖状 */
      .template-award {
        background: linear-gradient(135deg, #fffef0 0%, #fff8dc 100%);
        border: 8px double #ffd700;
      }

      .template-award .certificate-inner {
        border: 3px solid #ffd700;
        background: linear-gradient(
          135deg,
          rgba(255, 215, 0, 0.05) 0%,
          rgba(255, 215, 0, 0.1) 100%
        );
      }

      .template-award .certificate-title {
        color: #b8860b;
      }

      .template-award .certificate-name {
        color: #daa520;
      }

      /* 模板样式 - 聘书 */
      .template-appointment {
        background: linear-gradient(135deg, #f8f8ff 0%, #e6e6fa 100%);
        border: 6px solid #4b0082;
      }

      .template-appointment .certificate-inner {
        border: 2px solid #4b0082;
      }

      .template-appointment .certificate-title {
        color: #4b0082;
      }

      .template-appointment .certificate-name {
        color: #6a5acd;
      }

      /* 模板样式 - 感谢状 */
      .template-thanks {
        background: linear-gradient(135deg, #f0ffff 0%, #e0ffff 100%);
        border: 6px solid #008b8b;
      }

      .template-thanks .certificate-inner {
        border: 2px solid #008b8b;
      }

      .template-thanks .certificate-title {
        color: #008b8b;
      }

      .template-thanks .certificate-name {
        color: #20b2aa;
      }

      /* 打印样式 */
      @media print {
        body {
          padding: 0;
          background: white;
        }

        .no-print {
          display: none !important;
        }

        .preview-wrapper {
          background: none;
          padding: 0;
          overflow: visible;
        }

        .certificate {
          box-shadow: none;
          margin: 0;
          break-after: always;
        }
      }

      /* 装饰角 */
      .corner-decoration {
        position: absolute;
        width: 60px;
        height: 60px;
        opacity: 0.6;
      }

      .corner-tl {
        top: 10px;
        left: 10px;
        border-top: 3px solid currentcolor;
        border-left: 3px solid currentcolor;
      }

      .corner-tr {
        top: 10px;
        right: 10px;
        border-top: 3px solid currentcolor;
        border-right: 3px solid currentcolor;
      }

      .corner-bl {
        bottom: 10px;
        left: 10px;
        border-bottom: 3px solid currentcolor;
        border-left: 3px solid currentcolor;
      }

      .corner-br {
        bottom: 10px;
        right: 10px;
        border-bottom: 3px solid currentcolor;
        border-right: 3px solid currentcolor;
      }

      .breadcrumb {
        background: rgba(255, 255, 255, 0.95);
        padding: 8px 15px;
        border-radius: 20px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        font-size: 0.85rem;
      }
      .breadcrumb a {
        color: #667eea;
        text-decoration: none;
      }
      .breadcrumb a:hover {
        text-decoration: underline;
      }
      .breadcrumb span {
        color: #999;
        margin: 0 5px;
      }