/* AI 创作台 - 全部样式限定在 .cs 内；主色取自模板变量 --primary-accent-color */
.cs {
	--p: var(--primary-accent-color, #6419ff);
	--p-dark: var(--primary-accent-color--darken, #4b00e5);
	--p-soft: #f1ebff;
	--p-line: #e4dcfb;
	--cyan: var(--blue-themes, #00c6ff);
	--ink: #1f1b3a;
	--mute: #6f6c88;
	--line: #e7e2f7;
	--soft: #f7f5fe;
	--bad: #e0245e;
	--ok: #0a9b57;
	position: relative; padding: 56px 0 96px; color: var(--ink); font-size: 15px; line-height: 1.7;
	background: radial-gradient(900px 380px at 12% -80px, rgba(100, 25, 255, .10), transparent 70%), radial-gradient(800px 360px at 100% 0, rgba(0, 198, 255, .10), transparent 70%), #f6f4fd;
}
.cs *, .cs *::before, .cs *::after { box-sizing: border-box; }
.cs-inner { max-width: 920px; margin: 0 auto; padding: 0 15px; }

/* 卡片 */
.cs .card { margin: 0 0 22px; padding: 30px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 1px 2px rgba(31, 27, 58, .04); }
.cs .pane-head, .cs .token-head { display: flex; align-items: center; gap: 14px; margin: 0 0 22px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.cs .pane-head .ico, .cs .token-head .ico { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; color: var(--p); background: var(--p-soft); box-shadow: none; }
.cs .pane-head .ico svg, .cs .token-head .ico svg { width: 22px; height: 22px; }
.cs .pane-head b, .cs .token-head b { display: block; color: var(--ink); font-size: 18px; font-weight: 700; line-height: 1.35; }
.cs .pane-head small, .cs .token-head small { display: block; color: var(--mute); font-size: 13.5px; line-height: 1.5; }

/* 表单 */
.cs label { display: block; margin: 20px 0 8px; color: var(--ink); font-size: 13.5px; font-weight: 700; }
.cs .card > label:first-of-type, .cs .grid > div > label:first-child, .cs .grid2 > div > label:first-child { margin-top: 0; }
.cs .pane-head + label, .cs .token-head + label { margin-top: 0; }
.cs input:not([type=checkbox]):not([type=file]), .cs select, .cs textarea { display: block; width: 100%; min-height: 50px; padding: 12px 16px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--soft); color: var(--ink); font: inherit; box-shadow: none; transition: border-color .2s, box-shadow .2s, background .2s; }
.cs input::placeholder, .cs textarea::placeholder { color: #a5a2bd; opacity: 1; }
.cs input:not([type=checkbox]):not([type=file]):hover, .cs select:hover, .cs textarea:hover { border-color: var(--p-line); }
.cs input:not([type=checkbox]):not([type=file]):focus, .cs select:focus, .cs textarea:focus { outline: 0; border-color: var(--p); background: #fff; box-shadow: 0 0 0 4px rgba(100, 25, 255, .12); }
.cs textarea { min-height: 120px; resize: vertical; }
.cs input[readonly] { color: var(--mute); }
.cs select { cursor: pointer; appearance: none; -webkit-appearance: none; padding-right: 46px; background-repeat: no-repeat; background-position: right 16px center; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236419ff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
.cs input[type=file] { display: block; width: 100%; padding: 8px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--mute); font-size: 13.5px; }
.cs input[type=file]::file-selector-button { margin-right: 12px; padding: 8px 16px; border: 0; border-radius: 8px; color: var(--p); background: var(--p-soft); font: inherit; font-weight: 700; cursor: pointer; transition: background .2s; }
.cs input[type=file]::file-selector-button:hover { background: #e6dbff; }
.cs input[type=checkbox] { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--p); cursor: pointer; }
.cs .inl { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.cs .inl label { margin: 0; color: var(--mute); font-weight: 500; cursor: pointer; }
.cs .grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 20px; }
.cs .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 20px; }

/* 自定义下拉 */
.cs .cs-dd { position: relative; }
.cs .cs-dd > select { position: absolute; left: 0; top: 0; width: 100%; height: 100%; min-height: 0; opacity: 0; pointer-events: none; }
.cs .cs-dd-btn { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 50px; margin: 0; padding: 12px 16px; border: 1.5px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--soft); font: inherit; text-align: left; cursor: pointer; box-shadow: none; transition: border-color .2s, box-shadow .2s, background .2s; }
.cs .cs-dd-btn:hover { border-color: var(--p-line); }
.cs .cs-dd-btn:focus-visible, .cs .cs-dd.open .cs-dd-btn { outline: 0; border-color: var(--p); background: #fff; box-shadow: 0 0 0 4px rgba(100, 25, 255, .12); }
.cs .cs-dd-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs .cs-dd-label.ph { color: #a5a2bd; }
.cs .cs-dd-btn svg { width: 16px; height: 16px; flex: none; color: var(--p); transition: transform .2s; }
.cs .cs-dd.open .cs-dd-btn svg { transform: rotate(180deg); }
.cs .cs-dd-menu { position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 40; display: none; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 24px 48px -16px rgba(31, 27, 58, .28), 0 4px 12px rgba(31, 27, 58, .06); }
.cs .cs-dd.open .cs-dd-menu { display: block; animation: cs-dd-in .16s ease-out; }
@keyframes cs-dd-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.cs .cs-dd-search { display: none; width: 100%; min-height: 40px !important; margin: 0 0 8px; padding: 8px 12px !important; border-radius: 9px !important; font-size: 14px; }
.cs .cs-dd-menu ul { max-height: 260px; margin: 0; padding: 0; list-style: none; overflow-y: auto; overscroll-behavior: contain; }
.cs .cs-dd-menu li { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0; padding: 10px 12px; border-radius: 9px; color: var(--ink); font-size: 14.5px; cursor: pointer; }
.cs .cs-dd-menu li::before { content: none; }
.cs .cs-dd-menu li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs .cs-dd-menu li svg { display: none; width: 16px; height: 16px; flex: none; color: var(--p); }
.cs .cs-dd-menu li.act { background: var(--p-soft); }
.cs .cs-dd-menu li.sel { color: var(--p-dark); font-weight: 700; }
.cs .cs-dd-menu li.sel svg { display: block; }
.cs .cs-dd-menu ul::-webkit-scrollbar { width: 8px; }
.cs .cs-dd-menu ul::-webkit-scrollbar-thumb { border-radius: 8px; background: #dcd3f7; }

/* 按钮 */
.cs .btns { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 26px; }
.cs .cs-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; margin: 0; padding: 0 30px; border: 1.5px solid transparent; border-radius: 50px; font: inherit; font-size: 15px; font-weight: 700; line-height: 1; white-space: nowrap; cursor: pointer; transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease, border-color .2s ease; }
.cs .cs-btn svg { width: 18px; height: 18px; flex: none; }
.cs .cs-btn--primary { color: #fff; background: var(--p); box-shadow: none; }
.cs .cs-btn--primary:hover { background: var(--p-dark); transform: none; box-shadow: none; }
.cs .cs-btn--ghost { color: var(--p); border-color: var(--p-line); background: #fff; box-shadow: none; }
.cs .cs-btn--ghost:hover { border-color: var(--p); background: var(--p-soft); }
.cs .cs-btn--sm { min-height: 36px; padding: 0 18px; font-size: 13px; }
.cs .cs-btn:active { transform: none; }
.cs .cs-btn, .cs .cs-btn:focus, .cs .cs-btn:active { transform: none; }
.cs .cs-btn:focus-visible { box-shadow: 0 0 0 4px rgba(100, 25, 255, .22); }
.cs .cs-btn--primary:focus-visible { box-shadow: 0 0 0 4px rgba(100, 25, 255, .22); }

.cs .cs-btn:disabled { color: #fff; background: #c9c4dd; border-color: transparent; box-shadow: none; transform: none; cursor: not-allowed; }
.cs .cs-btn--ghost:disabled { color: #b5b1cc; background: #fff; border-color: var(--line); }

/* 标签页 */
.cs .tabs { display: flex; gap: 6px; margin: 0 0 22px; padding: 6px; border: 1px solid var(--line); border-radius: 60px; background: #fff; box-shadow: none; }
.cs .tab { display: inline-flex; flex: 1; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 50px; color: var(--mute); font-weight: 700; white-space: nowrap; cursor: pointer; user-select: none; transition: color .2s, background .2s, box-shadow .2s; }
.cs .tab svg { width: 18px; height: 18px; flex: none; }
.cs .tab:hover { color: var(--p); background: var(--p-soft); }
.cs .tab.on { color: #fff; background: var(--p); box-shadow: none; }
.cs .pane { display: none; }
.cs .pane.on { display: block; }

/* 状态 / 提示 */
.cs .hint { margin-top: 8px; color: var(--mute); font-size: 13px; line-height: 1.7; }
.cs .btns .hint { margin: 0; }
.cs #mstat:not(:empty) { padding: 6px 14px; border-radius: 50px; color: var(--p-dark); background: var(--p-soft); font-size: 13px; }
.cs .status { margin-top: 16px; font-size: 14px; word-break: break-word; }
.cs .status:empty { display: none; }
.cs .status.bad { padding: 12px 16px; border-radius: 12px; color: var(--bad); background: #fff0f5; }
.cs .status.ok { padding: 12px 16px; border-radius: 12px; color: var(--ok); background: #ecfaf3; }
.cs .bar { display: none; height: 8px; margin-top: 16px; border-radius: 99px; background: var(--p-soft); overflow: hidden; }
.cs .bar > div { width: 0; height: 100%; border-radius: 99px; background: var(--p); transition: width .6s; }
.cs details { margin-top: 14px; color: var(--mute); font-size: 13px; }
.cs details summary { cursor: pointer; }
.cs details pre { max-height: 220px; margin: 8px 0 0; padding: 14px; border: 0; border-radius: 10px; background: var(--soft); font-size: 12px; white-space: pre-wrap; word-break: break-all; overflow: auto; }

/* 结果 */
.cs video { display: block; width: 100%; margin-top: 16px; border-radius: 14px; background: #000; }
.cs .imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 18px; }
.cs .imgs figure { margin: 0; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.cs .imgs img { display: block; width: 100%; border-radius: 9px; background: var(--soft); }
.cs .imgs a { display: inline-block; margin: 8px 4px 2px; color: var(--p); font-size: 13px; font-weight: 700; }
.cs .frame { padding: 14px; border: 1.5px dashed var(--p-line); border-radius: 14px; background: var(--soft); }
.cs .frame .pv { display: none; align-items: center; gap: 12px; margin-top: 12px; }
.cs .frame .pv img { width: 60px; height: 60px; border-radius: 10px; object-fit: cover; }
.cs .frame .pv span { flex: 1; color: var(--mute); font-size: 12.5px; word-break: break-all; }
.cs .frame input[type=text] { margin-top: 10px; background: #fff; }
.cs .jobs { margin: 0; padding: 0; list-style: none; }
.cs .jobs li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.cs .jobs li::before { content: none; }
.cs .jobs li:first-child { border-top: 0; }
.cs .jobs .t { flex: 1; min-width: 0; }
.cs .jobs .t b { color: var(--ink); font-weight: 700; }
.cs .jobs .t i { display: block; overflow: hidden; color: var(--mute); font-style: normal; white-space: nowrap; text-overflow: ellipsis; }

/* 对话 */
.cs .chatlog { display: flex; flex-direction: column; gap: 12px; min-height: 160px; max-height: 440px; margin: 20px 0 4px; padding: 18px; border-radius: 14px; background: var(--soft); overflow: auto; }
.cs .chatlog:empty { align-items: center; justify-content: center; }
.cs .chatlog:empty::before { content: "选好模型，在下方输入第一句话开始对话"; color: #a5a2bd; font-size: 13.5px; }
.cs .msg { max-width: 88%; padding: 12px 18px; border-radius: 18px; white-space: pre-wrap; word-break: break-word; }
.cs .msg.u { align-self: flex-end; border-bottom-right-radius: 6px; color: #fff; background: var(--p); }
.cs .msg.a { align-self: flex-start; border-bottom-left-radius: 6px; border: 1px solid var(--line); background: #fff; }

/* 调用示例 */
.cs h3 { margin: 30px 0 10px; color: var(--ink); font-size: 18px; font-weight: 700; }
.cs .ex-h { margin: 26px 0 0; padding-left: 12px; border-left: 3px solid var(--p); color: var(--ink); font-size: 15px; font-weight: 700; line-height: 1.3; }
.cs .code { margin: 10px 0 20px; border-radius: 12px; background: #1b1633; overflow: hidden; }
.cs .code-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px 8px 18px; border-bottom: 1px solid rgba(255, 255, 255, .08); background: rgba(255, 255, 255, .03); }
.cs .code-lang { display: inline-flex; align-items: center; gap: 8px; color: #a99fd0; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.cs .code-lang::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 3px rgba(0, 198, 255, .18); }
.cs .cs-copy { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; margin: 0; padding: 0 12px; border: 1px solid transparent; border-radius: 8px; color: #cfc6f2; background: transparent; font: inherit; font-size: 12.5px; font-weight: 600; line-height: 1; cursor: pointer; box-shadow: none; transition: background .2s, color .2s, border-color .2s; }
.cs .cs-copy svg { width: 14px; height: 14px; flex: none; }
.cs .cs-copy:focus { outline: 0; }
.cs .cs-copy:focus-visible { outline: 2px solid rgba(255, 255, 255, .5); outline-offset: 1px; }
.cs .cs-copy:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.cs .cs-copy.done { color: #5ee0a0; background: rgba(94, 224, 160, .12); }
.cs .code pre { max-height: none; margin: 0; padding: 18px 22px 20px; border: 0; border-radius: 0; background: transparent; color: #e9e4ff; font-size: 12.5px; line-height: 1.75; white-space: pre; overflow: auto; }
.cs .code pre::-webkit-scrollbar { height: 8px; }
.cs .code pre::-webkit-scrollbar-thumb { border-radius: 8px; background: rgba(255, 255, 255, .18); }
.cs code { padding: 2px 7px; border: 0; border-radius: 6px; color: var(--p); background: var(--p-soft); font-size: .88em; }
.cs .faq { margin: 0; padding-left: 20px; font-size: 14px; }
.cs .faq li { margin: 10px 0; }

@media (max-width: 620px) {
	.cs { padding: 32px 0 72px; }
	.cs .card { margin: 0 0 22px; padding: 30px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 1px 2px rgba(31, 27, 58, .04); }
	.cs .grid, .cs .grid2 { grid-template-columns: 1fr; }
	.cs .tabs { display: flex; gap: 6px; margin: 0 0 22px; padding: 6px; border: 1px solid var(--line); border-radius: 60px; background: #fff; box-shadow: none; }
	.cs .tabs::-webkit-scrollbar { display: none; }
	.cs .tab { flex: none; }
	.cs .btns .cs-btn { flex: 1; }
	
}
