:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1f2430;
  --muted: #6b7280;
  --line: #e5e8f0;
  /* AudioCodes 品牌色 */
  --brand: #022662;                                  /* 深蓝 navy */
  --brand-2: #5e25be;                                /* 紫 */
  --accent: #00bcff;                                 /* 青 */
  --red: #e2231a;                                    /* 品牌红 */
  --grad: linear-gradient(to right, rgba(3,13,68,0.92), rgba(94,37,190,0.92));
  --grad-soft: linear-gradient(135deg, #022662, #5e25be);
  --radius: 16px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 8px 24px rgba(16, 24, 40, .06);
  --max-w: 1100px;
  --font-base: "Poppins", "Microsoft YaHei", "PingFang SC", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-base);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 16px; }
.main { padding-top: 24px; padding-bottom: 48px; min-height: calc(100vh - 200px); }

/* ===== 顶栏：黑色吸顶，仿 AudioCodes ===== */
.topbar {
  background: #000;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: flex-end;
  height: 64px; max-width: var(--max-w); margin: 0 auto; padding: 0 16px;
}
.brand {
  color: #fff; text-decoration: none; font-weight: 700; font-size: 18px;
  display: flex; align-items: center; gap: 8px; letter-spacing: .3px;
}
.brand-icon { font-size: 20px; }
.nav a {
  color: #fff; text-decoration: none; margin-left: 28px; font-size: 15px; font-weight: 600;
  padding: 20px 0; border-bottom: 3px solid transparent; line-height: 1; white-space: nowrap;
}
.nav a:hover { color: var(--accent); text-decoration: none; }
.nav a.active { border-bottom-color: var(--red); }

/* ===== Hero ===== */
.hero {
  position: relative;
  height: 260px;
  display: flex; align-items: center; overflow: hidden;
  background: #061a3a;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(2,6,30,.82), rgba(2,6,30,.4));
  z-index: 1;
}
.hero-bg {
  position: absolute; inset: 0;
  background: url('https://www.audiocodes.com/media/12460/services-support-header-2.jpg?width=1920') 50% 50% / cover no-repeat;
  opacity: .6; z-index: 0;
}
.hero-inner {
  position: relative; z-index: 2;
  max-width: var(--max-w); margin: 0 auto; padding: 0 16px; color: #fff;
}
.hero h1 { font-family: var(--font-base); font-size: 40px; font-weight: 700; margin: 0 0 8px; }
.hero p { font-size: 16px; margin: 0; color: rgba(255,255,255,.85); }

