        :root { 
            --tmc-blue: #004165; --tmc-red: #772432; --tmc-gold: #CD202C; --bg-gray: #f4f6f8; 
            scrollbar-color: #9ba4b5 #e0e5ec; 
            scrollbar-width: auto;
        }

        /* ===== 明显化全局滚动条 ===== */
        ::-webkit-scrollbar { width: 12px; height: 12px; }
        ::-webkit-scrollbar-track { background: #e0e5ec; border-radius: 6px; }
        ::-webkit-scrollbar-thumb { background: #9ba4b5; border-radius: 6px; border: 3px solid #e0e5ec; }
        ::-webkit-scrollbar-thumb:hover { background: var(--tmc-blue); }

        body { font-family: 'Helvetica Neue', 'Microsoft YaHei', Arial, sans-serif; background-color: #e0e5ec; margin: 0; padding: 20px; color: #333; }
        .container { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; max-width: 1580px; margin: 0 auto; position: relative; }
        
        /* --- 左侧控制台 --- */
        .control-panel { background: white; padding: 25px; border-radius: 12px; box-shadow: 0 8px 20px rgba(0,0,0,0.06); flex: 1; min-width: 520px; max-width: 600px; height: 95vh; overflow-y: auto; }
        .panel-section { margin-bottom: 25px; border-bottom: 1px dashed #ddd; padding-bottom: 20px; }
        .panel-section:last-child { border-bottom: none; }
        .panel-section h3 { margin: 0 0 12px 0; color: var(--tmc-blue); font-size: 16px; border-left: 5px solid var(--tmc-red); padding-left: 10px; display: flex; align-items: center; justify-content: space-between;}

        /* 通用输入框 */
        label { display: block; font-size: 11px; font-weight: bold; color: #666; margin-bottom: 4px; }
        input[type="text"], input[type="number"], input[type="time"], textarea, select { 
            width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; font-size: 13px; margin-bottom: 8px; font-family: inherit; transition: border 0.2s;
        }
        input:focus, textarea:focus, select:focus { border-color: var(--tmc-blue); outline: none; }
        .two-col-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

        /* 智能导入区域 */
        .smart-area { background: #eef6fc; border: 1px solid #cce5ff; padding: 15px; border-radius: 8px; }
        .smart-textarea { height: 70px; font-family: monospace; font-size: 12px; }
        .btn-smart { background-color: #28a745; border: none; color: white; padding: 8px 15px; border-radius: 4px; cursor: pointer; font-weight: bold; font-size: 13px; transition: opacity 0.2s; }
        .btn-db { background-color: var(--tmc-blue); border: none; color: white; padding: 8px 15px; border-radius: 4px; cursor: pointer; font-weight: bold; font-size: 13px; margin-right: 10px;}
        .tips { font-size: 11px; color: #666; margin-bottom: 6px; line-height: 1.4; }

        /* 弹窗样式 (Modal) */
        .modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); overflow-y: auto; }
        .modal-content { background-color: #fefefe; margin: 5vh auto; padding: 20px; border: 1px solid #888; width: 500px; max-width: 95%; border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.2); max-height: 85vh; overflow-y: auto; box-sizing: border-box;}
        .close-modal { color: #aaa; float: right; font-size: 28px; font-weight: bold; cursor: pointer; }
        .close-modal:hover { color: black; }
        .db-textarea { height: 300px; font-family: monospace; font-size: 12px; background: #fffdf0; border-color: #ccc; margin-top:10px;}

        /* 开关排版 */
        .toggle-container { background: var(--bg-gray); padding: 12px; border-radius: 8px; }
        .toggle-header { font-size: 11px; font-weight: bold; color: var(--tmc-blue); margin-bottom: 8px; border-bottom: 1px solid #ddd; padding-bottom: 4px; }
        .toggle-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
        .toggle-item { display: flex; align-items: center; font-size: 11px; color: #444; cursor: grab; user-select: none; padding: 5px; background: white; border: 1px dashed #ccc; border-radius: 4px; transition: border-color 0.2s; }
        .toggle-item:active { cursor: grabbing; }
        .toggle-item:hover { border-color: var(--tmc-blue); }
        .toggle-item input { margin-right: 6px; cursor: pointer; }
        .toggle-drag { margin-right: 6px; color: #999; font-size: 10px; }

        /* 语言切换开关 */
        .lang-switch {
            position: relative;
            display: inline-block;
            width: 50px;
            height: 24px;
        }
        .lang-switch input { opacity: 0; width: 0; height: 0; }
        .slider {
            position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
            background-color: var(--tmc-blue); transition: .4s; border-radius: 24px;
            display: flex; align-items: center; justify-content: space-between;
            padding: 0 5px; font-size: 10px; font-weight: bold; color: white; user-select: none;
        }
        .slider:before {
            position: absolute; content: ""; height: 18px; width: 18px;
            left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%;
        }
        input:checked + .slider { background-color: #28a745; }
        input:checked + .slider:before { transform: translateX(26px); }
        .slider-text-zh { position: absolute; left: 6px; z-index: 1;}
        .slider-text-en { position: absolute; right: 6px; z-index: 1;}

        /* 议程列表 */
        .agenda-list { height: 480px; overflow-y: auto; background: var(--bg-gray); padding: 10px; border-radius: 6px; border: 1px solid #eee; }
        .input-block { background: white; border: 1px solid #eee; padding: 8px; margin-bottom: 8px; border-radius: 6px; border-left: 3px solid #ccc; transition: all 0.2s; position: relative;}
        .input-block:hover { border-left-color: var(--tmc-blue); box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
        .row-header { display:flex; align-items:center; justify-content: space-between; margin-bottom: 6px; font-size: 11px; color: #555; background: #fcfcfc; padding: 3px 5px; border-radius: 4px;}
        .calc-time { font-weight: bold; color: white; background: var(--tmc-blue); padding: 2px 6px; border-radius: 3px; margin-right: 8px;}
        
        .row-main { display: grid; grid-template-columns: 50px 1.4fr 1fr 0.8fr 30px 30px; gap: 6px; margin-bottom: 6px; align-items: center;}
        
        .row-sub { display: grid; grid-template-columns: 50px 1fr; gap: 8px; align-items: start; }
        .input-sub { font-style: italic; color: #666; font-size: 11px !important; border: 1px dashed #ccc !important; min-height: 28px; height: auto; margin-bottom: 0 !important; padding: 6px 8px; resize: vertical; line-height: 1.4; font-family: inherit; }
        
        .btn-insert { background: #fff; color: var(--tmc-blue); border: 1px solid var(--tmc-blue); border-radius: 4px; cursor: pointer; height: 30px; font-weight: bold; padding: 0;}
        .btn-insert:hover { background: var(--tmc-blue); color: white; }
        .btn-del { background: #fff; color: #dc3545; border: 1px solid #dc3545; border-radius: 4px; cursor: pointer; height: 30px; padding: 0;}
        .btn-del:hover { background: #dc3545; color: white; }
        
        .btn-add { background: var(--tmc-blue); color: white; border: none; padding: 12px; width: 100%; border-radius: 6px; cursor: pointer; font-weight: bold; margin-top: 10px; }
        .btn-check { background: #fff; color: var(--tmc-blue); border: 1px solid var(--tmc-blue); padding: 10px 12px; width: 100%; border-radius: 6px; cursor: pointer; font-weight: bold; margin-top: 8px; }
        .btn-check:hover { background: var(--tmc-blue); color: white; }
        
        .btn-help { background:#f4f6f8; border:1px solid #ccc; color:var(--tmc-blue); padding:6px 12px; border-radius:20px; font-weight:bold; cursor:pointer; font-size:12px; transition:all 0.2s; box-shadow:0 2px 5px rgba(0,0,0,0.05); }
        .btn-help:hover { background: var(--tmc-blue); color: white; border-color: var(--tmc-blue); }

        /* ===== 新增：步骤序号与全局设置框样式 ===== */
        .step-badge { display: inline-block; width: 22px; height: 22px; background: var(--tmc-red); color: white; text-align: center; border-radius: 50%; font-size: 14px; line-height: 22px; margin-right: 8px; font-weight: bold; font-family: Arial, sans-serif; box-shadow: 0 2px 4px rgba(119,36,50,0.3); }
        .global-settings-box { background: #f8f9fa; border: 1px solid #e9ecef; padding: 18px; border-radius: 10px; margin-bottom: 25px; box-shadow: inset 0 2px 5px rgba(0,0,0,0.02); position: relative;}
        .global-settings-box h3 { margin-top: 0; color: #555; font-size: 13px; border-left: 4px solid #adb5bd; padding-left: 8px; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; }

        /* 拖拽交互样式 */
        .input-block.dragging { opacity: 0.3; background: #f0f7ff; }
        .input-block.drag-over { border-top: 3px solid var(--tmc-blue); box-shadow: 0 -4px 10px rgba(0,65,101,0.15); }
        .agenda-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
        .agenda-summary div { background: white; border: 1px solid #d8e3ee; border-radius: 6px; padding: 8px; }
        .agenda-summary span { display: block; color: #666; font-size: 10px; margin-bottom: 3px; }
        .agenda-summary strong { color: var(--tmc-blue); font-size: 14px; }
        .agenda-summary .late strong { color: #dc3545; }
        .agenda-summary .early strong { color: #28a745; }

        .download-group { display: flex; gap: 10px; margin-top: 20px; }
        .gen-btn { flex: 1; border: none; padding: 15px; font-size: 14px; border-radius: 6px; cursor: pointer; font-weight: bold; color: white; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
        .btn-pdf { background-color: var(--tmc-red); }
        .btn-img { background-color: #28a745; }

        /* --- 右侧预览区 --- */
        .preview-wrapper { flex: 1; display: flex; justify-content: center; min-width: 800px; padding-top: 20px; }
        .preview-scroll-container { width: 100%; display: flex; justify-content: center; }
        .card-shadow-wrapper { box-shadow: 0 0 30px rgba(0,0,0,0.1); display: flex; height: fit-content; width: max-content;}
        
        #agenda-card { 
            width: 794px; height: 1122px; background: white; display: flex; overflow: hidden; 
            -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
        }
        .sidebar { width: 28%; background-color: #f4f4f4; padding: 20px 12px; box-sizing: border-box; border-right: 2px solid #ddd; display: flex; flex-direction: column; }
        .sidebar-header { text-align: center; margin-bottom: 20px; order: -1; }
        .css-logo-main { color: var(--tmc-blue); font-weight: 900; font-size: 20px; line-height: 1; letter-spacing: -1px; }
        .css-logo-sub { color: #555; font-size: 9px; letter-spacing: 1.5px; margin-top: 3px; text-transform: uppercase; }

        .box { background: white; padding: 10px; margin-bottom: 12px; border-radius: 4px; border: 1px solid #e0e0e0; transition: transform 0.2s ease; }
        .box-title { color: var(--tmc-blue); font-weight: bold; font-size: 11px; text-transform: uppercase; border-bottom: 2px solid var(--tmc-red); padding-bottom: 4px; margin-bottom: 6px; }
        .box-content { font-size: 9px; color: #555; line-height: 1.4; text-align: left; white-space: pre-wrap; }
        .officer-row { display: flex; justify-content: space-between; margin-bottom: 4px; border-bottom: 1px dotted #eee; padding-bottom: 1px; font-size: 9px; }
        .wod-word { font-size: 18px; font-weight: bold; color: var(--tmc-red); text-align: center; margin: 5px 0; }
        .timing-table { width: 100%; font-size: 8px; border-collapse: collapse; text-align: center; }
        .timing-table th { background: #eee; padding: 2px; }
        .timing-table td { border-bottom: 1px solid #eee; padding: 3px 0; }
        .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
        .green { background: #28a745; } .yellow { background: #ffc107; } .red { background: #dc3545; }

        .main { width: 72%; padding: 25px 30px; display: flex; flex-direction: column; box-sizing: border-box; }
        .main-header { border-bottom: 3px solid var(--tmc-blue); margin-bottom: 15px; padding-bottom: 10px; display: flex; justify-content: space-between; align-items: flex-end; }
        .club-title h1 { margin: 0; color: var(--tmc-blue); font-size: 26px; line-height: 1; text-transform: uppercase; letter-spacing: 0.5px; }
        .meeting-detail { text-align: right; font-size: 9px; color: #555; line-height: 1.4; }
        .theme-section { background: var(--tmc-blue); color: white; padding: 10px 15px; border-radius: 4px; margin-bottom: 15px; display: flex; align-items: center; justify-content: space-between; }
        .theme-val { font-size: 18px; font-weight: bold; letter-spacing: 1px; }
        .agenda-table { width: 100%; border-collapse: collapse; font-size: 10px; margin-bottom: auto; }
        .agenda-table th { text-align: left; color: var(--tmc-blue); border-bottom: 2px solid #ccc; padding: 6px 4px; font-size: 9px; font-weight: bold; }
        .agenda-table td { padding: 4px 4px; border-bottom: 1px solid #f0f0f0; vertical-align: top; }
        .row-break { background-color: transparent; }
        .item-main { font-weight: bold; color: #222; font-size: 11px; }
        .item-sub { font-size: 9px; color: #666; font-style: italic; margin-top: 2px; display: block; white-space: pre-wrap; line-height: 1.4; }
        .p-name { font-weight: bold; color: #000; display: block; font-size: 10px; }
        .p-title { font-size: 9px; color: #888; font-style: italic; display: block; transform: scale(0.9); transform-origin: left top; }
        .footer-roles { margin-top: 20px; padding-top: 15px; border-top: 2px solid var(--tmc-red); display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
        .role-box h5 { margin: 0 0 3px 0; color: var(--tmc-blue); font-size: 9px; }
        .role-box p { margin: 0; font-size: 8px; color: #666; line-height: 1.4; text-align: justify; }

        /* 可切换议程样式 */
        body[data-theme="business"] #agenda-card { font-family: Arial, 'Microsoft YaHei', sans-serif; }
        body[data-theme="business"] .sidebar { background: #f7f7f5; border-right-color: #2f4858; }
        body[data-theme="business"] .box-title,
        body[data-theme="business"] .club-title h1,
        body[data-theme="business"] .agenda-table th,
        body[data-theme="business"] .role-box h5 { color: #2f4858; }
        body[data-theme="business"] .main-header { border-bottom-color: #2f4858; }
        body[data-theme="business"] .theme-section { background: #2f4858; }
        body[data-theme="business"] .box-title { border-bottom-color: #9a8c5b; }
        body[data-theme="business"] .footer-roles { border-top-color: #9a8c5b; }

        body[data-theme="poster"] #agenda-card { background: #fffaf2; }
        body[data-theme="poster"] .sidebar { background: #183b4e; color: white; border-right-color: #d89d37; }
        body[data-theme="poster"] .sidebar .box { background: #fffdf7; color: #333; border-color: #f0d7a5; }
        body[data-theme="poster"] .css-logo-main { color: #f7c566; }
        body[data-theme="poster"] .css-logo-sub { color: #fff; }
        body[data-theme="poster"] .box-title,
        body[data-theme="poster"] .club-title h1,
        body[data-theme="poster"] .agenda-table th,
        body[data-theme="poster"] .role-box h5 { color: #183b4e; }
        body[data-theme="poster"] .main-header { border-bottom-color: #d65745; }
        body[data-theme="poster"] .theme-section { background: #d65745; border-radius: 0; }
        body[data-theme="poster"] .footer-roles { border-top-color: #d65745; }

        body[data-theme="print"] #agenda-card { color: #111; }
        body[data-theme="print"] .sidebar { background: #fff; border-right-color: #999; }
        body[data-theme="print"] .box { border-color: #aaa; box-shadow: none; }
        body[data-theme="print"] .box-title,
        body[data-theme="print"] .club-title h1,
        body[data-theme="print"] .agenda-table th,
        body[data-theme="print"] .role-box h5 { color: #111; }
        body[data-theme="print"] .main-header,
        body[data-theme="print"] .box-title,
        body[data-theme="print"] .footer-roles { border-color: #111; }
        body[data-theme="print"] .theme-section { background: #111; }
        body[data-theme="print"] .wod-word { color: #111; }

        /* ================= 移动端适配 (分页展示) ================= */
        .mobile-tabs { display: none; width: 100%; }
        .mobile-download-group { display: none; }
        .mobile-hint { display: none; }

        @media (max-width: 850px) {
            body { padding: 10px; }
            .container { flex-direction: column; gap: 10px; align-items: center; }
            
            /* 手机端独有的 Tabs 栏 */
            .mobile-tabs {
                display: flex; position: sticky; top: 0; z-index: 900; background: white;
                box-shadow: 0 4px 15px rgba(0,0,0,0.08); border-radius: 8px; margin-bottom: 5px;
                overflow: hidden;
            }
            .mobile-tabs .tab {
                flex: 1; text-align: center; padding: 14px; font-size: 14px; font-weight: bold;
                color: #666; cursor: pointer; border-bottom: 3px solid transparent; transition: all 0.3s;
            }
            .mobile-tabs .tab.active { color: var(--tmc-blue); border-bottom-color: var(--tmc-blue); background: #f8fbff; }

            /* 左侧控制台变为第一页 */
            .control-panel { 
                min-width: 100%; max-width: 100%; width: 100%; height: auto; max-height: none; 
                padding: 15px; box-sizing: border-box; display: block; margin-bottom: 30px;
            }
            
            /* 右侧预览区变为第二页 */
            .preview-wrapper { 
                min-width: 100%; width: 100%; padding: 0; box-sizing: border-box; 
                display: none; flex-direction: column; align-items: flex-start; margin-bottom: 30px;
            }
            .preview-scroll-container {
                width: 100%; overflow-x: auto; padding-bottom: 15px; justify-content: flex-start;
                -webkit-overflow-scrolling: touch; /* iOS顺滑滚动 */
            }
            
            /* 通过 body 的 class 控制分页显示 */
            body.show-preview .control-panel { display: none; }
            body.show-preview .preview-wrapper { display: flex; }

            /* 手机端专用部件 */
            .mobile-download-group { display: flex; width: 100%; gap: 10px; margin-bottom: 15px; }
            .mobile-hint { display: block; width: 100%; text-align: center; font-size: 12px; color: var(--tmc-red); margin-bottom: 10px; font-weight:bold; }
            
            /* 内部表格防挤压 */
            .toggle-grid { grid-template-columns: repeat(2, 1fr); }
            .row-main { grid-template-columns: 40px 1.2fr 1fr 0.8fr 25px 25px; gap: 4px; }
            .row-sub { grid-template-columns: 40px 1fr; gap: 4px; }
            .two-col-inputs { grid-template-columns: 1fr; }
            .agenda-list { height: 60vh; }
        }
    
