/* ============ 基础 ============ */
:root {
  --brand-1: #2563eb;
  --brand-2: #3b82f6;
  --brand-3: #1d4ed8;
  --brand-grad: linear-gradient(120deg, #2563eb 0%, #3b82f6 55%, #1d4ed8 100%);
  --ink-900: #1e1b2e;
  --ink-700: #4b4660;
  --ink-500: #7a7590;
  --ink-300: #b6b2c7;
  --line: #e9e7f2;
  --bg: #f6f5fb;
  --card: #ffffff;
  --danger: #e11d48;
  --success: #16a34a;
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(30, 27, 46, .05), 0 4px 14px rgba(30, 27, 46, .06);
  --shadow-md: 0 10px 34px rgba(76, 59, 140, .12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* 关键：保证 hidden 属性在任何 display 规则下都生效（部分浏览器/内核中
   作者样式的 display:flex 会覆盖浏览器默认的 [hidden]{display:none}） */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink-900);
  background:
    radial-gradient(900px 420px at 85% -120px, rgba(168, 85, 247, .14), transparent 60%),
    radial-gradient(760px 380px at -80px -80px, rgba(99, 102, 241, .16), transparent 60%),
    var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; }
ul { list-style: none; }
a { text-decoration: none; color: inherit; }

.container { width: min(1280px, calc(100% - 40px)); margin: 0 auto; }

/* ============ 头部 ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand { display: flex; align-items: center; gap: 10px; }

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--brand-grad);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 16px rgba(147, 74, 230, .35);
}
.brand-logo svg { width: 23px; height: 23px; }

.brand-name { font-size: 20px; font-weight: 800; letter-spacing: .5px; }

.brand-badge {
  font-size: 12px;
  font-weight: 700;
  color: #1d4ed8;
  background: rgba(124, 58, 237, .1);
  border: 1px solid rgba(124, 58, 237, .22);
  padding: 3px 9px;
  border-radius: 999px;
  transform: translateY(1px);
}

.header-right { display: flex; align-items: center; gap: 18px; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--ink-700);
  background: #fff;
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-300); }
.status-pill.ok .status-dot { background: var(--success); box-shadow: 0 0 0 3px rgba(22, 163, 74, .15); }
.status-pill.bad .status-dot { background: var(--danger); box-shadow: 0 0 0 3px rgba(225, 29, 72, .13); }

.header-github { font-size: 13.5px; color: var(--ink-500); transition: color .2s; }
.header-github:hover { color: var(--brand-1); }

/* ============ 工作区布局 ============ */
.workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 400px minmax(0, 1fr);
  gap: 22px;
  padding: 26px 0 34px;
  align-items: start;
}

.panel-card,
.result-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.panel-input { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 86px; }

.panel-card { padding: 20px; }

/* ============ 表单 ============ */
.field-label { display: block; font-size: 14.5px; font-weight: 700; margin-bottom: 10px; }

textarea#requirement {
  width: 100%;
  resize: vertical;
  min-height: 148px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 13px 14px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-900);
  background: #fbfaff;
  transition: border-color .2s, box-shadow .2s, background .2s;
  font-family: inherit;
}
textarea#requirement:focus {
  outline: none;
  border-color: var(--brand-1);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, .12);
}
textarea#requirement::placeholder { color: var(--ink-300); }

.char-count { text-align: right; font-size: 12px; color: var(--ink-300); margin: 6px 2px 12px; }

.examples { margin-bottom: 16px; }
.examples-title { font-size: 12.5px; color: var(--ink-500); display: block; margin-bottom: 8px; }
.chip {
  display: inline-block;
  font-size: 12.5px;
  color: var(--ink-700);
  background: #f4f3fb;
  border: 1px solid #ece9f8;
  padding: 5px 11px;
  border-radius: 999px;
  margin: 0 7px 7px 0;
  transition: all .18s;
}
.chip:hover { color: var(--brand-1); border-color: #c7c2f5; background: #efedff; transform: translateY(-1px); }

.options-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.field label { display: block; font-size: 12.5px; color: var(--ink-500); margin-bottom: 6px; }
.field select {
  width: 100%;
  appearance: none;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink-900);
  border: 1.5px solid var(--line);
  background: #fbfaff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237a7590' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center;
  border-radius: 10px;
  padding: 9px 28px 9px 10px;
  transition: border-color .2s, box-shadow .2s;
}
.field select:focus { outline: none; border-color: var(--brand-1); box-shadow: 0 0 0 4px rgba(99, 102, 241, .12); }