/* ===== 卡片 ===== */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}
.card h1, .card h2, .card h3 { color: var(--brand); }
.page-head { margin: 4px 0 18px; }
.page-head h1 { margin: 0 0 4px; font-size: 24px; color: var(--brand); }
.page-head p { margin: 0; }
.muted { color: var(--muted); }
.req { color: var(--red); }
.hint { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.kv { width: 100%; border-collapse: collapse; margin: 4px 0 8px; }
.kv td { padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv td:first-child { color: var(--muted); width: 160px; white-space: nowrap; }

/* 厂商支持资源卡：蓝紫渐变高亮 */
.vendor-support {
  background: var(--grad); color: #fff; border: none;
}
.vendor-support h3 { color: #fff; margin-top: 0; }
.vendor-support p { color: rgba(255,255,255,.9); }
.vendor-support .btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.vendor-support .btn-ghost:hover { border-color: #fff; }

/* ===== 表单 ===== */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 720px) { .grid2 { grid-template-columns: 1fr; } }
.field { margin-bottom: 16px; }
.field-email { grid-column: 1 / -1; }
.field select { min-height: 46px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; color: var(--text); }
.field input[type="text"], .field input[type="tel"], .field input[type="password"],
.field input[type="search"], .field input[type="email"], .field select, .field textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid #cbd2e0; border-radius: 8px;
  font: inherit; color: var(--text); background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(2,38,98,.15);
}
.field textarea { resize: vertical; }
.field input[type="file"] { font: inherit; }

.hp { position: absolute; left: -9999px; }

.actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.actions.center { justify-content: center; }
.inline-form { display: inline; }

/* ===== 按钮 ===== */
.btn {
  display: inline-block; padding: 10px 20px; border-radius: 8px;
  border: 1px solid transparent; font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, opacity .15s;
}
.btn-primary { background: var(--grad-soft); color: #fff; }
.btn-primary:hover { opacity: .92; }
.btn-ghost { background: #fff; color: var(--brand); border-color: #c3d3f8; }
.btn-ghost:hover { border-color: var(--brand); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #b91c1c; }

/* 提示条 */
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-weight: 500; }
.flash-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.flash-ok { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }

/* 成功页 */
.center-card { text-align: center; padding: 40px 24px; }
.center-card h1 { margin: 8px 0; color: var(--brand); }
.big-icon { font-size: 44px; }
.ticket-no { margin: 12px 0; }
.ticket-no code {
  font-size: 22px; font-weight: 700; letter-spacing: 1px;
  background: #eef2ff; color: var(--brand);
  padding: 8px 18px; border-radius: 8px; border: 1px dashed #c3d3f8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.login-card { max-width: 380px; margin: 40px auto 0; }

/* 查询结果 */
.result-card .result-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.result-card h2 { margin: 0; font-size: 20px; color: var(--brand); }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; margin: 0; }
.kv > div { border-bottom: 1px dashed var(--line); padding: 6px 0; }
.kv .wide { grid-column: 1 / -1; }
.kv dt { font-size: 13px; color: var(--muted); margin-bottom: 2px; }
.kv dd { margin: 0; word-break: break-word; white-space: pre-wrap; }
@media (max-width: 720px) { .kv { grid-template-columns: 1fr; } }

.gallery { display: flex; flex-wrap: wrap; gap: 12px; }
.gallery img { width: 120px; height: 120px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

/* 状态徽章 */
.badge {
  display: inline-block; padding: 3px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
}
.badge[data-status="待处理"] { background: #fef3c7; color: #92400e; }
.badge[data-status="处理中"] { background: #dbeafe; color: #1d4ed8; }
.badge[data-status="已完成"] { background: #dcfce7; color: #166534; }
.badge[data-status="已关闭"] { background: #e5e7eb; color: #4b5563; }

/* 管理后台 */
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.admin-head h1 { margin: 0; color: var(--brand); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip {
  padding: 6px 14px; border-radius: 999px; background: #fff;
  border: 1px solid var(--line); text-decoration: none; color: var(--text); font-size: 14px;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip-active:hover { color: #fff; }

.searchbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.searchbar input[type="search"] {
  flex: 1; min-width: 220px; padding: 10px 12px;
  border: 1px solid #cbd2e0; border-radius: 8px; font: inherit;
}
.searchbar input[type="search"]:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(2,38,98,.15);
}

.table-wrap {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow-x: auto;
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
th { background: #f3f5fb; color: var(--muted); font-weight: 600; white-space: nowrap; }
tbody tr:hover { background: #f8faff; }
tbody tr:last-child td { border-bottom: none; }
.nowrap { white-space: nowrap; }
td a { color: var(--brand); text-decoration: none; font-weight: 600; }
td a:hover { text-decoration: underline; }
td code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #f1f5f9; padding: 2px 6px; border-radius: 4px; font-size: 13px;
}

.pagination { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.page {
  padding: 6px 12px; border-radius: 6px; background: #fff;
  border: 1px solid var(--line); text-decoration: none; color: var(--text);
}
.page:hover { border-color: var(--brand); color: var(--brand); }
.page-current { background: var(--brand); border-color: var(--brand); color: #fff; }

.empty-tip { text-align: center; color: var(--muted); }
.danger-card { border-color: #fecaca; }
.danger-card h2 { margin-top: 0; color: var(--red); }

/* ===== 页脚：蓝紫渐变，仿 AudioCodes ===== */
.footer {
  margin-top: 32px;
  background: var(--grad);
  color: #fff;
}
.footer-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 28px 16px;
  display: flex; flex-direction: column; gap: 10px; align-items: flex-start;
}
.footer-brand { font-weight: 700; font-size: 16px; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: rgba(255,255,255,.88); text-decoration: none; font-size: 14px; }
.footer-links a:hover { color: #fff; text-decoration: underline; }

/* ===== 邮箱：前缀输入 + 域名下拉组合 ===== */
.email-combo { display: flex; gap: 8px; align-items: stretch; }
.email-combo input[type="text"] { flex: 1 1 0; min-width: 0; }
.email-combo select {
  flex: 0 0 auto; width: auto; max-width: 220px; min-width: 0; padding: 10px 10px; font: inherit;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text);
  cursor: pointer;
}
.email-combo select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(2,38,98,.15); }
.hint { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.footer-copy { color: rgba(255,255,255,.7); font-size: 12px; }

/* ===== Hero 重要提示条 ===== */
.hero-note {
  margin: 14px 0 0;
  max-width: 660px;
  padding: 10px 14px;
  border-left: 3px solid #ffd54a;
  background: rgba(255,255,255,.08);
  border-radius: 8px;
  color: rgba(255,255,255,.92);
  font-size: 14px;
  line-height: 1.6;
}
.hero-note strong { color: #ffd54a; }

/* ===== 分配任务：已分配状态提示 ===== */
.assigned-current {
  margin: 0 0 14px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(0,188,255,.12);
  border-left: 3px solid #00bcff;
  color: #cfeefe;
  font-size: 14px;
}

/* ===== 移动端适配（不改动桌面样式） ===== */
@media (max-width: 768px) {
  body { font-size: 14px; }
  .container { padding: 0 12px; }
  .main { padding-top: 16px; padding-bottom: 32px; min-height: calc(100vh - 160px); }

  /* 顶栏：缩小并允许换行，避免导航项溢出 */
  .topbar-inner { height: auto; padding: 8px 12px; gap: 6px 14px; flex-wrap: wrap; }
  .brand { font-size: 15px; }
  .brand-icon { font-size: 16px; }
  .nav { display: flex; flex-wrap: wrap; width: 100%; gap: 2px 14px; }
  .nav a {
    margin-left: 0; padding: 6px 0; font-size: 13px; font-weight: 600;
    border-bottom: 2px solid transparent; line-height: 1.2;
  }
  .nav a.active { border-bottom-color: var(--red); }

  /* Hero 缩小 */
  .hero { height: auto; min-height: 168px; padding: 26px 0; }
  .hero h1 { font-size: 26px; line-height: 1.25; }
  .hero p { font-size: 14px; }
  .hero-note { font-size: 13px; margin-top: 12px; }

  /* 卡片与标题收窄 */
  .card { padding: 16px; }
  .page-head { margin-bottom: 14px; }
  .page-head h1 { font-size: 20px; }
  .card h1, .card h2, .card h3 { font-size: 18px; }

  /* 表单：输入框 16px 防止 iOS 聚焦自动缩放；下拉触摸高度 */
  .field label { font-size: 13px; }
  .field input[type="text"], .field input[type="tel"], .field input[type="password"],
  .field input[type="search"], .field input[type="email"], .field select, .field textarea {
    font-size: 16px; padding: 11px 12px;
  }
  .field select { min-height: 44px; }
  .email-combo { gap: 6px; }
  .email-combo input[type="text"] { padding: 11px 12px; font-size: 16px; }
  .email-combo select { max-width: 150px; padding: 11px 8px; font-size: 14px; }

  /* 按钮在移动端全宽堆叠，主操作更醒目 */
  .actions { flex-direction: column; align-items: stretch; gap: 10px; }
  .actions .btn { width: 100%; text-align: center; }
  .actions.center { justify-content: stretch; }

  /* 后台表格：缩小字号、收紧内边距 */
  .table-wrap table { font-size: 13px; }
  th, td { padding: 8px 9px; }
  .admin-head { gap: 10px; }
  .searchbar input[type="search"] { font-size: 16px; }

  /* 查询结果/详情 KV 在平板竖屏也单列（更清晰） */
  .kv { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 22px; }
  .card { padding: 14px; }
  .page-head h1 { font-size: 18px; }

  /* 极窄屏：邮箱前缀+域名上下堆叠，避免挤压 */
  .email-combo { flex-wrap: wrap; }
  .email-combo input[type="text"] { flex: 1 1 100%; }
  .email-combo select { flex: 1 1 100%; max-width: none; }

  /* 搜索栏按钮全宽 */
  .searchbar input[type="search"] { flex: 1 1 100%; min-width: 0; }
  .searchbar .btn { flex: 1 1 100%; }

  /* 后台操作按钮组全宽 */
  .admin-head .actions .btn { width: 100%; }
  .chips { gap: 6px; }
  .chip { padding: 5px 10px; font-size: 13px; }
}
