:root {
  --navy: #12203a;
  --navy-deep: #0b1628;
  --ink: #1b2d4f;
  --gold: #c4a265;
  --gold-deep: #9a7840;
  --blue: #2b6aa3;
  --blue-deep: #1f5688;
  --cream: #f6efe4;
  --card: #ffffff;
  --line: #e6edf5;
  --muted: #7b8798;
  --page: #f4f7fb;
  --danger: #c0392b;
  --tech-bg: #040c18;
  --tech-cyan: #00d4ff;
  --tech-text: #e8f7ff;
  --tech-muted: #5a8aaa;
  --tech-placeholder: #5a7a96;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--page);
}
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

/* ---- login: align with nClient newLogin / tech-theme ---- */
body.is-login {
  color: var(--tech-text);
  background:
    linear-gradient(rgba(0, 212, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.035) 1px, transparent 1px),
    radial-gradient(ellipse at 50% 0%, rgba(0, 90, 150, 0.38), transparent 58%),
    var(--tech-bg);
  background-size: 48px 48px, 48px 48px, auto, auto;
}
.login-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.login_panle {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
}
.login_panle_form {
  width: 100%;
  padding: 36px 28px;
  border-radius: 12px;
  background: rgba(6, 18, 32, 0.92);
  border: 1px solid rgba(0, 180, 220, 0.28);
  box-shadow: 0 0 40px rgba(0, 180, 220, 0.08), inset 0 0 24px rgba(0, 80, 140, 0.08);
  animation: slideUp 0.5s ease-out;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.login_panle_form_title {
  text-align: center;
  margin-bottom: 32px;
}
.login_panle_form_title .seal {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(4, 12, 24, 0.9);
  border: 1px solid rgba(0, 212, 255, 0.45);
  box-shadow: 0 0 16px rgba(0, 212, 255, 0.25);
  color: var(--tech-cyan);
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login_panle_form_title_p {
  font-size: clamp(24px, 5vw, 30px);
  font-weight: 700;
  color: var(--tech-text);
  letter-spacing: 3px;
  margin: 0;
  position: relative;
  display: inline-block;
  text-shadow: 0 0 20px rgba(0, 212, 255, 0.35);
}
.login_panle_form_title_p::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--tech-cyan), transparent);
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.55);
}
.login-sub {
  margin: 18px 0 0;
  color: var(--tech-muted);
  font-size: 13px;
}
.login-wrap .field { margin-bottom: 20px; }
.login-wrap .field label { display: none; }
.login-wrap .login-input {
  width: 100%;
  min-height: 44px;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 16px;
  outline: none;
  color: var(--tech-text);
  background: rgba(4, 12, 24, 0.85);
  border: 1px solid rgba(0, 180, 220, 0.25);
  box-shadow: inset 0 0 12px rgba(0, 100, 180, 0.08);
}
.login-wrap .login-input::placeholder { color: var(--tech-placeholder); }
.login-wrap .login-input:hover,
.login-wrap .login-input:focus {
  border-color: var(--tech-cyan);
  box-shadow: 0 0 0 1px rgba(0, 212, 255, 0.35), inset 0 0 12px rgba(0, 100, 180, 0.12);
}
.captcha-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
  width: 100%;
  margin-bottom: 8px;
}
.captcha-wrapper .captcha-input { flex: 1 1 140px; min-width: 0; }
.captcha-tip {
  width: 100%;
  font-size: 12px;
  color: var(--tech-muted);
  margin: -8px 0 8px;
}
.vPic {
  flex: 0 0 auto;
  min-width: 120px;
  width: 140px;
  height: 44px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid rgba(0, 180, 220, 0.35);
  background: #041018;
  overflow: hidden;
  box-shadow: inset 0 0 12px rgba(0, 212, 255, 0.08);
}
.vPic img {
  display: block;
  width: 140px;
  height: 44px;
  object-fit: contain;
}
.login-button {
  width: 100%;
  margin-top: 8px;
  height: 48px;
  font-size: 16px;
  border-radius: 8px;
  border: 0;
  color: #041018;
  font-weight: 700;
  letter-spacing: 0.2em;
  background: linear-gradient(180deg, #3fe0ff, #00a8d4);
  box-shadow: 0 0 18px rgba(0, 212, 255, 0.28);
}
.login-button:hover { filter: brightness(1.06); }
.login-wrap .err { color: #ff8a80; }

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 13px;
  color: #5b6472;
  margin-bottom: 8px;
}
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid #e4e8ee;
  background: #fff;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  outline: none;
  color: var(--ink);
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: #b9cbe0;
}
.btn {
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #3a7eb8, var(--blue-deep));
  color: #fff;
  padding: 13px 16px;
  font-size: 15px;
  font-weight: 600;
}
.btn:hover { filter: brightness(1.05); }
.btn:disabled { opacity: 0.65; cursor: default; }
.btn-ghost {
  width: auto;
  background: #fff;
  color: var(--ink);
  border: 1px solid #d9e2ec;
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 10px;
}
.err {
  color: var(--danger);
  font-size: 13px;
  min-height: 18px;
  margin: 0 0 12px;
}

/* ---- tickets page ---- */
.top {
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 28px 8px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.kicker {
  color: var(--gold);
  letter-spacing: 0.16em;
  font-size: 11px;
  font-weight: 700;
}
.top h1 {
  margin: 6px 0 6px;
  font-size: 28px;
}
.sub { margin: 0; color: var(--muted); font-size: 13px; }
.layout {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 28px 48px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}
.panel {
  background: var(--card);
  border-radius: 18px;
  padding: 22px 22px 20px;
  box-shadow: 0 8px 24px rgba(18, 40, 72, 0.04);
  border: 1px solid #eef2f6;
}
.panel h2 {
  margin: 0 0 16px;
  font-size: 20px;
  color: var(--ink);
}
.empty { color: var(--muted); font-size: 14px; padding: 8px 0 12px; }
.ticket-list { display: flex; flex-direction: column; gap: 10px; }
.ticket-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  background: #fff;
}
.ticket-item:hover, .ticket-item.active { border-color: #c5d6ea; background: #f7fbff; }
.ticket-item .meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.ticket-item .title { font-size: 14px; font-weight: 600; }
.pill {
  display: inline-block;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef4fb;
  color: var(--blue-deep);
}
.pill.warn { background: #fff4e5; color: #b36b00; }
.pill.ok { background: #eaf7ee; color: #1f7a3f; }
.userbar { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.thread { margin-top: 8px; display: flex; flex-direction: column; gap: 10px; }
.bubble {
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.55;
  background: #f6f8fb;
  white-space: pre-wrap;
  word-break: break-word;
}
.bubble.admin { background: #eef5fc; }
.bubble .who { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.detail-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 8px; }
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.filters input, .filters select {
  border: 1px solid #e4e8ee;
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
}
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.actions .btn { width: auto; padding: 8px 14px; font-size: 13px; }
.layout.admin { grid-template-columns: 1.1fr 1.2fr; }

@media (max-width: 860px) {
  .layout, .layout.admin { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .login-wrap {
    padding: 12px 10px;
    align-items: flex-start;
    padding-top: max(12px, env(safe-area-inset-top));
  }
  .login_panle_form { padding: 28px 18px; }
  .captcha-wrapper { flex-direction: column; }
  .vPic { width: 100%; min-width: unset; }
  .vPic img { width: 100%; height: 44px; }
}
