:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-soft: #f7f8fc;
  --line: #e4e7ef;
  --ink: #161923;
  --muted: #707789;
  --brand: #5b4ae8;
  --brand-2: #8d67ef;
  --brand-soft: #eeeaff;
  --green: #16835a;
  --green-soft: #eaf8f1;
  --amber: #9c6614;
  --amber-soft: #fff6e5;
  --rose: #b83a55;
  --rose-soft: #fff0f3;
  --blue-soft: #edf5ff;
  --shadow: 0 10px 30px rgba(40, 43, 61, 0.06);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(900px 450px at 15% -10%, rgba(122, 93, 242, 0.08), transparent 70%),
    var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, textarea, select { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.entry-shell {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(145deg, rgba(17, 20, 42, 0.96), rgba(42, 28, 95, 0.96)),
    #17182e;
}
.entry-shell::after {
  position: absolute;
  inset: 0;
  content: "";
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}
.entry-glow {
  position: absolute;
  width: 460px;
  height: 460px;
  border-radius: 999px;
  filter: blur(80px);
  opacity: 0.42;
}
.entry-glow-a { left: -120px; top: -110px; background: #7457ff; }
.entry-glow-b { right: -140px; bottom: -170px; background: #d0a8ff; }
.entry-card {
  position: relative;
  z-index: 2;
  width: min(720px, calc(100vw - 40px));
  padding: 56px 58px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.075);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(24px);
}
.entry-card .brand-mark { margin: 0 auto 24px; }
.entry-card h1 {
  margin: 14px 0 20px;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.12;
  letter-spacing: -0.045em;
}
.entry-card h1 span { color: #cbbdff; }
.entry-card > p {
  max-width: 560px;
  margin: 0 auto;
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  line-height: 1.8;
}
.eyebrow {
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
}
.entry-features {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 30px 0;
}
.entry-features span {
  padding: 8px 13px;
  color: rgba(255, 255, 255, 0.74);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  font-size: 12px;
}
.entry-button {
  min-width: 220px;
  padding: 14px 22px;
  font-size: 16px;
}
.entry-note { margin-top: 16px; color: rgba(255, 255, 255, 0.4); font-size: 11px; }

.app-shell { min-height: 100vh; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  height: 64px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  background: none;
  border: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.brand-mark {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.03em;
  box-shadow: 0 8px 20px rgba(91, 74, 232, 0.24);
}
.brand-mark.large { width: 54px; height: 54px; border-radius: 18px; font-size: 18px; }
.main-nav { display: flex; justify-content: center; gap: 4px; }
.main-nav button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 13px;
  color: #52596b;
  background: transparent;
  border: 0;
  border-radius: 10px;
  font-size: 13px;
}
.nav-svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.main-nav button:hover { color: var(--brand); background: var(--surface-soft); }
.main-nav button.active { color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.demo-pill {
  padding: 6px 9px;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.icon-button {
  width: 34px;
  height: 34px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.profile-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 4px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
}
.avatar-shell { position: relative; display: inline-flex; }
.avatar-shell > img { width: 34px; height: 34px; object-fit: cover; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px #e2d8ff; }
.role-emblem { position: absolute; right: -3px; bottom: -3px; display: grid; width: 15px; height: 15px; place-items: center; color: #fff; background: linear-gradient(135deg, #f0a51f, #ef6a35); border: 2px solid #fff; border-radius: 50%; box-shadow: 0 2px 5px rgba(118, 71, 17, 0.24); }
.role-emblem svg { width: 8px; height: 8px; fill: currentColor; stroke: currentColor; stroke-width: 1.5; }
.role-emblem.admin { background: linear-gradient(135deg, #5667e8, #9b7af0); }
.profile-copy { display: grid; text-align: left; line-height: 1.25; }
.profile-copy strong { font-size: 12px; }
.profile-copy small { color: var(--muted); font-size: 10px; }
.profile-meta { display: flex; align-items: center; gap: 5px; }
.profile-meta em { padding: 1px 4px; color: #8b6316; background: #fff3d8; border-radius: 4px; font-size: 8px; font-style: normal; }
.logout-button { height: 34px; padding: 0 12px; color: #50586a; background: #fff; border: 1px solid var(--line); border-radius: 10px; font-size: 11px; }
.logout-button:hover { color: var(--rose); border-color: #f0cbd3; }
.chevron { color: #8b90a1; font-size: 12px; }
.avatar {
  display: inline-grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #616d95, #252f4c);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
}
.profile-menu {
  position: fixed;
  top: 72px;
  right: 22px;
  z-index: 150;
  width: 270px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(24, 27, 42, 0.16);
}
.quota-card { padding: 12px; border-radius: 12px; background: linear-gradient(135deg, #f5f2ff, #faf9ff); }
.quota-card > span { display: block; color: var(--muted); font-size: 11px; }
.quota-card strong { display: block; margin: 5px 0 8px; font-size: 28px; letter-spacing: -0.04em; }
.quota-card small { color: var(--muted); font-size: 10px; }
.quota-track { height: 5px; margin-bottom: 6px; overflow: hidden; background: #e6e2f7; border-radius: 999px; }
.quota-track i { display: block; width: 16.8%; height: 100%; background: var(--brand); border-radius: inherit; }
.profile-menu > button {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12px;
}
.profile-menu > button:hover { background: var(--surface-soft); }

.app-content { width: min(1680px, 100%); margin: 0 auto; padding: 22px 28px 44px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-heading h1 { margin: 0; font-size: 25px; letter-spacing: -0.03em; }
.page-heading p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; }
.ghost-button, .primary-button, .soft-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 14px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.primary-button { color: #fff; background: linear-gradient(135deg, #6751e8, #8f6eed); border: 0; box-shadow: 0 8px 20px rgba(93, 74, 232, 0.22); }
.ghost-button { color: #434a5b; background: #fff; border: 1px solid var(--line); }
.soft-button { color: var(--brand); background: var(--brand-soft); border: 1px solid #ddd5ff; }
.primary-button:hover, .soft-button:hover, .ghost-button:hover { filter: brightness(0.98); transform: translateY(-1px); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }

.studio-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: calc(100vh - 112px); border: 1px solid var(--line); border-radius: 20px; background: #fff; overflow: hidden; box-shadow: var(--shadow); }
.studio-sidebar { padding: 18px 14px; background: #fafbfe; border-right: 1px solid var(--line); }
.new-chat-button { width: 100%; padding: 12px; color: #fff; background: linear-gradient(135deg, #6955ec, #8f6cef); border: 0; border-radius: 12px; font-weight: 600; }
.sidebar-title { margin: 22px 8px 9px; color: #9298a9; font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.recent-list { display: grid; gap: 4px; }
.recent-item { width: 100%; padding: 10px 9px; text-align: left; background: transparent; border: 0; border-radius: 10px; }
.recent-item:hover, .recent-item.active { background: #f0edff; }
.recent-item strong { display: block; overflow: hidden; color: #353b4b; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.recent-item small { display: block; margin-top: 4px; color: #9298a9; font-size: 10px; }
.studio-main { display: flex; min-width: 0; min-height: 0; flex-direction: column; padding: 20px 22px; background: linear-gradient(180deg, #fff, #fcfcff); }
.studio-toolbar { display: flex; align-items: center; gap: 8px; min-height: 32px; padding-bottom: 13px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.mobile-project-select { display: none; max-width: 210px; padding: 6px 8px; background: #fff; border: 1px solid var(--line); border-radius: 8px; font-size: 11px; }
.studio-body { display: grid; min-height: calc(100vh - 210px); flex: 1; align-content: center; }
.studio-body.with-thread { display: flex; min-height: 0; flex-direction: column; gap: 14px; align-content: normal; padding: 14px 0 0; }
.studio-hero { margin-bottom: 22px; text-align: center; }
.studio-hero .spark { display: inline-grid; width: 58px; height: 58px; place-items: center; margin-bottom: 14px; color: #fff; background: linear-gradient(135deg, #6a54e9, #9b7af0); border-radius: 19px; box-shadow: 0 14px 30px rgba(95, 75, 225, 0.25); font-size: 28px; }
.studio-hero h1 { margin: 0; font-size: clamp(26px, 3vw, 42px); letter-spacing: -0.04em; }
.studio-hero p { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.prompt-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 940px; margin: 0 auto 18px; }
.prompt-presets button { min-height: 64px; padding: 14px; color: #4e5567; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 13px; font-size: 12px; line-height: 1.55; }
.prompt-presets button:hover { border-color: #c9beff; box-shadow: 0 8px 24px rgba(91, 74, 232, 0.08); }
.composer { max-width: 1040px; margin: 0 auto; overflow: hidden; background: #fff; border: 1px solid #dfe3ec; border-radius: 20px; box-shadow: 0 12px 40px rgba(35, 39, 58, 0.08); }
.composer.dragging { border-color: #9c85f2; box-shadow: 0 0 0 5px rgba(104, 80, 232, 0.1), 0 14px 44px rgba(35, 39, 58, 0.1); }
.composer-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 13px; border-bottom: 1px solid #edf0f5; }
.type-tabs { display: flex; gap: 5px; }
.type-tabs button { padding: 7px 12px; color: #777e90; background: transparent; border: 0; border-radius: 8px; font-size: 11px; }
.type-tabs button { display: inline-flex; align-items: center; gap: 5px; }
.type-tabs button.active { color: #fff; background: #a525bd; }
.composer-enter-note { color: #8b91a1; font-size: 10px; }
.composer textarea { width: 100%; min-height: 112px; padding: 18px 18px 8px; resize: vertical; background: #fff; border: 0; outline: 0; font-size: 14px; line-height: 1.75; }
.composer textarea::placeholder { color: #a4a9b6; }
.reference-tray { display: flex; gap: 9px; padding: 12px 13px 4px; overflow-x: auto; }
.reference-card { position: relative; width: 116px; flex: 0 0 auto; overflow: hidden; background: #fff; border: 1px solid #e3e6ee; border-radius: 11px; box-shadow: 0 3px 10px rgba(35, 39, 60, 0.06); }
.reference-card[data-drag-over="true"] { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.reference-thumb { position: relative; display: grid; height: 82px; place-items: center; overflow: hidden; background: #eef1f6; }
.reference-thumb img { width: 100%; height: 100%; object-fit: cover; }
.reference-kind { position: absolute; right: 5px; bottom: 5px; padding: 2px 5px; color: #fff; background: rgba(10, 14, 24, 0.64); border-radius: 5px; font-size: 8px; }
.reference-meta { padding: 7px 8px; }
.reference-meta strong { display: block; color: var(--brand); font-size: 10px; }
.reference-meta span { display: block; margin-top: 2px; overflow: hidden; color: #606778; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.reference-actions { position: absolute; top: 5px; right: 5px; display: flex; gap: 2px; opacity: 0; transition: opacity 140ms ease; }
.reference-card:hover .reference-actions { opacity: 1; }
.reference-actions button { display: grid; width: 22px; height: 22px; place-items: center; padding: 0; color: #fff; background: rgba(12, 15, 25, 0.68); border: 0; border-radius: 5px; backdrop-filter: blur(5px); }
.reference-add { display: grid; width: 72px; height: 118px; flex: 0 0 auto; place-content: center; justify-items: center; gap: 5px; color: #8c93a3; background: #fafbfe; border: 1px dashed #d8dce6; border-radius: 11px; font-size: 9px; }
.audio-glyph { display: grid; width: 38px; height: 38px; place-items: center; color: var(--brand); background: var(--brand-soft); border-radius: 50%; }
.reference-picker { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; max-height: 60vh; overflow-y: auto; }
.reference-picker button { padding: 0; overflow: hidden; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 11px; }
.reference-picker button:hover { border-color: #bfb0ff; box-shadow: 0 7px 18px rgba(84, 66, 200, 0.1); }
.reference-picker img { display: block; width: 100%; height: 120px; object-fit: cover; }
.reference-picker span { display: block; overflow: hidden; padding: 8px 9px 2px; font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.reference-picker small { display: block; padding: 0 9px 8px; color: var(--muted); font-size: 9px; }
.composer-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 13px 12px; }
.tool-button, .select-control { height: 34px; padding: 0 10px; background: #f7f8fb; border: 1px solid #eef0f4; border-radius: 9px; font-size: 11px; }
.select-control { color: #62697a; }
.composer-spacer { flex: 1; }
.quote-button { min-width: 118px; height: 38px; color: #fff; background: linear-gradient(135deg, #7860ed, #a47af0); border: 0; border-radius: 11px; font-weight: 600; }
.composer-footer { display: flex; justify-content: space-between; gap: 10px; padding: 0 15px 12px; color: #969cab; font-size: 10px; }
.composer-footer strong { color: var(--brand); font-weight: 600; }
.quote-panel { max-width: 1040px; margin: 0 auto 14px; padding: 16px 18px; background: linear-gradient(135deg, #f4f0ff, #fbf9ff); border: 1px solid #d9ceff; border-radius: 16px; }
.quote-panel-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.quote-panel h3 { margin: 0; font-size: 16px; }
.quote-price { color: var(--brand); font-size: 24px; font-weight: 700; }
.quote-meta { margin-top: 7px; color: var(--muted); font-size: 11px; }
.quote-actions { display: flex; gap: 8px; margin-top: 13px; }
.studio-thread { width: min(1040px, 100%); min-height: 0; flex: 1; margin: 0 auto; padding: 4px 8px 10px; overflow-y: auto; }
.thread-turn { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; margin-bottom: 14px; }
.thread-avatar img { width: 34px; height: 34px; object-fit: cover; border-radius: 50%; }
.thread-content { min-width: 0; }
.thread-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; color: #6c7384; font-size: 10px; }
.thread-head strong { color: #3d4455; font-size: 11px; }
.thread-prompt { width: fit-content; max-width: 100%; margin-left: auto; padding: 10px 13px; color: #4a5164; background: #f0edff; border: 1px solid #ddd6ff; border-radius: 12px; font-size: 11px; line-height: 1.55; }
.thread-card { margin-top: 8px; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 13px; }
.thread-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 9px; color: var(--muted); font-size: 9px; }
.thread-card-foot .chip-button { display: inline-flex; align-items: center; gap: 4px; min-height: 26px; text-decoration: none; }
.thread-result-media { display: block; width: auto; max-width: 100%; height: auto; max-height: 310px; margin: 0 auto; border-radius: 9px; background: #0a0d15; }
.thread-progress { height: 3px; margin: -10px -10px 9px; overflow: hidden; background: #ececf4; border-radius: 13px 13px 0 0; }
.thread-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #c29cf3); transition: width 600ms ease; }
.generation-skeleton { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; min-height: 165px; padding: 10px; overflow: hidden; background: #f6f5fa; border-radius: 10px; }
.generation-skeleton.vertical { display: grid; grid-template-columns: 1fr; width: min(220px, 70%); min-height: 280px; margin: 0 auto; }
.generation-skeleton i { display: block; min-height: 145px; background: linear-gradient(100deg, #ebe9f2 15%, #f7f6fb 40%, #ebe9f2 65%); background-size: 220% 100%; border-radius: 8px; animation: shimmer 1.5s linear infinite; }
.generation-skeleton.vertical i { display: none; }
.generation-skeleton.vertical::before { display: block; width: 100%; height: 100%; min-height: 254px; content: ""; background: linear-gradient(100deg, #e7e5ef 15%, #f7f6fb 40%, #e7e5ef 65%); background-size: 220% 100%; border-radius: 8px; animation: shimmer 1.5s linear infinite; }
.generation-skeleton span { position: absolute; top: 50%; left: 50%; padding: 7px 10px; color: #676f82; background: rgba(255, 255, 255, 0.88); border: 1px solid #e3e5ed; border-radius: 8px; font-size: 10px; transform: translate(-50%, -50%); backdrop-filter: blur(5px); }
@keyframes shimmer { to { background-position: -120% 0; } }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.metric-card { padding: 17px 18px; background: #fff; border: 1px solid var(--line); border-radius: 15px; }
.metric-card span { color: var(--muted); font-size: 11px; }
.metric-card strong { display: block; margin-top: 7px; font-size: 26px; letter-spacing: -0.04em; }
.metric-card small { display: block; margin-top: 6px; color: #9aa0ae; font-size: 10px; }
.table-card { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 17px; box-shadow: var(--shadow); }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 17px; border-bottom: 1px solid #eef0f5; }
.table-toolbar h2 { margin: 0; font-size: 16px; }
.table-toolbar > span { color: #8d93a3; font-size: 11px; font-weight: 400; }
.table-controls { display: flex; gap: 8px; }
.table-controls input, .table-controls select { height: 34px; padding: 0 11px; background: #fff; border: 1px solid var(--line); border-radius: 9px; outline: none; font-size: 11px; }
.table-controls input { width: 280px; }
.data-table { width: 100%; min-width: 1050px; border-collapse: collapse; }
.table-scroll { overflow-x: auto; }
.data-table th { padding: 11px 14px; color: #777f90; text-align: left; background: #fafbfe; border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 600; white-space: nowrap; }
.data-table td { padding: 13px 14px; border-bottom: 1px solid #eff1f5; color: #4a5263; font-size: 12px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover td { background: #fbfaff; }
.job-title { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mono { font-family: "SFMono-Regular", Consolas, monospace; font-size: 10px; }
.credits-cell { white-space: nowrap; font-variant-numeric: tabular-nums; }
.credit-tooltip { border-bottom: 1px dotted #aeb4c1; cursor: help; }
.user-cell { display: flex; align-items: center; gap: 7px; min-width: 100px; }
.user-cell img { width: 24px; height: 24px; object-fit: cover; border-radius: 50%; }
.status-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 999px; font-size: 10px; font-weight: 600; white-space: nowrap; }
.status-badge::before { width: 5px; height: 5px; content: ""; background: currentColor; border-radius: 50%; }
.status-succeeded { color: var(--green); background: var(--green-soft); }
.status-quoted { color: var(--brand); background: var(--brand-soft); }
.status-cancelled { color: #73798a; background: #f1f3f6; }
.status-needs_review { color: var(--amber); background: var(--amber-soft); }
.status-failed { color: var(--rose); background: var(--rose-soft); }
.status-queued, .status-querying { color: #2367b7; background: var(--blue-soft); }
.detail-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 16px; }
.detail-head h1 { margin: 0; font-size: 24px; }
.detail-head p { margin: 5px 0 0; color: var(--muted); font-family: monospace; font-size: 10px; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(460px, 1.1fr); align-items: start; gap: 16px; }
.detail-media-card { position: sticky; top: 82px; padding: 14px; }
.detail-media-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.detail-media { display: grid; min-height: 300px; max-height: 520px; place-items: center; overflow: hidden; background: #0d111d; border-radius: 13px; }
.detail-media img, .detail-media video { width: 100%; height: min(50vh, 520px); object-fit: contain; }
.detail-side { display: grid; gap: 13px; }
.detail-card { padding: 17px 18px; }
.detail-card h2 { margin: 0 0 12px; font-size: 15px; }
.summary-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.summary-user { display: flex; align-items: center; gap: 9px; }
.summary-user img { width: 34px; height: 34px; object-fit: cover; border-radius: 50%; }
.summary-user strong { display: block; font-size: 12px; }
.summary-user small { color: var(--muted); font-size: 10px; }
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px 18px; margin-top: 15px; }
.summary-grid dt { color: #8c92a2; font-size: 10px; }
.summary-grid dd { margin: 3px 0 0; color: #404758; font-size: 12px; line-height: 1.5; }
.summary-grid .wide { grid-column: 1 / -1; }
.prompt-tools { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.prompt-tools button { color: var(--brand); background: transparent; border: 0; font-size: 11px; font-weight: 600; }
.prompt-box { position: relative; padding: 13px; overflow: hidden; color: #414858; background: var(--surface-soft); border-radius: 11px; font-size: 12px; line-height: 1.75; white-space: pre-wrap; }
.prompt-box.collapsed { max-height: 150px; }
.prompt-box.collapsed::after { position: absolute; right: 0; bottom: 0; left: 0; height: 58px; content: ""; background: linear-gradient(to bottom, transparent, var(--surface-soft)); pointer-events: none; }
.two-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.compact-list { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; color: #535a6b; font-size: 11px; }
.timeline { position: relative; display: grid; gap: 11px; margin: 0; padding: 0; list-style: none; }
.timeline::before { position: absolute; top: 7px; bottom: 7px; left: 5px; width: 1px; content: ""; background: #e2e5ec; }
.timeline li { position: relative; padding-left: 19px; }
.timeline li::before { position: absolute; top: 5px; left: 1px; width: 9px; height: 9px; content: ""; background: #6c7fe7; border: 3px solid #eef0ff; border-radius: 50%; }
.timeline li.succeeded::before { background: var(--green); border-color: var(--green-soft); }
.timeline time { display: block; color: #9aa0ae; font-size: 9px; }
.timeline span { display: block; margin-top: 2px; color: #4f5667; font-size: 11px; line-height: 1.45; }

.asset-filter { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.asset-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.asset-tabs button { padding: 8px 12px; color: #666d7e; background: #fff; border: 1px solid var(--line); border-radius: 9px; font-size: 11px; }
.asset-tabs button.active { color: var(--brand); background: var(--brand-soft); border-color: #d8ceff; }
.asset-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.asset-card { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow); }
.asset-preview { position: relative; display: grid; height: 210px; place-items: center; overflow: hidden; background: #111827; }
.asset-preview img { width: 100%; height: 100%; object-fit: cover; transition: transform 280ms ease; }
.asset-card:hover .asset-preview img { transform: scale(1.035); }
.asset-type { position: absolute; top: 9px; right: 9px; padding: 4px 7px; color: #fff; background: rgba(10, 14, 24, 0.62); border-radius: 999px; font-size: 9px; backdrop-filter: blur(8px); }
.asset-info { padding: 12px; }
.asset-info strong { display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.asset-info span { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }

.page-tabs {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.page-tabs button {
  position: relative;
  padding: 11px 14px 13px;
  color: #687083;
  background: transparent;
  border: 0;
  font-size: 12px;
}
.page-tabs button.active { color: var(--brand); font-weight: 600; }
.page-tabs button.active::after { position: absolute; right: 12px; bottom: -1px; left: 12px; height: 2px; content: ""; background: var(--brand); border-radius: 999px; }
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.info-tile { padding: 15px 17px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.info-tile span { color: var(--muted); font-size: 10px; }
.info-tile strong { display: block; margin-top: 6px; font-size: 20px; letter-spacing: -0.03em; }
.info-tile small { display: block; margin-top: 4px; color: #9aa0ae; font-size: 10px; }
.filter-card { margin-bottom: 14px; padding: 14px 16px; }
.filter-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.filter-row + .filter-row { margin-top: 10px; }
.filter-row input.search-wide { flex: 1 1 280px; min-width: 220px; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; outline: none; }
.segmented { display: inline-flex; padding: 3px; background: #f5f6fa; border-radius: 9px; }
.segmented button { padding: 6px 10px; color: #676f80; background: transparent; border: 0; border-radius: 7px; font-size: 10px; }
.segmented button.active { color: var(--ink); background: #fff; box-shadow: 0 2px 8px rgba(25, 28, 43, 0.08); }
.chip-button { min-height: 32px; padding: 0 10px; color: #606779; background: #fff; border: 1px solid var(--line); border-radius: 8px; font-size: 10px; }
.chip-button.active { color: var(--brand); background: var(--brand-soft); border-color: #d9cfff; }
.asset-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; margin-top: 10px; border-top: 1px solid #eff1f5; }
.asset-card-footer a, .asset-card-footer button { padding: 0; color: var(--brand); background: transparent; border: 0; font-size: 10px; text-decoration: none; }
.asset-owner { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 9px; }
.asset-owner img { width: 17px; height: 17px; object-fit: cover; border-radius: 50%; }

.admin-layout { display: grid; grid-template-columns: 1.35fr 0.85fr; gap: 14px; }
.admin-card { padding: 17px 18px; }
.admin-card h2 { margin: 0; font-size: 16px; }
.admin-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.admin-card-head > span:not(.soft-button):not(.status-badge) { color: #8d93a3; font-size: 10px; font-weight: 400; }
.account-status { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; }
.account-status span { padding: 5px 8px; border-radius: 7px; font-size: 10px; }
.status-blue { color: #2367b7; background: #edf5ff; }
.status-green { color: var(--green); background: var(--green-soft); }
.status-amber { color: var(--amber); background: var(--amber-soft); }
.detail-mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.detail-mini { padding: 10px 11px; color: #596173; background: #f7f8fb; border-radius: 9px; font-size: 10px; line-height: 1.55; }
.detail-mini strong { display: block; margin-bottom: 3px; color: #8c93a2; font-size: 9px; font-weight: 600; }
.queue-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 20px; }
.queue-grid span { display: block; color: var(--muted); font-size: 10px; }
.queue-grid strong { display: block; margin-top: 5px; font-size: 21px; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 17px; }
.usage-list { display: grid; gap: 10px; margin-top: 10px; }
.usage-row { display: grid; grid-template-columns: minmax(150px, 1fr) 110px 90px; align-items: center; gap: 12px; padding-bottom: 9px; border-bottom: 1px solid #eff1f5; font-size: 11px; }
.usage-row:last-child { border-bottom: 0; }
.usage-bar { height: 5px; overflow: hidden; background: #efedfa; border-radius: 999px; }
.usage-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #aa8df4); border-radius: inherit; }
.user-table-card { margin-top: 14px; }
.user-role-select { height: 30px; min-width: 120px; padding: 0 8px; background: #fff; border: 1px solid var(--line); border-radius: 7px; font-size: 10px; }
.user-actions { display: flex; gap: 10px; white-space: nowrap; }
.user-actions button { padding: 0; color: var(--brand); background: transparent; border: 0; font-size: 10px; }
.user-actions button.danger { color: #d5445d; }
.member-identity strong { display: flex; align-items: center; gap: 5px; }
.member-badge { padding: 2px 5px; color: #3d6ea9; background: #edf5ff; border-radius: 5px; font-size: 8px; }
.member-badge.super { color: #8b6316; background: #fff3d8; }
.member-badge.admin { color: #5541b6; background: #f0ecff; }
.alert-settings-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 14px; }
.alert-window { padding: 13px 14px; color: #454b76; background: #f2f0ff; border: 1px solid #ddd6ff; border-radius: 10px; font-size: 11px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 0; border-bottom: 1px solid #eff1f5; }
.toggle-row:last-child { border-bottom: 0; }
.toggle-row strong { display: block; font-size: 12px; }
.toggle-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.toggle-pill { width: 38px; height: 21px; padding: 2px; background: var(--brand); border: 0; border-radius: 999px; }
.toggle-pill i { display: block; width: 17px; height: 17px; margin-left: 17px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18); }

.team-hero { padding: 22px; background: linear-gradient(135deg, #211b4b, #4b3c91); color: #fff; border-radius: 18px; box-shadow: 0 18px 50px rgba(45, 34, 107, 0.22); }
.team-hero h1 { margin: 0; font-size: 26px; }
.team-hero p { margin: 7px 0 20px; color: rgba(255, 255, 255, 0.6); font-size: 12px; }
.team-stats { display: flex; flex-wrap: wrap; gap: 30px; }
.team-stats strong { display: block; font-size: 22px; }
.team-stats span { color: rgba(255, 255, 255, 0.56); font-size: 10px; }
.org-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 16px 0; }
.org-card { position: relative; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.org-card::before { position: absolute; top: 16px; right: 16px; width: 7px; height: 7px; content: ""; background: var(--brand); border-radius: 50%; }
.org-card h3 { margin: 0 0 6px; font-size: 14px; }
.org-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.member-list { display: grid; gap: 8px; }
.member-row { display: grid; grid-template-columns: minmax(180px, 1.2fr) 1fr 1fr 1fr; align-items: center; gap: 14px; padding: 12px 15px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.member-person { display: flex; align-items: center; gap: 10px; }
.member-person img { width: 36px; height: 36px; object-fit: cover; border-radius: 50%; }
.member-avatar-wrap { position: relative; display: inline-flex; flex: 0 0 auto; }
.member-avatar-wrap .role-emblem { right: -3px; bottom: -2px; }
.member-person strong { display: block; font-size: 12px; }
.member-person small, .member-stat span { color: var(--muted); font-size: 10px; }
.member-stat strong { display: block; font-size: 13px; margin-bottom: 2px; }
.metric-card span,
.info-tile span,
.summary-grid dt,
.member-stat span,
.thread-head,
.reference-meta span { font-weight: 400; }
.thread-head strong,
.member-person strong,
.summary-user strong { font-weight: 600; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 300; max-width: 420px; padding: 12px 15px; color: #fff; background: #242a3d; border-radius: 11px; box-shadow: 0 16px 40px rgba(20, 23, 34, 0.22); font-size: 12px; opacity: 0; transform: translateY(12px); pointer-events: none; transition: 180ms ease; }
.toast.show { opacity: 1; transform: none; }
.modal-backdrop { position: fixed; inset: 0; z-index: 250; display: grid; place-items: center; padding: 24px; background: rgba(13, 16, 29, 0.76); backdrop-filter: blur(10px); }
.modal-panel { width: min(760px, 100%); max-height: calc(100vh - 48px); overflow: auto; background: #fff; border-radius: 20px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28); }
.modal-panel.media-modal { width: min(1180px, 100%); padding: 0; color: #fff; background: #07090f; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.media-modal .modal-head { border-color: rgba(255, 255, 255, 0.12); }
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-close { width: 34px; height: 34px; color: inherit; background: transparent; border: 1px solid currentColor; border-radius: 9px; opacity: 0.55; }
.modal-body { padding: 18px; }
.media-modal .modal-body { display: grid; min-height: 300px; max-height: calc(100vh - 120px); place-items: center; background: #000; }
.media-modal video, .media-modal img { max-width: 100%; max-height: calc(100vh - 135px); object-fit: contain; }
.help-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.help-list li { padding: 13px 14px; color: #535a6b; background: var(--surface-soft); border-radius: 11px; font-size: 12px; line-height: 1.6; }
.help-list strong { color: var(--ink); }
.empty-state { padding: 50px 20px; color: var(--muted); text-align: center; font-size: 12px; }
.pagination-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; color: #8b92a2; background: #fff; border: 1px solid var(--line); border-radius: 12px; font-size: 10px; }
.pagination-bar > div { display: flex; gap: 4px; }
.pagination-bar button { min-width: 29px; height: 28px; padding: 0 8px; color: #616879; background: #fff; border: 1px solid var(--line); border-radius: 7px; font-size: 10px; }
.pagination-bar button.active { color: #fff; background: var(--brand); border-color: var(--brand); }
.pagination-bar button:disabled { opacity: 0.38; cursor: not-allowed; }
.media-fallback { position: relative; min-height: 96px; background: #f4f5f9 !important; }
.media-fallback::after { position: absolute; inset: 0; display: grid; place-items: center; content: "素材暂不可用"; color: #9ca2af; font-size: 10px; }

@media (max-width: 1180px) {
  .topbar { gap: 12px; padding: 0 16px; }
  .main-nav button { padding: 8px 9px; }
  .profile-copy { display: none; }
  .app-content { padding: 18px; }
  .asset-grid { grid-template-columns: repeat(3, 1fr); }
  .detail-layout { grid-template-columns: minmax(0, 0.85fr) minmax(400px, 1.15fr); }
}

@media (max-width: 900px) {
  .topbar { grid-template-columns: 1fr auto; height: auto; min-height: 60px; padding: 9px 12px; }
  .brand span:last-child { display: none; }
  .main-nav { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; overflow-x: auto; }
  .main-nav button { flex: 0 0 auto; white-space: nowrap; }
  .top-actions { grid-column: 2; grid-row: 1; }
  .demo-pill, .icon-button { display: none; }
  .app-content { padding: 12px; }
  .studio-layout { grid-template-columns: 1fr; }
  .studio-sidebar { display: none; }
  .studio-main { padding: 14px; }
  .studio-toolbar > span:first-child { display: none; }
  .mobile-project-select { display: block; }
  .prompt-presets { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-media-card { position: static; }
  .two-cards { grid-template-columns: 1fr; }
  .asset-grid { grid-template-columns: repeat(2, 1fr); }
  .org-grid { grid-template-columns: repeat(2, 1fr); }
  .info-grid { grid-template-columns: 1fr; }
  .admin-layout, .alert-settings-grid { grid-template-columns: 1fr; }
  .member-row { grid-template-columns: 1.3fr 1fr 1fr; }
  .member-row .member-stat:last-child { display: none; }
  .table-controls input { width: 170px; }
}

@media (max-width: 560px) {
  .entry-card { padding: 38px 22px; }
  .entry-features { gap: 7px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { padding: 13px; }
  .metric-card strong { font-size: 22px; }
  .composer-top { align-items: flex-start; flex-direction: column; }
  .composer-footer { flex-direction: column; }
  .table-toolbar { align-items: stretch; flex-direction: column; }
  .table-controls { flex-direction: column; }
  .table-controls input { width: 100%; }
  .summary-grid { grid-template-columns: 1fr; }
  .asset-grid { grid-template-columns: 1fr; }
  .org-grid { grid-template-columns: 1fr; }
  .usage-row { grid-template-columns: minmax(120px, 1fr) 70px; }
  .usage-row > :last-child { display: none; }
  .member-row { grid-template-columns: 1fr 1fr; }
  .member-row .member-stat:nth-of-type(3) { display: none; }
  .modal-backdrop { padding: 10px; }
  .reference-picker { grid-template-columns: repeat(2, 1fr); }
}
