* { box-sizing: border-box; }
body { margin: 0; font-family: "Microsoft YaHei", "PingFang SC", sans-serif; background: #f5f7fb; color: #1f2430; }
.app { max-width: 1600px; margin: 0 auto; padding: 16px; }
.app-header h1 { margin: 0 0 12px; font-size: 24px; }
.tabs, .preview-tabs { display: flex; gap: 18px; margin-bottom: 12px; align-items: center; }
.tab-link, .preview-tab { border: 0; background: transparent; padding: 8px 2px; cursor: pointer; color: #7e8796; font-size: 15px; }
.tab-link.active, .preview-tab.active { color: #1d73e8; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 8px; }
.tab-panel { display: none; background: #fff; border: 1px solid #e4e9f2; border-radius: 12px; padding: 14px; }
.tab-panel.active { display: block; }
.preview-subpanel { display: none; }
.preview-subpanel.active { display: block; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.toolbar.wrap { flex-wrap: wrap; }
.field-inline, .field-block { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.field-inline input, .field-block input, .field-block select, textarea { border: 1px solid #cfd7e5; border-radius: 8px; padding: 8px 10px; font: inherit; }
.btn { border: 1px solid #c4cedf; background: #fff; color: #1d2a3a; border-radius: 8px; padding: 8px 14px; cursor: pointer; }
.btn.primary { background: #1d73e8; border-color: #1d73e8; color: #fff; }
.split-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pane { display: flex; flex-direction: column; min-height: 620px; }
.pane h3, .preview-sidebar h3 { margin: 0 0 8px; }
textarea { width: 100%; resize: vertical; min-height: 560px; line-height: 1.45; }
.sub-stats { margin-top: 8px; color: #5a6880; font-size: 13px; }
.preview-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr) 360px; gap: 12px; min-height: 700px; }
.preview-sidebar { padding-right: 8px; }
.preview-canvas-wrap { width: 100%; height: 100%; min-height: 700px; display: flex; align-items: stretch; justify-content: stretch; background: #f8faff; border: 1px dashed #cfdaee; border-radius: 10px; overflow: hidden; }
#preview-canvas { width: 100% !important; height: 100% !important; background: #ffffff; border: 1px solid #edf1f7; display: block; cursor: grab; }
#preview-canvas:active { cursor: grabbing; }
.segment-list { display: flex; flex-direction: column; gap: 8px; max-height: 620px; overflow: auto; }
.segment-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px solid #e2e8f3; border-radius: 8px; cursor: pointer; }
.segment-item.active { border-color: #ff8a00; background: #fff3e5; box-shadow: 0 0 0 2px rgba(255, 138, 0, 0.15) inset; }
.segment-title { font-size: 14px; }
.segment-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.seg-op, .eye-btn { padding: 6px 8px; font-size: 12px; border: 1px solid #ccd4e0; background: #fff; border-radius: 8px; cursor: pointer; }
.eye-btn { padding: 6px 10px; }
.segment-empty { color: #7c8799; font-size: 13px; padding: 12px 4px; }
.status { margin-top: 10px; color: #5a6880; font-size: 13px; }
@media (max-width: 1200px) { .split-layout, .preview-layout { grid-template-columns: 1fr; } .preview-canvas-wrap { min-height: 520px; } }