.btn-primary {
  width: 100%;
  height: 50px;
  border-radius: 13px;
  background: var(--brand-grad);
  color: #fff;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  box-shadow: 0 10px 24px rgba(147, 74, 230, .35);
  transition: transform .15s, box-shadow .15s, filter .15s;
}
.btn-primary svg { width: 19px; height: 19px; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(147, 74, 230, .42); filter: brightness(1.04); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .65; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-hint { text-align: center; font-size: 12px; color: var(--ink-300); margin-top: 10px; }

/* ============ 历史记录 ============ */
.history-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.history-head h2 { font-size: 14.5px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.history-head h2 svg { width: 17px; height: 17px; color: var(--brand-2); }
.link-btn { font-size: 12.5px; color: var(--ink-500); }
.link-btn:hover { color: var(--danger); }

.history-list { display: flex; flex-direction: column; gap: 8px; max-height: 280px; overflow-y: auto; }
.history-item {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: border-color .18s, background .18s;
}
.history-item:hover { border-color: #c7c2f5; background: #faf9ff; }
.history-item-main { flex: 1; min-width: 0; cursor: pointer; }
.history-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-item-meta { font-size: 11.5px; color: var(--ink-300); margin-top: 3px; }
.history-del {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  color: var(--ink-300);
  font-size: 15px;
  line-height: 1;
  transition: all .15s;
}
.history-del:hover { color: var(--danger); background: rgba(225, 29, 72, .08); }
.history-empty { font-size: 12.5px; color: var(--ink-300); line-height: 1.7; }

/* ============ 结果区 ============ */
.result-card { min-height: 640px; display: flex; flex-direction: column; overflow: hidden; }

.state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 50px 30px; }

.empty-illu { width: 150px; height: 150px; margin-bottom: 18px; }
.empty-illu svg { width: 100%; height: 100%; }
.state h2 { font-size: 21px; font-weight: 800; margin-bottom: 10px; }
.state > p { font-size: 14px; color: var(--ink-500); line-height: 1.8; max-width: 440px; }

.empty-tips { display: flex; gap: 14px; margin-top: 34px; flex-wrap: wrap; justify-content: center; }
.tip {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 14px 18px;
  width: 190px;
  text-align: left;
  box-shadow: var(--shadow-sm);
}
.tip b { display: block; font-size: 13.5px; margin-bottom: 5px; background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tip span { font-size: 12px; color: var(--ink-500); line-height: 1.6; }

/* 加载动画 */
.loading-orb { display: flex; gap: 10px; margin-bottom: 26px; }
.loading-orb span {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--brand-grad);
  animation: bounce 1.15s ease-in-out infinite;
}
.loading-orb span:nth-child(2) { animation-delay: .16s; }
.loading-orb span:nth-child(3) { animation-delay: .32s; }
@keyframes bounce {
  0%, 70%, 100% { transform: translateY(0) scale(.85); opacity: .55; }
  35% { transform: translateY(-14px) scale(1); opacity: 1; }
}

/* 错误 */
.error-icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(225, 29, 72, .1);
  color: var(--danger);
  font-size: 34px;
  font-weight: 800;
  font-style: italic;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
}
#errorMessage { max-width: 560px; word-break: break-word; }
.btn-secondary {
  margin-top: 22px;
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-1);
  border: 1.5px solid #c7c2f5;
  background: #fff;
  padding: 10px 24px;
  border-radius: 10px;
  transition: all .18s;
}
.btn-secondary:hover { background: #efedff; }

/* 结果工具栏 */
.result-body { flex: 1; display: flex; flex-direction: column; min-height: 640px; }

.result-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fcfbfe;
  flex-wrap: wrap;
}
.tabs { display: flex; background: #efedfb; border-radius: 10px; padding: 3px; }
.tab { font-size: 13px; font-weight: 600; color: var(--ink-500); padding: 7px 16px; border-radius: 8px; transition: all .18s; white-space: nowrap; }
.tab:hover { color: var(--ink-900); }
.tab.active { background: #fff; color: var(--brand-1); box-shadow: 0 2px 8px rgba(30, 27, 46, .08); }

.toolbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-700);
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px 13px;
  border-radius: 9px;
  transition: all .18s;
}
.tool-btn svg { width: 15px; height: 15px; }
.tool-btn:hover { border-color: #c7c2f5; color: var(--brand-1); }
.tool-btn.editing { border-color: var(--brand-1); color: var(--brand-1); background: rgba(37,99,235,.06); box-shadow: inset 0 0 0 1px var(--brand-1); }

.btn-save {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  background: var(--brand-grad);
  padding: 9px 17px;
  border-radius: 9px;
  box-shadow: 0 6px 16px rgba(37, 99, 235, .3);
  transition: transform .15s, box-shadow .15s;
}
.btn-save svg { width: 16px; height: 16px; }
.btn-save:hover { transform: translateY(-1px); box-shadow: 0 9px 20px rgba(37, 99, 235, .38); }

/* 预览舞台 */
.stage { position: relative; flex: 1; background: #f0eff7; padding: 22px; overflow: auto; }

#previewFrame {
  width: 100%;
  height: calc(100vh - 250px);
  min-height: 560px;
  border: none;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(30, 27, 46, .14);
}

.mobile-frame {
  width: 390px;
  height: 760px;
  max-height: calc(100vh - 230px);
  margin: 0 auto;
  border: 10px solid #26233a;
  border-radius: 38px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 18px 50px rgba(30, 27, 46, .3);
  background: #000;
}
.mobile-frame::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  height: 22px;
  background: #26233a;
  border-radius: 0 0 14px 14px;
  z-index: 2;
}
.mobile-frame iframe { width: 100%; height: 100%; border: none; background: #fff; }

.code-view {
  margin: 0;
  background: #1e1b2e;
  color: #d7d4ea;
  border-radius: 10px;
  padding: 18px 20px;
  font-family: "JetBrains Mono", Consolas, "Courier New", monospace;
  font-size: 12.5px;
  line-height: 1.75;
  overflow: auto;
  height: calc(100vh - 250px);
  min-height: 560px;
  white-space: pre;
  tab-size: 2;
}

.streaming-badge {
  position: absolute;
  top: 30px;
  right: 30px;
  font-size: 12px;
  font-weight: 600;
  color: #1d4ed8;
  background: rgba(255, 255, 255, .92);
  border: 1px solid #ddd8fe;
  padding: 5px 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  box-shadow: var(--shadow-sm);
}
.streaming-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-2);
  animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }

/* ============ 页脚 / Toast ============ */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 18px 0;
  background: rgba(255, 255, 255, .7);
}
.site-footer .container { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-300); }
.footer-link { color: var(--brand); text-decoration: none; font-weight: 600; transition: opacity .2s; }
.footer-link:hover { opacity: .75; text-decoration: underline; }
.footer-company { color: var(--ink-300); }
@media (max-width: 560px) {
  .site-footer .container { justify-content: center; text-align: center; }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%) translateY(20px);
  background: #26233a;
  color: #fff;
  font-size: 13.5px;
  padding: 11px 22px;
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(30, 27, 46, .3);
  opacity: 0;
  transition: opacity .25s, transform .25s;
  z-index: 100;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============ 接口设置弹窗 ============ */
button.status-pill { font-family: inherit; cursor: pointer; transition: border-color .18s, box-shadow .18s; }
button.status-pill:hover { border-color: #c7c2f5; box-shadow: 0 2px 10px rgba(99, 102, 241, .12); }

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(30, 27, 46, .45);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 200;
  animation: maskIn .18s ease;
}
@keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 460px;
  max-width: 100%;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(30, 27, 46, .35);
  animation: modalIn .22s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
}
.modal-head h3 { font-size: 17px; font-weight: 800; }
.modal-ver {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-300);
  background: #f4f3fa;
  border-radius: 6px;
  padding: 2px 7px;
  vertical-align: middle;
  margin-left: 6px;
  letter-spacing: .3px;
}
.modal-close {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-size: 20px;
  line-height: 1;
  color: var(--ink-500);
  transition: all .15s;
}
.modal-close:hover { background: #f1effa; color: var(--ink-900); }

.modal-body { padding: 0 22px 6px; }

.mode-banner {
  font-size: 12.5px;
  line-height: 1.6;
  border-radius: 10px;
  padding: 10px 13px;
  margin-bottom: 16px;
}
.mode-banner.server { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.mode-banner.direct { background: #eff6ff; color: #1e3a8a; border: 1px solid #bfdbfe; }

.modal-field { margin-bottom: 14px; }
.modal-field label { display: block; font-size: 12.5px; color: var(--ink-500); margin-bottom: 6px; font-weight: 600; }
.modal-field input {
  width: 100%;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ink-900);
  border: 1.5px solid var(--line);
  background: #fbfaff;
  border-radius: 10px;
  padding: 10px 12px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.modal-field input:focus {
  outline: none;
  border-color: var(--brand-1);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, .12);
}

.modal-tip { font-size: 12px; color: var(--ink-500); line-height: 1.8; }
.modal-tip b { color: var(--ink-700); }

/* 使用说明弹窗 */
.tips-step { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.tips-step:last-of-type { border-bottom: none; }
.tips-step b { flex: 0 0 auto; min-width: 78px; color: var(--brand); font-size: 13px; }
.tips-step span { font-size: 12.5px; color: var(--ink-500); line-height: 1.7; }
.tips-block { margin-top: 14px; padding: 12px; background: var(--bg-soft); border-radius: 8px; }
.tips-block b { font-size: 13px; color: var(--ink-700); display: block; margin-bottom: 6px; }
.tips-block p { font-size: 12.5px; color: var(--ink-500); line-height: 1.7; margin: 0; }
.tips-faq { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--ink-500); line-height: 1.8; }
.tips-faq li { margin-bottom: 2px; }

/* 免责声明弹窗 */
.disclaimer-p { font-size: 12.5px; color: var(--ink-500); line-height: 1.8; margin: 0 0 10px; text-align: justify; }
.disclaimer-p b { color: var(--ink-700); }
.disclaimer-contact { margin-top: 14px; padding: 12px; background: var(--bg-soft); border-radius: 8px; font-size: 12.5px; color: var(--ink-500); line-height: 1.7; }
.disclaimer-contact b { color: var(--ink-700); }

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 22px 20px;
}
.btn-ghost {
  font-size: 13px;
  font-weight: 600;
  color: var(--danger);
  padding: 9px 14px;
  border-radius: 9px;
  transition: background .15s;
}
.btn-ghost:hover { background: rgba(225, 29, 72, .07); }
.modal-foot-right { display: inline-flex; align-items: center; gap: 10px; }

.btn-cancel {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-700);
  background: #f4f3fa;
  padding: 10px 20px;
  border-radius: 9px;
  transition: background .15s;
}
.btn-cancel:hover { background: #eae8f5; }

.btn-confirm {
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  background: var(--brand-grad);
  padding: 10px 22px;
  border-radius: 9px;
  box-shadow: 0 6px 16px rgba(147, 74, 230, .3);
  transition: transform .15s;
}
.btn-confirm:hover { transform: translateY(-1px); }
.btn-confirm:disabled { opacity: .6; cursor: default; transform: none; }

/* ============ 登录用户区（v2.0） ============ */
.btn-login {
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  background: var(--brand-grad);
  padding: 7px 18px;
  border-radius: 999px;
  box-shadow: 0 5px 14px rgba(147, 74, 230, .32);
  transition: transform .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn-login:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(147, 74, 230, .4); }

.user-box { display: inline-flex; align-items: center; gap: 10px; }
.quota-pill {
  font-size: 12.5px;
  color: #1e3a8a;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.quota-pill b { color: var(--brand-1); font-size: 14px; margin: 0 2px; }
.quota-pill.zero b { color: var(--danger); }
.user-email {
  font-size: 13px;
  color: var(--ink-700);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-box .link-btn { white-space: nowrap; }
.user-box .link-btn:hover { color: var(--danger); }

/* 旧版静态部署提示横幅 */
.legacy-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 9px 16px;
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  color: #92400e;
  font-size: 13px;
}
.legacy-settings-btn { color: #92400e !important; text-decoration: underline; }
.legacy-settings-btn:hover { color: var(--danger) !important; }

/* ============ 登录/注册弹窗（v2.0） ============ */
.auth-tabs {
  display: flex;
  gap: 4px;
  background: #f4f3fa;
  border-radius: 11px;
  padding: 4px;
  margin-bottom: 18px;
}
.auth-tab {
  flex: 1;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-500);
  padding: 8px 0;
  border-radius: 8px;
  transition: all .18s;
  white-space: nowrap;
}

/* ---------- V3.0 发布上线 ---------- */
.btn-publish {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--brand-1);
  background: #fff;
  border: 1.5px solid var(--brand-1);
  padding: 7.5px 16px;
  border-radius: 9px;
  transition: all .15s;
}
.btn-publish svg { width: 16px; height: 16px; }
.btn-publish:hover { background: var(--brand-1); color: #fff; transform: translateY(-1px); }

.modal-publish { max-width: 520px; }
.pub-domain-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pub-domain-opt {
  display: flex; flex-direction: column; gap: 3px;
  padding: 10px 12px; border: 1.5px solid #cbd5e1; border-radius: 10px;
  cursor: pointer; transition: all .15s; position: relative;
}
.pub-domain-opt input { position: absolute; opacity: 0; pointer-events: none; }
.pub-domain-opt-name { font-weight: 700; font-size: 13px; color: #334155; }
.pub-domain-opt-desc { font-size: 11px; color: #64748b; line-height: 1.5; }
.pub-domain-opt:hover { border-color: var(--brand-1); }
.pub-domain-opt.active { border-color: var(--brand-1); background: rgba(37,99,235,.05); box-shadow: 0 0 0 1px var(--brand-1); }
.pub-domain-opt.active .pub-domain-opt-name { color: var(--brand-1); }
.pub-url-row { display: flex; align-items: stretch; gap: 0; }
.pub-url-row input {
  flex: 1;
  border-radius: 10px 0 0 10px;
  text-transform: lowercase;
}
.pub-domain {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  background: #f1f5f9;
  border: 1.5px solid #cbd5e1;
  border-left: 0;
  border-radius: 0 10px 10px 0;
  color: var(--ink-500);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
}
.pub-agree {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 14px 0 12px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-600);
  cursor: pointer;
}
.pub-agree input { width: auto; margin-top: 3px; flex-shrink: 0; }
.pub-submit { width: 100%; justify-content: center; margin-top: 4px; }
.pub-submit[disabled] { opacity: .55; cursor: not-allowed; }
.pub-quota-hint { text-align: center; font-size: 12px; color: var(--ink-300); margin: 10px 0 0; }

#publishSuccess { text-align: center; padding: 8px 0 4px; }
.pub-success-illu { font-size: 44px; line-height: 1; }
.pub-success-title { font-size: 19px; margin: 10px 0 6px; color: var(--ink); }
.pub-success-desc { font-size: 13.5px; color: var(--ink-500); margin: 0 0 16px; }
.pub-link-row { display: flex; gap: 8px; margin-bottom: 12px; }
.pub-link-row input { flex: 1; font-size: 13px; }
.pub-open-link { display: block; text-decoration: none; }

.pub-mine { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 16px; }
.pub-mine h4 { font-size: 14px; margin-bottom: 10px; color: var(--ink); }
.pub-site-list { list-style: none; display: flex; flex-direction: column; gap: 8px; max-height: 240px; overflow-y: auto; }
.pub-site-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
  flex-wrap: wrap;
}
.pub-site-info { flex: 1; min-width: 160px; }
.pub-site-url { font-size: 13px; font-weight: 600; color: var(--brand-1); text-decoration: none; word-break: break-all; }
.pub-site-meta { font-size: 11.5px; color: var(--ink-300); margin-top: 2px; }
.pub-site-tag { font-size: 11px; padding: 1px 8px; border-radius: 999px; font-weight: 600; }
.pub-site-tag.online { background: #dcfce7; color: #15803d; }
.pub-site-tag.offline { background: #f1f5f9; color: #64748b; }
.pub-site-tag.banned { background: #fee2e2; color: #b91c1c; }
.pub-site-tag.pending { background: #fef3c7; color: #92400e; }
.pub-site-tag.rejected { background: #e0e7ff; color: #4338ca; }
.pub-recycle { margin-top: 18px; padding-top: 14px; border-top: 1px dashed #e2e8f0; }
.pub-recycle h4 { color: #64748b; }
.pub-recycle-url { color: #94a3b8; text-decoration: line-through; cursor: default; }
.pub-recycle-remain { color: #d97706; font-weight: 600; }
.pub-site-actions { display: flex; gap: 6px; }
.pub-site-actions button, .pub-site-actions a {
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink-500);
  cursor: pointer;
  text-decoration: none;
}
.pub-site-actions .danger { color: #dc2626; }
.pub-site-actions button:hover, .pub-site-actions a:hover { border-color: var(--brand-1); color: var(--brand-1); }
.pub-site-actions .danger:hover { border-color: #dc2626; color: #dc2626; }
.pub-empty { font-size: 12.5px; color: var(--ink-300); text-align: center; padding: 14px 0; }

/* 历史记录中的已发布标记 */
.hist-published {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: #15803d;
  text-decoration: none;
}
.hist-published:hover { text-decoration: underline; }
.auth-tab.active {
  background: #fff;
  color: var(--ink-900);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(30, 27, 46, .08);
}

/* V3.1 生成区：访客信息收集选择 */
.form-picker {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}
.form-picker .fp-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.form-picker .fp-title { font-size: 13.5px; font-weight: 700; color: var(--ink-900); }
.form-picker .fp-sub { font-size: 11.5px; color: var(--ink-300); }
.form-picker .fp-modes { display: flex; gap: 16px; flex-wrap: wrap; }
.form-picker .fp-radio { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-700); cursor: pointer; }
.form-picker .fp-radio input { width: auto; margin: 0; accent-color: var(--brand-1); }
.form-picker .fp-fields { margin-top: 10px; padding-top: 10px; border-top: 1px dashed #cbd5e1; }
.form-picker .fp-presets { display: flex; gap: 8px; margin-bottom: 8px; }
.form-picker .fp-chip { font-size: 12px; padding: 3px 12px; }
.form-picker .fp-chip.active {
  background: var(--brand-1);
  border-color: var(--brand-1);
  color: #fff;
}
.form-picker .fp-checks { display: flex; gap: 14px; flex-wrap: wrap; }
.form-picker .fp-check { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--ink-700); cursor: pointer; }
.form-picker .fp-check input { width: auto; margin: 0; accent-color: var(--brand-1); }
.form-picker .fp-check input:disabled + span { color: var(--ink-400); }
.form-picker .fp-rec { margin: 8px 0 0; font-size: 12px; color: #b45309; }

.auth-error {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--danger);
  background: rgba(225, 29, 72, .07);
  border: 1px solid rgba(225, 29, 72, .2);
  border-radius: 10px;
  padding: 9px 12px;
  margin-bottom: 14px;
}

.code-row { display: flex; gap: 9px; }
.code-row input { flex: 1; min-width: 0; }
.btn-code {
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--brand-1);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 0 14px;
  border-radius: 10px;
  white-space: nowrap;
  transition: background .15s;
}
.btn-code:hover:not(:disabled) { background: #e0e7ff; }
.btn-code:disabled { color: var(--ink-300); background: #f4f3fa; border-color: var(--line); cursor: default; }

.auth-submit {
  width: 100%;
  margin-top: 4px;
  padding: 12px 22px;
  font-size: 14.5px;
}
.auth-switch-reset { display: block; margin: -4px 0 12px; font-size: 12.5px; }
.auth-back { display: block; width: 100%; text-align: center; margin-top: 12px; font-size: 12.5px; }

/* ============ 响应式 ============ */
@media (max-width: 1020px) {
  .workspace { grid-template-columns: 1fr; }
  .panel-input { position: static; }
  .result-card { min-height: 70vh; }
}

@media (max-width: 560px) {
  .container { width: calc(100% - 24px); }
  .options-grid { grid-template-columns: 1fr; }
  .header-github { display: none; }
  .brand-badge { display: none; }
  .user-email { display: none; }
  .quota-pill { padding: 5px 9px; }
  .header-right { gap: 10px; }
  .stage { padding: 10px; }
  .result-toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-actions { justify-content: center; }
  .tip { width: 100%; }
  #previewFrame { min-height: 460px; height: 70vh; }
  .mobile-frame { width: 340px; height: 660px; }
}
