:root {
  color-scheme: dark;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --bg: #080a0f;
  --panel: rgba(27, 30, 38, .88);
  --panel-2: #20232c;
  --panel-3: #151821;
  --border: #343947;
  --border-soft: rgba(255,255,255,.075);
  --text: #f7f7fb;
  --muted: #9299aa;
  --subtle: #686f80;
  --violet: #725cff;
  --violet-2: #8b4dff;
  --green: #75e4b5;
  --amber: #ffb84d;
  --blue: #7cbcff;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 32px 32px;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

.ambient { position: fixed; pointer-events: none; filter: blur(2px); z-index: 0; }
.ambient-one { width: 900px; height: 400px; left: 24%; top: -280px; background: radial-gradient(ellipse, rgba(114,87,255,.28), transparent 68%); }
.ambient-two { width: 500px; height: 420px; right: -280px; top: 310px; background: radial-gradient(circle, rgba(255,59,155,.07), transparent 68%); }

.topbar {
  position: sticky; top: 0; z-index: 50;
  height: 72px; display: flex; align-items: center;
  padding: 0 30px; border-bottom: 1px solid #262a35;
  background: rgba(8,10,15,.9); backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; width: 280px; min-width: 220px; }
.brand img { display: block; width: auto; height: 45px; max-width: 210px; object-fit: contain; }
.main-nav { display: flex; height: 100%; align-items: center; justify-content: center; gap: 12px; flex: 1; }
.main-nav a { position: relative; padding: 25px 16px 23px; color: #a9afbd; font-size: 14px; font-weight: 650; transition: .2s ease; }
.main-nav a:hover { color: #fff; }
.main-nav a.active { color: #fff; }
.main-nav a.active::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: -1px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, #725cff, #b063ff); box-shadow: 0 0 15px rgba(133,91,255,.8); }
.account-area { width: 280px; min-width: 220px; display: flex; justify-content: flex-end; align-items: center; gap: 16px; }
.points-pill { height: 36px; display: inline-flex; align-items: center; gap: 8px; padding: 0 13px; border: 1px solid var(--border-soft); border-radius: 10px; background: rgba(24,27,35,.8); font-weight: 750; }
.points-star { display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; background: linear-gradient(135deg,#8b4dff,#5e5eff); box-shadow: 0 0 15px rgba(114,92,255,.45); font-size: 11px; }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; overflow: hidden; border: 1px solid rgba(255,255,255,.15); border-radius: 50%; background: linear-gradient(135deg,#333746,#181b24); color: #d8dbea; font-size: 12px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.page-shell { position: relative; z-index: 1; width: min(1580px, calc(100% - 64px)); margin: 0 auto; padding: 36px 0 70px; }
.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.eyebrow { display: flex; align-items: center; gap: 9px; color: #9d8aff; font-size: 10px; font-weight: 800; letter-spacing: 2.7px; }
.eyebrow span { width: 17px; height: 1px; background: linear-gradient(90deg,#ff8a39,#ff3b9b,#725cff); box-shadow: 0 0 10px #725cff; }
.page-intro h1 { margin: 9px 0 4px; font-size: clamp(26px, 2.1vw, 34px); letter-spacing: .5px; line-height: 1.2; }
.page-intro p { margin: 0; color: var(--muted); font-size: 14px; }
.intro-actions { display: flex; gap: 12px; }
.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 11px; padding: 0 18px; border: 1px solid transparent; color: #f4f5fa; transition: transform .18s ease, border-color .18s ease, background .18s ease, opacity .18s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .55; transform: none; }
.button.secondary { border-color: #3b4050; background: rgba(21,24,32,.76); }
.button.secondary:hover { border-color: #5a6072; background: #20242e; }
.button.primary { border: 0; background: linear-gradient(112deg,#ff7a3d 0%,#f2479f 44%,#725cff 100%); box-shadow: 0 11px 28px rgba(114,72,255,.2); font-weight: 750; }
.button.primary:hover { box-shadow: 0 14px 34px rgba(114,72,255,.34); }
.button.danger { border-color: rgba(240,95,107,.35); background: rgba(215,67,82,.11); color: #ff9da6; }
.button-icon { font-size: 19px; line-height: 1; }

.login-notice { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 16px; padding: 14px 18px; border: 1px solid rgba(139,101,255,.32); border-radius: 13px; background: linear-gradient(90deg,rgba(114,92,255,.13),rgba(255,59,155,.06)); }
.login-notice div { display: flex; align-items: baseline; gap: 12px; }
.login-notice span { color: var(--muted); font-size: 13px; }
.login-notice a { padding: 8px 13px; border-radius: 9px; background: #735dff; font-size: 13px; font-weight: 700; }

.metrics { display: grid; grid-template-columns: 1.55fr .7fr .7fr; gap: 14px; margin-bottom: 16px; }
.metric-card { min-height: 82px; display: flex; align-items: center; gap: 15px; padding: 15px 18px; border: 1px solid var(--border-soft); border-radius: 14px; background: linear-gradient(135deg,rgba(27,30,38,.92),rgba(18,21,29,.84)); box-shadow: 0 15px 40px rgba(0,0,0,.12); }
.metric-card > div:not(.metric-icon) { min-width: 80px; }
.metric-card span { display: block; color: var(--muted); font-size: 12px; }
.metric-card strong { display: block; margin-top: 3px; font-size: 23px; }
.metric-wide i { width: 1px; height: 42px; margin: 0 18px 0 auto; background: var(--border); }
.metric-icon { width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; font-size: 20px; }
.metric-icon.violet { color: #a88fff; background: rgba(114,92,255,.17); }
.metric-icon.blue { color: #7cbcff; background: rgba(80,114,255,.14); }
.metric-icon.amber { color: #ffbd55; background: rgba(255,165,43,.14); }

.toolbar { min-height: 58px; display: flex; align-items: center; gap: 10px; padding: 10px; margin-bottom: 18px; border: 1px solid var(--border-soft); border-radius: 14px; background: rgba(18,21,28,.74); backdrop-filter: blur(14px); }
.search-box { height: 38px; min-width: 260px; flex: 1; display: flex; align-items: center; gap: 10px; padding: 0 13px; border: 1px solid #373c4a; border-radius: 9px; background: rgba(12,14,20,.68); }
.search-box:focus-within { border-color: #725cff; box-shadow: 0 0 0 3px rgba(114,92,255,.1); }
.search-box svg { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: #7f8799; stroke-width: 1.8; }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 13px; }
.search-box input::placeholder { color: #676f80; }
.toolbar select { height: 38px; min-width: 118px; border: 1px solid #303542; border-radius: 9px; outline: 0; padding: 0 34px 0 12px; color: #c9cdd7; background-color: #171a22; font-size: 12px; cursor: pointer; }
.toolbar select:focus { border-color: #725cff; }
.view-switch { display: flex; border: 1px solid #343947; border-radius: 9px; overflow: hidden; background: #171a22; }
.view-switch button { width: 39px; height: 36px; border: 0; color: #7f8797; background: transparent; font-size: 18px; }
.view-switch button.active { color: #a287ff; background: rgba(114,92,255,.14); }
.view-switch button:disabled { cursor: default; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 342px; gap: 18px; align-items: start; }
.library-column { min-width: 0; }
.section-caption { min-height: 28px; display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; color: var(--muted); font-size: 12px; }
.section-caption strong { color: #dfe2eb; font-size: 13px; }
.section-caption div span { margin-left: 8px; color: #736a91; }
.character-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.character-card { min-width: 0; overflow: hidden; border: 1px solid #373c49; border-radius: 14px; background: linear-gradient(180deg,#1c2029,#12151c); text-align: left; box-shadow: 0 16px 38px rgba(0,0,0,.13); transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.character-card:hover { transform: translateY(-2px); border-color: #545b6c; box-shadow: 0 20px 44px rgba(0,0,0,.25); }
.character-card.selected { border-color: #725cff; box-shadow: 0 0 0 1px rgba(114,92,255,.25),0 18px 45px rgba(73,48,178,.22); }
.card-cover { position: relative; aspect-ratio: 1.55 / 1; overflow: hidden; background: #222631; }
.card-cover::after { content: ""; position: absolute; inset: auto 0 0; height: 36%; background: linear-gradient(transparent,rgba(8,10,15,.75)); }
.card-cover img { width: 100%; height: 100%; display: block; object-fit: cover; filter: saturate(.9) contrast(1.02); transition: transform .35s ease; }
.character-card:hover .card-cover img { transform: scale(1.025); }
.status-pill { position: absolute; z-index: 2; top: 9px; right: 9px; display: flex; align-items: center; gap: 5px; padding: 5px 8px; border: 1px solid rgba(255,255,255,.08); border-radius: 999px; background: rgba(12,14,19,.72); backdrop-filter: blur(10px); color: #d5d9e2; font-size: 10px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 9px rgba(117,228,181,.55); }
.status-draft .status-dot { background: var(--amber); box-shadow: 0 0 9px rgba(255,184,77,.5); }
.status-incomplete .status-dot { background: var(--blue); box-shadow: 0 0 9px rgba(124,188,255,.5); }
.demo-badge { position: absolute; z-index: 2; left: 9px; top: 9px; padding: 4px 7px; border-radius: 999px; background: rgba(114,92,255,.68); color: white; font-size: 9px; font-weight: 750; letter-spacing: .5px; }
.card-body { padding: 11px 12px 12px; }
.card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-title-row h3 { min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
.card-more { border: 0; padding: 0; color: #828a9b; background: transparent; font-size: 19px; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; min-height: 22px; margin-top: 7px; }
.tag { max-width: 104px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 4px 7px; border-radius: 5px; color: #bdadff; background: rgba(114,92,255,.14); font-size: 9px; }
.tag.role { color: #ff9dc4; background: rgba(255,59,155,.12); }
.card-project { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: #a8afbd; font-size: 10px; }
.folder-icon { width: 11px; height: 8px; border: 1px solid #6f7788; border-radius: 2px; }
.card-meta { display: flex; justify-content: space-between; margin-top: 7px; color: #747d8e; font-size: 9px; }

.detail-panel { position: sticky; top: 88px; min-height: 650px; overflow: hidden; border: 1px solid #363b49; border-radius: 15px; background: linear-gradient(180deg,rgba(25,28,37,.96),rgba(14,17,24,.96)); box-shadow: 0 24px 70px rgba(0,0,0,.22); }
.detail-empty { min-height: 650px; display: grid; place-items: center; padding: 30px; text-align: center; color: var(--muted); }
.detail-empty strong { display: block; margin-bottom: 7px; color: #d7dbe5; }
.detail-content { padding: 16px; }
.detail-head { display: grid; grid-template-columns: 68px 1fr auto; gap: 12px; align-items: center; padding-bottom: 15px; border-bottom: 1px solid var(--border-soft); }
.detail-avatar { width: 68px; height: 68px; overflow: hidden; border-radius: 11px; background: #2a2d35; }
.detail-avatar img { width: 100%; height: 100%; object-fit: cover; }
.detail-head h2 { margin: 0 0 6px; font-size: 18px; }
.detail-head .tags { margin: 0; }
.detail-status { grid-column: 2; margin-top: -10px; color: var(--green); font-size: 10px; }
.detail-menu { align-self: start; border: 0; color: #939aaa; background: transparent; font-size: 19px; }
.detail-section { padding: 14px 0; border-bottom: 1px solid var(--border-soft); }
.detail-section:last-of-type { border-bottom: 0; }
.detail-section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; }
.detail-section-head strong { font-size: 12px; }
.detail-section-head span { color: #747c8e; font-size: 9px; }
.thumb-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 7px; }
.thumb { position: relative; aspect-ratio: 1 / 1; overflow: hidden; border: 1px solid #3a3f4c; border-radius: 8px; background: #262a33; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb:nth-child(2) img { object-position: 65% center; transform: scale(1.08); }
.thumb:nth-child(3) img { filter: grayscale(.25) brightness(.75); transform: scaleX(-1); }
.thumb:nth-child(4) { background: linear-gradient(135deg,#20242d,#11141b); }
.thumb:nth-child(4)::before { content: "三视图"; position: absolute; inset: 0; display: grid; place-items: center; color: #858d9c; font-size: 9px; }
.thumb-labels { display: grid; grid-template-columns: repeat(4,1fr); gap: 7px; margin-top: 5px; color: #7f8798; text-align: center; font-size: 8px; }
.outfit-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.outfit { overflow: hidden; border: 1px solid #353a47; border-radius: 8px; background: #252932; }
.outfit img { width: 100%; aspect-ratio: 1.1 / 1; display: block; object-fit: cover; }
.outfit:nth-child(2) img { filter: sepia(.18) saturate(.8); }
.outfit:nth-child(3) img { filter: hue-rotate(12deg) brightness(1.15); }
.outfit span { display: block; padding: 5px 3px; color: #858d9c; text-align: center; font-size: 8px; }
.resource-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
.resource { display: grid; place-items: center; min-width: 0; min-height: 62px; padding: 8px 3px; border: 1px solid rgba(255,255,255,.055); border-radius: 9px; background: rgba(255,255,255,.027); }
.resource i { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 7px; background: rgba(114,92,255,.16); color: #8976ff; font-style: normal; font-size: 12px; }
.resource:nth-child(2) i { color: #70d9a6; background: rgba(66,203,139,.12); }
.resource:nth-child(3) i { color: #a579ff; background: rgba(149,91,255,.13); }
.resource:nth-child(4) i { color: #ffad57; background: rgba(255,145,52,.12); }
.resource span { width: 100%; margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #b5bbc7; text-align: center; font-size: 8px; }
.detail-description { margin: 10px 0 0; color: #9299aa; font-size: 11px; line-height: 1.65; }
.detail-actions { display: grid; grid-template-columns: 1fr 44px; gap: 8px; padding-top: 14px; }
.detail-actions .button { width: 100%; min-height: 40px; }
.detail-actions .icon-button { width: 44px; }

.empty-state { min-height: 460px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px dashed #343947; border-radius: 15px; background: rgba(18,21,28,.48); text-align: center; }
.empty-orbit { width: 74px; height: 74px; display: grid; place-items: center; border: 1px solid rgba(114,92,255,.4); border-radius: 50%; box-shadow: inset 0 0 30px rgba(114,92,255,.12),0 0 35px rgba(114,92,255,.08); }
.empty-orbit span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg,#ff6d46,#df43b2,#725cff); font-size: 22px; }
.empty-state h2 { margin: 18px 0 6px; font-size: 18px; }
.empty-state p { margin: 0 0 20px; color: var(--muted); font-size: 13px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: rgba(2,3,6,.76); backdrop-filter: blur(10px); }
.modal { width: min(820px,calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; border: 1px solid #3b4050; border-radius: 18px; background: linear-gradient(180deg,#1b1e27,#10131a); box-shadow: 0 34px 110px rgba(0,0,0,.58); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 19px 22px; border-bottom: 1px solid var(--border-soft); }
.modal-header h2 { margin: 4px 0 0; font-size: 20px; }
.modal-kicker { color: #8f7bff; font-size: 9px; font-weight: 800; letter-spacing: 2px; }
.icon-button { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid #3b4050; border-radius: 10px; color: #b7bdc9; background: #20232c; font-size: 21px; }
.form-layout { display: grid; grid-template-columns: 220px 1fr; gap: 22px; padding: 22px; }
.cover-editor { min-width: 0; }
.cover-preview { aspect-ratio: 4 / 5; display: grid; place-items: center; overflow: hidden; border: 1px dashed #4a5060; border-radius: 13px; background: #151821; color: #697183; font-size: 12px; }
.cover-preview img { width: 100%; height: 100%; object-fit: cover; }
.text-button { border: 0; padding: 0; color: #9a87ff; background: transparent; font-size: 12px; }
.cover-editor .text-button { display: block; margin: 12px auto 0; }
.form-fields { display: grid; gap: 13px; }
.form-fields label { display: grid; gap: 6px; }
.form-fields label > span { color: #aeb4c1; font-size: 11px; }
.form-fields input,.form-fields select,.form-fields textarea { width: 100%; border: 1px solid #363b48; border-radius: 9px; outline: 0; padding: 10px 11px; color: #f2f3f7; background: #14171f; font-size: 12px; resize: vertical; }
.form-fields input:focus,.form-fields select:focus,.form-fields textarea:focus { border-color: #725cff; box-shadow: 0 0 0 3px rgba(114,92,255,.1); }
.form-fields input::placeholder,.form-fields textarea::placeholder { color: #5c6475; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-footer { display: flex; gap: 10px; align-items: center; padding: 16px 22px; border-top: 1px solid var(--border-soft); }
.footer-spacer { flex: 1; }
.asset-modal { width: min(900px,calc(100vw - 32px)); }
.asset-toolbar { display: flex; justify-content: space-between; padding: 15px 22px 0; color: #8e96a7; font-size: 12px; }
.asset-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 12px; padding: 18px 22px 24px; }
.asset-item { position: relative; overflow: hidden; border: 1px solid #363b48; border-radius: 11px; background: #151821; text-align: left; }
.asset-item:hover { border-color: #725cff; }
.asset-item img { width: 100%; aspect-ratio: 1 / 1; display: block; object-fit: cover; }
.asset-item span { display: block; padding: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #afb5c1; font-size: 10px; }
.asset-empty { min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; color: var(--muted); text-align: center; }
.asset-empty strong { margin-bottom: 7px; color: #e1e4eb; }

.toast-region { position: fixed; right: 24px; bottom: 24px; z-index: 150; display: grid; gap: 8px; }
.toast { min-width: 260px; padding: 12px 14px; border: 1px solid #414758; border-radius: 11px; background: rgba(28,32,42,.96); box-shadow: 0 18px 50px rgba(0,0,0,.35); color: #e8eaf0; font-size: 12px; animation: toast-in .25s ease; }
.toast.error { border-color: rgba(229,82,96,.48); color: #ffb2b9; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1260px) {
  .brand,.account-area { width: 220px; }
  .main-nav { gap: 4px; }
  .main-nav a { padding-left: 11px; padding-right: 11px; }
  .character-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 980px) {
  .topbar { padding: 0 18px; }
  .brand { width: auto; min-width: auto; }
  .brand img { height: 38px; max-width: 160px; }
  .main-nav { display: none; }
  .account-area { width: auto; min-width: auto; margin-left: auto; }
  .page-shell { width: min(100% - 30px,760px); padding-top: 24px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric-wide { grid-column: span 2; }
  .toolbar { flex-wrap: wrap; }
  .search-box { flex-basis: 100%; }
  .toolbar select { flex: 1; }
  .workspace { grid-template-columns: 1fr; }
  .detail-panel { position: relative; top: 0; min-height: auto; }
  .detail-empty { min-height: 220px; }
}
@media (max-width: 680px) {
  .page-intro { align-items: flex-start; flex-direction: column; }
  .intro-actions { width: 100%; }
  .intro-actions .button { flex: 1; }
  .login-notice,.login-notice div { align-items: flex-start; flex-direction: column; }
  .metrics { grid-template-columns: 1fr; }
  .metric-wide { grid-column: auto; }
  .metric-wide i { margin-left: auto; }
  .character-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .form-layout { grid-template-columns: 1fr; }
  .cover-preview { width: 190px; margin: auto; }
  .field-row { grid-template-columns: 1fr; }
  .asset-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 420px) {
  .points-pill { display: none; }
  .page-shell { width: calc(100% - 22px); }
  .character-grid { grid-template-columns: 1fr; }
  .toolbar select { min-width: calc(50% - 8px); }
}
