:root {
  --ink: #1c2852;
  --muted: #707b99;
  --soft: #f5f7ff;
  --line: #e6eafb;
  --blue: #3767df;
  --violet: #7658df;
  --shadow: 0 16px 42px rgba(66, 84, 159, .09);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; font-family: Inter, 'PingFang SC', 'Microsoft YaHei', sans-serif; color: var(--ink); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { text-decoration: none; }
:focus-visible { outline: 3px solid #7897f3; outline-offset: 3px; }
.icon-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Shared brand and button language */
.brand-mark { width: 43px; height: 43px; border-radius: 13px; display: grid; place-items: center; flex: none; color: #fff; background: linear-gradient(145deg, #3489ee, #5f56d9 70%, #915ddd); box-shadow: 0 8px 18px #5b64d854, inset 0 1px #ffffff80; }
.brand-mark .icon { width: 25px; height: 25px; stroke-width: 1.6; }
.primary-btn, .ghost-btn { min-height: 44px; padding: 0 19px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; font-size: 13px; font-weight: 720; transition: transform .2s, box-shadow .2s, background .2s; }
.primary-btn { color: #fff; background: linear-gradient(110deg, #3b79e9, #625de0 65%, #8c66e9); border: 1px solid #ffffff42; box-shadow: 0 10px 22px #536ce642, inset 0 1px #ffffff6e; }
.primary-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 26px #536ce654; }
.primary-btn:active, .ghost-btn:active { transform: translateY(0); }
.ghost-btn { color: #425caa; background: #ffffffb8; border: 1px solid #e4eafd; }
.ghost-btn:hover { transform: translateY(-2px); background: #fff; box-shadow: 0 8px 20px #6675bd1d; }
.primary-btn .icon, .ghost-btn .icon { width: 16px; height: 16px; }

/* Workspace */
.workspace-page { background: radial-gradient(circle at 8% 8%, #eff4ff 0, transparent 35%), radial-gradient(circle at 95% 16%, #f2edff 0, transparent 35%), #f8f9ff; }
.header { position: sticky; top: 0; z-index: 30; background: #ffffffd9; border-bottom: 1px solid #e8ecfb; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.header-inner { max-width: 1460px; min-height: 74px; padding: 0 30px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.header-brand { display: flex; align-items: center; gap: 13px; min-width: 0; }
.header-title { font-size: 16px; line-height: 1.25; font-weight: 780; letter-spacing: .015em; }
.header-sub { font-size: 11px; color: #929bb1; white-space: nowrap; margin-top: 4px; }
.header-right { display: flex; align-items: center; gap: 3px; }
.nav-btn { min-height: 39px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: #677392; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 13px; font-weight: 640; white-space: nowrap; cursor: pointer; transition: background .2s, color .2s, transform .2s; }
.nav-btn:hover { color: #365dcc; background: #edf2ff; transform: translateY(-1px); }
.nav-btn .icon { width: 16px; height: 16px; }
.header-divider { width: 1px; height: 23px; background: #dfe5f4; margin: 0 10px; }
.user-info { display: flex; align-items: center; gap: 8px; padding: 0 7px; }
.user-avatar { width: 31px; height: 31px; border-radius: 50%; display: grid; place-items: center; color: #5264c8; background: linear-gradient(145deg, #e0f5ff, #e9e3ff); font-size: 12px; font-weight: 800; }
.user-name { max-width: 100px; color: #273764; font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main-container { max-width: 1460px; margin: auto; padding: 26px 30px 90px; }
.hero { min-height: 444px; padding: 40px 55px; gap: 18px; border-radius: 28px; border: 1px solid #fff; position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; color: var(--ink); background: linear-gradient(90deg, #f5f8fffa 0%, #f4f7fff0 30%, #f2f6ff70 47%, transparent 68%), url('/assets/workspace-hero.png') center center / cover no-repeat; box-shadow: 0 22px 50px #7686c62a, inset 0 1px #fff; isolation: isolate; }
.hero::after { content: ''; position: absolute; inset: auto 0 0; height: 35%; z-index: -1; background: linear-gradient(0deg, #eaf0ff70, transparent); pointer-events: none; }
.hero-copy { max-width: 600px; position: relative; z-index: 1; }
.hero-eyebrow { width: fit-content; padding: 7px 11px; border: 1px solid #ffffffcc; border-radius: 99px; background: #ffffffa8; box-shadow: 0 4px 14px #6685c218; color: #536bc6; font-size: 10px; font-weight: 800; letter-spacing: .16em; margin-bottom: 17px; }
.welcome-title { margin: 0; color: #202b5e; font-size: clamp(34px, 3.6vw, 51px); font-weight: 820; line-height: 1.2; letter-spacing: -.035em; }
.welcome-title strong { color: #5365dc; font-weight: inherit; }
.welcome-sub { max-width: 510px; margin: 14px 0 21px; color: #65718d; font-size: 14px; line-height: 1.75; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-panel { width: min(525px, 100%); padding: 12px 18px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; border: 1px solid #ffffffdc; border-radius: 14px; background: #ffffffb3; box-shadow: 0 8px 22px #7281b01d; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); position: relative; z-index: 1; }
.panel-label { color: #5969a9; font-size: 11px; font-weight: 730; white-space: nowrap; }
.panel-label::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: #62bce6; box-shadow: 0 0 0 3px #8ad7f540; vertical-align: 2px; }
.stats-row { display: flex; align-items: center; gap: 16px; padding-left: 16px; border-left: 1px solid #dbe3f9; }
.stat { display: flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.stat-value { color: #3347a0; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-name { color: #8c95ac; font-size: 10px; }
.model-line { width: 100%; padding-top: 7px; border-top: 1px solid #dce5fa; color: #8994b5; font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.model-line span { color: #5769a7; }
.workspace-section { margin-top: 43px; scroll-margin-top: 92px; }
.section-heading { margin-bottom: 20px; display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.section-kicker { margin: 0 0 7px; color: #7583d6; font-size: 10px; font-weight: 800; letter-spacing: .2em; }
.section-title { margin: 0; color: #25315f; font-size: 25px; font-weight: 790; letter-spacing: -.025em; }
.section-summary { margin: 7px 0 0; color: #8791a9; font-size: 13px; }
.section-tools { display: flex; align-items: center; gap: 14px; }
.section-count { white-space: nowrap; color: #929db2; font-size: 12px; }
.search-box { width: 295px; height: 44px; padding: 0 11px 0 13px; border: 1px solid #e0e7fb; border-radius: 12px; background: #fff; box-shadow: 0 5px 14px #7888bc0c; color: #8a98b8; display: flex; align-items: center; gap: 9px; transition: border-color .2s, box-shadow .2s; }
.search-box:focus-within { border-color: #91a6ef; box-shadow: 0 0 0 4px #718bfa1d; }
.search-box .icon { width: 18px; height: 18px; }
.search-box input { min-width: 0; width: 100%; height: 100%; border: 0; outline: 0; background: transparent; color: #263463; font-size: 13px; }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-box input::placeholder { color: #a0abc0; }
.search-clear { width: 25px; height: 25px; padding: 0; border: 0; border-radius: 6px; display: none; place-items: center; color: #8490aa; background: #f1f4fe; cursor: pointer; }
.search-clear:hover { color: #3e59b5; background: #e7edff; }
.search-clear .icon { width: 13px; height: 13px; }
.section-tabs { width: fit-content; max-width: 100%; display: flex; gap: 5px; padding: 5px; border: 1px solid #e4e9f9; border-radius: 14px; background: #edf1fc; margin-bottom: 23px; }
.section-tab { min-height: 39px; padding: 0 19px; border: 0; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: #7984a2; background: transparent; font-size: 13px; font-weight: 700; white-space: nowrap; cursor: pointer; transition: color .2s, background .2s, box-shadow .2s, transform .2s; }
.section-tab .icon { width: 16px; height: 16px; }
.section-tab:hover { color: #4764c9; transform: translateY(-1px); }
.section-tab.active { color: #3f58bc; background: #fff; box-shadow: 0 4px 11px #7f8eb028; }
.section-content { display: none; }
.section-content.active { display: block; }
.search-group-title { display: none; margin: 0 0 14px; color: #6773a5; font-size: 13px; font-weight: 730; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; }
.agent-card { min-height: 206px; padding: 21px 23px 18px; position: relative; display: none; flex-direction: column; color: inherit; overflow: hidden; background: linear-gradient(150deg, #fff 0%, #fbfcff 100%); border: 1px solid #e8ecfa; border-radius: 17px; box-shadow: 0 6px 18px #6378af0a, inset 0 1px #fff; transition: transform .22s, box-shadow .22s, border-color .22s; }
.agent-card::before { content: ''; position: absolute; width: 165px; height: 165px; right: -75px; top: -95px; border-radius: 50%; background: radial-gradient(circle, #dbe6ff75, transparent 70%); opacity: .6; transition: opacity .2s, transform .3s; pointer-events: none; }
.agent-card:hover { transform: translateY(-5px); border-color: #bdc9f4; box-shadow: 0 18px 32px #6378af21; }
.agent-card:hover::before { opacity: 1; transform: scale(1.4); }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; position: relative; z-index: 1; }
.card-icon { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; color: #4478dd; background: linear-gradient(145deg, #e2f3ff, #ebeaff); box-shadow: inset 0 1px #fff, 0 5px 12px #7594e71b; transition: transform .25s; }
.agent-card:hover .card-icon { transform: rotate(-5deg) scale(1.05); }
.card-icon .icon { width: 24px; height: 24px; stroke-width: 1.7; }
.agent-card:nth-child(4n+2) .card-icon { color: #775ada; background: linear-gradient(145deg, #ece7ff, #f5eaff); }
.agent-card:nth-child(4n+3) .card-icon { color: #d2786d; background: linear-gradient(145deg, #fff0df, #ffe9f0); }
.agent-card:nth-child(4n+4) .card-icon { color: #268bb7; background: linear-gradient(145deg, #dcf9f9, #e7f0ff); }
.card-badge { border-radius: 7px; padding: 6px 9px; color: #5675ca; background: #ebf2ff; font-size: 10px; line-height: 1; font-weight: 760; white-space: nowrap; }
.card-badge.new { color: #835cce; background: #f0eaff; }
.card-title { color: #2a3764; font-size: 17px; font-weight: 760; line-height: 1.35; margin-bottom: 7px; position: relative; z-index: 1; }
.card-desc { color: #818ba5; font-size: 12px; line-height: 1.65; padding-right: 7px; flex: 1; position: relative; z-index: 1; }
.card-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; margin-top: 14px; border-top: 1px solid #edf0f8; color: #9aa5ba; font-size: 11px; position: relative; z-index: 1; }
.card-arrow { width: 25px; height: 25px; border-radius: 8px; display: grid; place-items: center; color: #7a8ace; background: #f0f3ff; transition: color .2s, background .2s, transform .2s; }
.card-arrow .icon { width: 15px; height: 15px; }
.agent-card:hover .card-arrow { color: #fff; background: linear-gradient(135deg, #5981eb, #7861dc); transform: translateX(2px); }
.section-empty, .search-empty { display: none; padding: 42px 20px; border: 1px dashed #cbd4f3; border-radius: 15px; text-align: center; color: #8993ae; font-size: 13px; background: #ffffffbf; }
.section-empty .icon, .search-empty .icon { width: 28px; height: 28px; display: block; margin: 0 auto 10px; color: #96a8d9; }
.workspace-section.searching .section-tabs { display: none; }
.workspace-section.searching .section-content { display: block; margin-top: 22px; }
.workspace-section.searching .section-content.is-filtered-empty { display: none; }
.workspace-section.searching .search-group-title { display: block; }
.workspace-section.searching .section-empty { display: none !important; }

/* Login */
.login-page { display: grid; place-items: center; padding: 28px; background: radial-gradient(circle at 12% 14%, #e0ebff 0, transparent 34%), radial-gradient(circle at 87% 85%, #e7dcff 0, transparent 35%), linear-gradient(135deg, #f9fbff, #f4f3ff); }
.login-shell { width: min(1140px, 100%); min-height: 650px; display: grid; grid-template-columns: minmax(390px, 45%) minmax(0, 1fr); overflow: hidden; border: 1px solid #fff; border-radius: 28px; background: #fff; box-shadow: 0 30px 90px #6775c333, 0 6px 20px #7180bc13; }
.login-form-panel { padding: 46px clamp(28px, 5vw, 66px) 28px; display: flex; flex-direction: column; background: #fffffffc; }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand-title { color: #25315f; font-size: 15px; font-weight: 780; }
.login-brand-sub { color: #9aa4b9; font-size: 10px; margin-top: 4px; }
.login-main { margin: auto 0; padding: 38px 0 28px; }
.login-kicker { color: #6578d4; font-size: 11px; font-weight: 780; letter-spacing: .17em; margin-bottom: 12px; }
.login-heading { margin: 0; color: #24305d; font-size: clamp(30px, 3vw, 39px); line-height: 1.2; letter-spacing: -.035em; font-weight: 810; }
.login-heading span { color: #6571db; }
.login-subtitle { margin: 12px 0 34px; color: #8a94ab; font-size: 13px; line-height: 1.7; }
.error-msg { display: none; padding: 11px 13px; margin-bottom: 17px; border: 1px solid #ffd1d7; border-radius: 10px; background: #fff3f4; color: #ba4556; font-size: 12px; line-height: 1.5; }
.form-group { margin-bottom: 19px; }
.form-label { display: block; margin-bottom: 8px; color: #4c5879; font-size: 12px; font-weight: 730; }
.field-shell { height: 49px; display: flex; align-items: center; gap: 10px; padding: 0 14px; color: #9aa8c4; background: #f8faff; border: 1px solid #e5eafb; border-radius: 11px; transition: background .2s, border-color .2s, box-shadow .2s; }
.field-shell:focus-within { background: #fff; border-color: #94a6ed; box-shadow: 0 0 0 4px #758cfb1a; }
.field-shell .icon { width: 18px; height: 18px; }
.form-input { width: 100%; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: #27345e; font-size: 14px; }
.form-input::placeholder { color: #a9b2c6; }
.password-toggle { flex: none; border: 0; background: transparent; color: #6577b2; padding: 5px 0 5px 8px; font-size: 12px; font-weight: 680; cursor: pointer; }
.password-toggle:hover { color: #375fdb; }
.btn-login { width: 100%; min-height: 49px; margin-top: 7px; font-size: 14px; border-radius: 11px; }
.btn-login:disabled { opacity: .65; cursor: wait; transform: none; box-shadow: none; }
.btn-spinner { display: none; width: 16px; height: 16px; border: 2px solid #ffffff70; border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.btn-login.loading .btn-spinner { display: block; }
.login-hint { display: flex; align-items: center; gap: 7px; margin-top: 19px; color: #9ca6bd; font-size: 11px; }
.login-hint .icon { width: 14px; height: 14px; }
.login-footer { color: #adb5c6; font-size: 10px; }
.visual-panel { position: relative; isolation: isolate; padding: 46px; overflow: hidden; background: url('/assets/workspace-hero.png') 61% center / cover no-repeat, #cbd9ff; }
.visual-panel::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, #526de751 0%, transparent 34%, #6b5ad614 100%); }
.visual-copy { position: relative; z-index: 1; max-width: 340px; }
.visual-kicker { display: inline-block; padding: 7px 11px; border-radius: 99px; color: #3955a1; background: #ffffffb9; border: 1px solid #fff; font-size: 10px; font-weight: 800; letter-spacing: .13em; backdrop-filter: blur(10px); }
.visual-title { margin: 20px 0 0; color: #24376c; font-size: clamp(25px, 2.5vw, 36px); line-height: 1.35; font-weight: 810; letter-spacing: -.035em; text-shadow: 0 1px #ffffff8c; }
.visual-bottom { position: absolute; left: 44px; bottom: 37px; z-index: 1; display: flex; gap: 8px; flex-wrap: wrap; }
.visual-chip { padding: 8px 11px; color: #395594; background: #ffffffb5; border: 1px solid #fff; border-radius: 10px; font-size: 11px; font-weight: 700; box-shadow: 0 6px 18px #5a73b021; backdrop-filter: blur(10px); }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1100px) {
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { background-position: 55% center; }
  .header-sub { display: none; }
  .section-tools { gap: 8px; }
  .search-box { width: 250px; }
}
@media (max-width: 760px) {
  .header-inner { min-height: 62px; padding: 0 16px; }
  .header-title { font-size: 14px; }
  .brand-mark { width: 37px; height: 37px; border-radius: 11px; }
  .brand-mark .icon { width: 21px; height: 21px; }
  .header-right { gap: 1px; }
  .nav-btn { min-width: 34px; padding: 0 8px; font-size: 0; }
  .nav-btn .icon { width: 18px; height: 18px; }
  .header-divider, .user-info { display: none; }
  .main-container { padding: 16px 16px 60px; }
  .hero { min-height: 432px; padding: 27px 24px; border-radius: 20px; background-image: linear-gradient(90deg, #f6f8fffa 0%, #f6f8fff0 55%, #f1f4ff9e 100%), url('/assets/workspace-hero.png'); background-position: 60% center; }
  .welcome-title { font-size: 34px; }
  .welcome-sub { font-size: 13px; }
  .workspace-section { margin-top: 34px; }
  .section-heading { align-items: stretch; flex-direction: column; gap: 17px; }
  .section-tools { justify-content: space-between; }
  .search-box { flex: 1; width: auto; }
  .section-tabs { overflow-x: auto; scrollbar-width: none; }
  .section-tabs::-webkit-scrollbar { display: none; }
  .section-tab { flex: none; padding: 0 15px; }
  .login-page { padding: 15px; }
  .login-shell { grid-template-columns: 1fr; min-height: 0; max-width: 520px; }
  .visual-panel { order: -1; min-height: 215px; padding: 24px; background-position: 55% 56%; }
  .visual-copy { max-width: 250px; }
  .visual-title { font-size: 24px; margin-top: 10px; }
  .visual-bottom { display: none; }
  .login-form-panel { padding: 25px 30px 28px; }
  .login-main { padding: 36px 0 31px; }
  .login-footer { text-align: center; }
}
@media (max-width: 560px) {
  .card-grid { grid-template-columns: 1fr; gap: 12px; }
  .agent-card { min-height: 190px; padding: 19px; }
  .hero-panel { padding: 11px 13px; gap: 9px; }
  .panel-label { display: none; }
  .stats-row { padding: 0; border: 0; gap: 13px; }
  .stat-value { font-size: 15px; }
  .section-count { display: none; }
  .login-page { padding: 0; display: block; background: #fff; }
  .login-shell { width: 100%; min-height: 100vh; border: 0; border-radius: 0; box-shadow: none; }
  .visual-panel { min-height: 190px; }
  .login-form-panel { padding: 25px 23px 32px; }
  .login-heading { font-size: 31px; }
  .form-input { font-size: 16px; }
}
@media (max-width: 360px) {
  .header-inner { padding: 0 10px; gap: 8px; }
  .header-brand { gap: 8px; }
  .header-title { font-size: 13px; }
  .nav-btn { min-width: 29px; padding: 0 5px; }
  .hero { padding: 24px 18px; }
  .hero-actions { gap: 7px; }
  .primary-btn, .ghost-btn { padding: 0 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
