:root {
  --blue: #5b6ff6;
  --blue-soft: #eef0ff;
  --ink: #17233c;
  --line: #e4eaf6;
  --bg: #f4f7fc;
  --green: #11a879;
  --orange: #ef9d3f;
  --red: #ed6070;
  --accent: #5b6ff6;
  --accent-2: #8b5cf6;
  --accent-soft: rgba(91, 111, 246, .12);
  --sidebar: #10182f;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--bg);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(78, 125, 255, .28);
  outline-offset: 2px;
}

.app { display: flex; min-height: 100vh; }
.app[data-role="customer_service"] { --accent: #e99142; --accent-2: #f4bd68; --accent-soft: rgba(233,145,66,.14); --sidebar: #1d2435; }
.app[data-role="boss"] { --accent: #158bc8; --accent-2: #42c1d0; --accent-soft: rgba(21,139,200,.13); --sidebar: #102636; }
.app[data-role="player"] { --accent: #9a5ce7; --accent-2: #e775b0; --accent-soft: rgba(154,92,231,.13); --sidebar: #211635; }
.role-customer_service { background: linear-gradient(135deg,#fffaf4,#f6f8fc 48%,#fff8ef); }
.role-boss { background: linear-gradient(135deg,#f1fbff,#f6f8fc 48%,#effcff); }
.role-player { background: linear-gradient(135deg,#fbf8ff,#f6f8fc 48%,#fff5fb); }
.sidebar {
  position: relative;
  overflow: hidden;
  display: flex;
  flex: 0 0 236px;
  flex-direction: column;
  width: 236px;
  padding: 20px 13px 15px;
  color: #dbe6ff;
  background: radial-gradient(circle at 0 0, rgba(122,143,255,.22), transparent 30%), var(--sidebar);
  box-shadow: 14px 0 36px rgba(21,32,59,.08);
}
.sidebar-glow { position:absolute; width:230px; height:230px; top:42%; left:-122px; border:1px solid rgba(151,169,255,.23); border-radius:50%; box-shadow:0 0 0 28px rgba(151,169,255,.025),0 0 0 58px rgba(151,169,255,.02); pointer-events:none; animation:sidebarPulse 6s ease-in-out infinite; }
.brand { position:relative; z-index:1; display:flex; align-items:center; gap:10px; padding: 4px 9px 19px; color: #fff; font-size: 19px; font-weight: 800; letter-spacing:.02em; }
.brand small { display:block; margin-top:2px; color:rgba(216,227,255,.58); font-size:8px; font-weight:700; letter-spacing:.16em; }
.brand-mark { display:grid; width:35px; height:35px; place-items:center; color:#fff; background:linear-gradient(135deg,var(--accent),var(--accent-2)); border-radius:12px; box-shadow:0 8px 19px var(--accent-soft); }
.workspace-chip { position:relative; z-index:1; display:flex; align-items:center; gap:7px; margin:0 7px 14px; padding:8px 10px; color:rgba(222,230,255,.7); background:rgba(255,255,255,.055); border:1px solid rgba(255,255,255,.08); border-radius:9px; font-size:11px; }
.online-dot { width:7px; height:7px; border-radius:50%; background:#4fe0a6; box-shadow:0 0 0 4px rgba(79,224,166,.11); animation:onlinePulse 2s ease-in-out infinite; }
.nav { position:relative; z-index:1; }
.nav a { display:flex; align-items:center; gap:10px; margin:4px 0; padding:10px 11px; color:rgba(226,234,255,.78); border:1px solid transparent; border-radius:11px; transition:transform .2s ease,background .2s ease,color .2s ease,border-color .2s ease; }
.nav a:hover { color:#fff; background:rgba(255,255,255,.07); transform:translateX(3px); }
.nav a.active { color:#fff; background:linear-gradient(100deg,var(--accent),var(--accent-2)); border-color:rgba(255,255,255,.14); box-shadow:0 9px 20px var(--accent-soft); font-weight:700; }
.nav-icon { display:grid; width:22px; height:22px; place-items:center; color:inherit; border-radius:7px; font-size:15px; line-height:1; }
.sidebar-footer { position:relative; z-index:1; margin-top:auto; padding:11px 7px 0; color:rgba(210,222,255,.46); font-size:10px; }
.logout { display:flex; align-items:center; justify-content:center; gap:7px; margin-top:9px; padding:9px; color:#ffb3bc; border:1px solid rgba(255,170,180,.25); border-radius:9px; text-align:center; transition:background .2s ease,transform .2s ease; }
.logout:hover { color:#fff; background:rgba(237,96,112,.19); transform:translateY(-1px); }

.main { flex: 1; min-width: 0; padding: 24px; }
.topbar, .panel, .card { background: rgba(255,255,255,.9); border: 1px solid var(--line); border-radius: 18px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; padding: 14px 18px; box-shadow:0 8px 23px rgba(31,49,91,.035); }
.page-heading { display:flex; align-items:center; gap:11px; }.page-heading strong { display:block; color:#1c2b48; font-size:17px; }.page-symbol { display:grid; width:39px; height:39px; place-items:center; color:var(--accent); background:var(--accent-soft); border-radius:13px; font-size:20px; font-weight:800; }
.profile-chip { display:flex; align-items:center; gap:7px; color:#4c5d7d; font-size:13px; font-weight:700; }.profile-avatar { display:grid; width:29px; height:29px; place-items:center; color:#fff; background:linear-gradient(145deg,var(--accent),var(--accent-2)); border-radius:10px; font-size:12px; }
.role { display: inline-block; padding: 4px 9px; color:var(--accent); background:var(--accent-soft); border-radius: 999px; font-size: 11px; font-weight: 800; }
.panel { position:relative; overflow:hidden; margin-bottom: 16px; padding: 20px; box-shadow:0 11px 27px rgba(31,49,91,.035); }
.panel::after { position:absolute; top:0; left:23px; width:58px; height:2px; content:''; background:linear-gradient(90deg,var(--accent),var(--accent-2)); border-radius:0 0 4px 4px; opacity:.7; }
.card { position:relative; min-width:0; padding:16px; overflow:hidden; box-shadow:0 8px 19px rgba(31,49,91,.025); transition:transform .2s ease,box-shadow .2s ease,border-color .2s ease; }
.card:hover { border-color:#cfd9f3; box-shadow:0 14px 28px rgba(31,49,91,.08); transform:translateY(-3px); }
h1 { margin: 0 0 16px; font-size: 20px; line-height: 1.3; }
h2 { margin: 0 0 12px; font-size: 16px; line-height: 1.35; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.metric { margin-top: 6px; color: var(--accent); font-size: 24px; font-weight: 800; overflow-wrap: anywhere; }
.muted { color: #8290a9; }
.small { font-size: 12px; }

.filters, .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: end; gap: 10px; }
.check-grid { display: flex; flex-wrap: wrap; gap: 9px; margin: 0 0 14px; }
.check-option { display: inline-flex; align-items: center; min-height: 38px; gap: 7px; padding: 7px 11px; color: #35517f; background: #f6f8ff; border: 1px solid #dbe4f7; border-radius: 10px; cursor: pointer; }
.check-option input { min-height: auto; width: 16px; height: 16px; margin: 0; }
label { display: block; color: #60708d; font-size: 12px; font-weight: 700; }
input, select, textarea {
  width: 100%;
  min-height: 40px;
  margin-top: 5px;
  padding: 9px 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #d9e2f2;
  border-radius: 8px;
}
textarea { min-height: 74px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow:0 0 0 4px var(--accent-soft); outline:0; }
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 13px;
  color: var(--accent);
  background: #fff;
  border: 1px solid #becbff;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}
button:hover, .button:hover { filter:brightness(.99); transform:translateY(-1px); box-shadow:0 7px 13px rgba(31,49,91,.08); }
button.primary, .button.primary { color: #fff; background: linear-gradient(100deg,var(--accent),var(--accent-2)); border-color: var(--accent); box-shadow:0 8px 16px var(--accent-soft); }
button.good, .button.good { color: #087f50; background: #effdf6; border-color: #b7efd2; }
button.danger, .button.danger { color: var(--red); background: #fff6f7; border-color: #ffcbd0; }

.table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 12px;
}
table { width: 100%; min-width: 720px; border-collapse: collapse; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
th { color: #53637d; background: #f8faff; font-size:12px; }
tbody tr { transition:background .16s ease; } tbody tr:hover { background:#f7f9ff; } tr:last-child td { border-bottom: 0; }

.tag { display: inline-block; padding: 3px 8px; color: var(--blue); background: #edf2ff; border-radius: 999px; font-size: 12px; }
.tag.green { color: #139764; background: #eafff3; }
.tag.red { color: var(--red); background: #fff0f1; }
.tag.orange { color: #cc7b0b; background: #fff3dd; }
.flash { margin-bottom: 12px; padding: 10px 12px; border-radius: 10px; animation:flashEnter .32s ease both; }
.flash.success { color: #087f50; background: #effdf6; }
.flash.error { color: #ae3742; background: #fff0f1; }
.actions { display: flex; flex-wrap: wrap; gap: 7px; }
.actions input:not([type="hidden"]) { min-width: 104px; flex: 1 1 110px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.page-enter > * { animation:pageEnter .42s cubic-bezier(.2,.85,.28,1) both; }.page-enter > *:nth-child(2) { animation-delay:.04s; }.page-enter > *:nth-child(3) { animation-delay:.08s; }.page-enter > *:nth-child(4) { animation-delay:.12s; }

/* Independent entrance experience: no external artwork or copied site assets. */
.portal-body { min-height: 100vh; background: #f8faff; }
.portal {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  overflow: hidden;
  padding: 40px 20px 70px;
  isolation: isolate;
}
.portal::before {
  position: absolute;
  inset: 0;
  z-index: -3;
  content: '';
  background:
    radial-gradient(circle at 15% 22%, rgba(131, 166, 255, .17), transparent 25%),
    radial-gradient(circle at 87% 83%, rgba(207, 185, 255, .2), transparent 29%),
    linear-gradient(135deg, #fbfcff 0%, #f2f6ff 48%, #f8f9ff 100%);
}
.portal-glow { position: absolute; z-index: -2; width: 330px; height: 330px; border-radius: 50%; filter: blur(2px); opacity: .62; animation: portalFloat 9s ease-in-out infinite; }
.glow-one { top: -150px; left: -100px; background: rgba(160, 191, 255, .22); }
.glow-two { right: -120px; bottom: -160px; background: rgba(200, 174, 255, .2); animation-delay: -4.5s; }
.portal-welcome, .portal-auth { width: min(100%, 470px); text-align: center; }
.portal-welcome { animation: portalEnter .55s cubic-bezier(.2,.85,.28,1) both; }
.portal-mark { width: 226px; margin: 0 auto 8px; filter: drop-shadow(0 14px 20px rgba(61, 87, 148, .13)); animation: markBreathe 4.5s ease-in-out infinite; }
.portal-mark svg { display: block; width: 100%; height: auto; }
.mark-cloud { fill: #fff; stroke: #263c67; stroke-width: 6; stroke-linejoin: round; }
.mark-controller { fill: #4d5d7d; stroke: #263c67; stroke-width: 6; stroke-linejoin: round; }
.mark-stick { fill: none; stroke: #eef4ff; stroke-width: 4; stroke-linecap: round; }
.mark-dot { stroke: #263c67; stroke-width: 1; }.mark-dot-a { fill: #ffcc5d; }.mark-dot-b { fill: #f177a1; }
.portal-kicker { margin: 0 0 5px; color: #7890be; font-size: 11px; font-weight: 800; letter-spacing: .16em; }
.portal h1 { margin: 0; color: #1e3d72; font-size: clamp(28px, 4vw, 38px); letter-spacing: .04em; }
.portal-subtitle { margin: 10px 0 28px; color: #7890b8; font-size: 15px; }
.portal-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.portal-choice {
  display: grid;
  grid-template-columns: 38px 1fr 18px;
  align-items: center;
  min-height: 88px;
  gap: 9px;
  padding: 14px 16px;
  color: #284a83;
  background: rgba(255,255,255,.76);
  border: 1px solid rgba(150,177,235,.45);
  border-radius: 20px;
  box-shadow: 0 14px 32px rgba(72,100,161,.08);
  text-align: left;
  transition: transform .22s ease, box-shadow .22s ease, background .22s ease;
}
.portal-choice:hover { background: #fff; box-shadow: 0 18px 34px rgba(63,99,170,.16); transform: translateY(-4px); }
.portal-choice strong { display: block; font-size: 16px; }.portal-choice small { display: block; margin-top: 2px; color: #8295b9; font-size: 11px; font-weight: 400; }.portal-choice b { color: var(--blue); font-size: 20px; }
.choice-icon { display: grid; width: 38px; height: 38px; place-items: center; color: #fff; background: linear-gradient(135deg, #6d93ff, #6e72e8); border-radius: 13px; font-size: 18px; box-shadow: 0 7px 14px rgba(83,115,222,.23); }
.portal-choice:nth-child(2) .choice-icon { background: linear-gradient(135deg, #826fe5, #bd83e8); }
.portal-staff { min-height: auto; margin-top: 20px; padding: 6px 10px; color: #7b8eaf; border: 0; background: transparent; font-size: 12px; font-weight: 500; }.portal-staff:hover { color: var(--blue); background: transparent; filter: none; }
.portal-footnote { margin: 16px 0 0; color: #9aa9c2; font-size: 12px; }
.portal-auth { display: none; padding: 28px 30px 25px; background: rgba(255,255,255,.86); border: 1px solid rgba(214,225,247,.9); border-radius: 26px; box-shadow: 0 22px 60px rgba(52,83,145,.15); text-align: left; animation: authEnter .48s cubic-bezier(.2,.85,.28,1) both; backdrop-filter: blur(12px); }
.portal[data-mode="auth"] .portal-welcome { display: none; }.portal[data-mode="auth"] .portal-auth { display: block; }
.portal-back { min-height: auto; margin: 0 0 20px; padding: 2px 0; color: #8395b7; background: transparent; border: 0; font-size: 12px; font-weight: 500; }.portal-back:hover { color: var(--blue); background: transparent; filter: none; }
.auth-head { display: flex; align-items: center; gap: 13px; margin-bottom: 24px; }.auth-mini-mark { display: grid; width: 44px; height: 44px; place-items: center; color: #fff; background: linear-gradient(145deg, #5f8dff, #766ce8); border-radius: 15px; box-shadow: 0 9px 18px rgba(82,112,221,.22); font-size: 20px; }.auth-head .portal-kicker { margin-bottom: 1px; }.auth-head h2 { margin: 0; color: #244576; font-size: 22px; }.auth-head p:last-child { margin: 2px 0 0; color: #8899b7; font-size: 12px; }
.staff-selector { margin: -8px 0 14px; }.auth-form label { display: block; margin-bottom: 14px; color: #4e6186; font-size: 13px; }.auth-form input, .auth-form select { min-height: 48px; margin-top: 7px; padding: 11px 13px; background: #fbfcff; border-color: #dce5f5; border-radius: 12px; transition: border-color .2s ease, box-shadow .2s ease, background .2s ease; }.auth-form input:focus, .auth-form select:focus { background: #fff; border-color: #7d9dff; box-shadow: 0 0 0 4px rgba(93,132,250,.12); outline: 0; }
.portal-submit { width: 100%; min-height: 50px; margin-top: 5px; color: #fff; background: linear-gradient(100deg, #5f8dff, #6d78ed); border: 0; border-radius: 13px; box-shadow: 0 12px 20px rgba(80,113,225,.25); font-size: 15px; letter-spacing: .2em; transition: transform .2s ease, box-shadow .2s ease; }.portal-submit:hover { box-shadow: 0 15px 27px rgba(80,113,225,.35); filter: none; transform: translateY(-2px); }.portal-submit:active { transform: translateY(0); }
.auth-switch { margin: 17px 0 0; color: #7f90b1; font-size: 13px; text-align: center; }.auth-switch button { min-height: auto; padding: 0 0 0 4px; color: #567fff; background: transparent; border: 0; font-size: inherit; }.auth-switch button:hover { color: #305de6; background: transparent; filter: none; }.portal-legal { margin: 22px 0 0; color: #a1aec5; font-size: 11px; text-align: center; }.portal footer { position: absolute; bottom: 20px; color: #9baac5; font-size: 12px; }

@keyframes portalEnter { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes authEnter { from { opacity: 0; transform: translateY(15px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes portalFloat { 50% { transform: translate(22px, 18px) scale(1.08); } }
@keyframes markBreathe { 50% { transform: translateY(-5px) rotate(1deg); } }
@keyframes pageEnter { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:none; } }
@keyframes flashEnter { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:none; } }
@keyframes onlinePulse { 50% { box-shadow:0 0 0 7px rgba(79,224,166,0); } }
@keyframes sidebarPulse { 50% { transform:translate(9px,-14px) scale(1.05); opacity:.55; } }

@media (max-width: 980px) {
  .sidebar { flex-basis: 210px; width: 210px; }
  .main { padding: 16px; }
  .panel { padding: 16px; }
}

@media (max-width: 760px) {
  .app { display: block; }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
    min-height: 0;
    padding: 8px 10px;
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 5px 18px rgba(16,24,47,.16);
  }
  .sidebar-glow, .workspace-chip, .sidebar-footer > span { display:none; }
  .brand { padding: 3px 2px; font-size: 16px; }
  .brand-mark { width:29px; height:29px; border-radius:10px; }.brand small { display:none; }
  .nav {
    display: flex;
    order: 3;
    width: 100%;
    gap: 5px;
    overflow-x: auto;
    padding: 4px 0 1px;
    -webkit-overflow-scrolling: touch;
  }
  .nav a { flex: 0 0 auto; margin: 0; padding: 8px 10px; font-size: 13px; white-space: nowrap; transform:none; }
  .nav-icon { width:19px; height:19px; font-size:13px; }
  .sidebar-footer { margin:0 0 0 auto; padding:0; }.logout { flex: 0 0 auto; margin:0; padding:7px 9px; font-size:12px; }
  .main { padding: 12px; }
  .topbar { align-items: flex-start; flex-direction: column; gap: 7px; margin-bottom: 12px; padding: 13px 14px; }
  .profile-chip { width:100%; }.page-symbol { width:34px; height:34px; font-size:17px; }
  .panel { margin-bottom: 12px; padding: 14px; border-radius: 12px; }
  .card { padding: 14px; border-radius: 12px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .filters, .form-grid { grid-template-columns: 1fr; gap: 11px; }
  h1 { margin-bottom: 14px; font-size: 18px; }
  .metric { font-size: 20px; }
  input, select, textarea, button, .button { min-height: 44px; }
  .section-title { align-items: flex-start; flex-direction: column; }
  .section-title > * { max-width: 100%; }
  table { min-width: 620px; }
  th, td { padding: 10px; }
  .actions { min-width: 170px; }
  .portal { min-height: 100svh; padding: 28px 16px 64px; }
  .portal-auth { padding: 23px 20px 21px; border-radius: 22px; }
  .portal-mark { width: 190px; }
}

@media (max-width: 430px) {
  .grid { grid-template-columns: 1fr; }
  .brand { font-size: 15px; }
  .logout { padding: 6px 8px; }
  .topbar { padding: 12px; }
  .panel, .card { padding: 12px; }
  table { min-width: 580px; }
  .portal-choices { grid-template-columns: 1fr; }
  .portal-choice { min-height: 76px; }
  .portal footer { bottom: 15px; font-size: 11px; }
  .profile-chip > span:last-child { max-width:100px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
