/* TicketService 通用样式 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Microsoft YaHei UI", "Segoe UI", system-ui, sans-serif;
  background: #f6f8fb;
  color: #172033;
}

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 18px;
  border-bottom: 1px solid #e3e8f0;
  margin-bottom: 20px;
}

.topbar .brand {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .3px;
}

.topbar .right {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  color: #5d687a;
}

.topbar a {
  color: #2563eb;
  text-decoration: none;
  font-size: 13px;
}

.topbar a:hover {
  text-decoration: underline;
}

.topbar button {
  background: none;
  border: 1px solid #d8dee8;
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 13px;
}

.topbar button:hover {
  background: #eef3ff;
}

.login-link {
  display: inline-block;
  padding: 7px 18px;
  border-radius: 999px;
  background: #2563eb;
  color: #fff !important;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s;
}

.login-link:hover {
  background: #1d4ed8;
  text-decoration: none;
}

.panel {
  background: #fff;
  border: 1px solid #e3e8f0;
  border-radius: 12px;
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(23, 32, 51, .04);
}

.panel h2 {
  font-size: 16px;
  margin-bottom: 14px;
}

/* 导出面板 */
.exp-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.exp-header h2 {
  margin: 0;
  font-size: 17px;
}

.exp-header .hint {
  color: #5d687a;
  font-size: 12px;
}

.exp-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
  margin-top: 18px;
}

.exp-form .field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #33415c;
  margin-bottom: 6px;
}

.exp-form .field label .req {
  color: #dc2626;
  font-style: normal;
}

.exp-form select,
.exp-form input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  color: #172033;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.exp-form select:focus,
.exp-form input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.exp-form select:disabled,
.exp-form input:disabled {
  background: #f1f5f9;
  color: #9aa4b2;
}

/* ---- 可搜索下拉组合框 ---- */
.combobox {
  position: relative;
}

.combobox .cb-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.combobox .cb-input {
  width: 100%;
  padding: 10px 34px 10px 12px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  color: #172033;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.combobox .cb-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.combobox .cb-arrow {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #9aa4b2;
  pointer-events: none;
  transition: transform .15s;
}

.combobox.open .cb-arrow {
  transform: translateY(-50%) rotate(180deg);
  border-top-color: #2563eb;
}

.combobox .cb-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 50;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  border: 1px solid #d8dee8;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(23, 32, 51, .12);
  max-height: 260px;
  overflow-y: auto;
  display: none;
}

.combobox.open .cb-menu {
  display: block;
}

.combobox .cb-item {
  padding: 11px 12px;
  border-radius: 7px;
  font-size: 14px;
  color: #172033;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.combobox .cb-item:hover,
.combobox .cb-item.active {
  background: #eff4ff;
  color: #1d4ed8;
}

.combobox .cb-item.selected {
  font-weight: 600;
  color: #1d4ed8;
}

.combobox .cb-item.cb-empty {
  color: #9aa4b2;
  cursor: default;
}

.combobox.disabled .cb-input {
  background: #f1f5f9;
  color: #9aa4b2;
  cursor: not-allowed;
}

.combobox.disabled .cb-arrow {
  border-top-color: #c6ceda;
}

.exp-form .formats {
  grid-column: 1 / -1;
}

.exp-form .radio-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.exp-form .radio-row label {
  position: relative;
  margin: 0;
  color: #475569;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px 10px 16px;
  border: 1px solid #d8dee8;
  border-radius: 10px;
  background: #fff;
  transition: border-color .15s, background .15s, box-shadow .15s;
}

.exp-form .radio-row label:hover {
  border-color: #a8c0ee;
}

.exp-form .radio-row input {
  accent-color: #2563eb;
  margin: 0;
}

.exp-form .radio-row label:has(input:checked) {
  border-color: #2563eb;
  color: #1d4ed8;
  font-weight: 600;
  background: #eff4ff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.exp-form .actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.manual-panel {
  margin-top: 20px;
}

.manual-panel .exp-form {
  grid-template-columns: repeat(3, 1fr);
}

.schema-panel .exp-form {
  grid-template-columns: minmax(0, 1fr);
}

.schema-panel .logbox {
  min-height: 216px;
  max-height: 420px;
}

.guard-row {
  grid-column: 1 / -1;
  background: linear-gradient(180deg, #fef9e7, #fdf3d3);
  border: 1px solid #f0d98a;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  gap: 12px;
}

.guard-icon {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #f2d88a;
  color: #7a5b00;
  font-weight: 700;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.guard-body {
  flex: 1;
}

.guard-label {
  font-size: 13px;
  font-weight: 600;
  color: #7a5b00;
  margin-bottom: 6px;
}

.guard-input {
  display: flex;
  gap: 8px;
}

.guard-input input {
  flex: 1;
  max-width: 180px;
  padding: 8px 10px;
  border: 1px solid #d8dee8;
  border-radius: 6px;
  font-size: 14px;
}

.guard-row button.primary {
  padding: 8px 18px;
  font-size: 14px;
}

button.primary {
  padding: 11px 26px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  transition: background .15s;
}

button.primary:hover {
  background: #1d4ed8;
}

button.primary:disabled {
  background: #a8b7d6;
  cursor: not-allowed;
}

.exp-form .actions button:not(.primary) {
  padding: 11px 22px;
  background: #dc2626;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  transition: background .15s;
}

.exp-form .actions button:not(.primary):hover {
  background: #b91c1c;
}

.exp-form .actions button:not(.primary):disabled {
  background: #e5a3a3;
  cursor: not-allowed;
}

.logbox {
  grid-column: 1 / -1;
  margin-top: 12px;
  min-height: 180px;
  max-height: 320px;
  overflow-y: auto;
  background: #fff;
  color: #172033;
  border-radius: 10px;
  padding: 14px 16px;
  border: 1px solid #e3e8f0;
  font-family: Consolas, monospace;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
}

/* 账号管理表 */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid #eef1f6;
}

th {
  color: #5d687a;
  font-weight: 600;
  font-size: 13px;
}

.tbl-actions button,
.add-btn {
  background: #fff;
  border: 1px solid #d8dee8;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 13px;
  cursor: pointer;
}

.tbl-actions button:hover {
  background: #fef2f2;
  color: #dc2626;
  border-color: #dc2626;
}

.add-btn {
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 8px 14px;
}

.add-btn:hover {
  background: #1d4ed8;
}

.adder {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  align-items: end;
  margin: 14px 0;
}

.adder label {
  font-size: 12px;
  color: #5d687a;
  display: block;
  margin-bottom: 5px;
}

.adder input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d8dee8;
  border-radius: 6px;
  font-size: 13px;
}

.empty {
  color: #5d687a;
  font-size: 13px;
  padding: 14px 0;
}

.flash {
  color: #dc2626;
  font-size: 13px;
  margin: 6px 0;
}

/* ---------- 管理后台 ---------- */
.admin-head {
  margin-bottom: 18px;
}

.admin-head h1 {
  font-size: 22px;
}

.admin-head .sub {
  color: #5d687a;
  font-size: 13px;
  margin-top: 4px;
}

.stats {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.stat {
  flex: 1;
  background: #fff;
  border: 1px solid #d8dee8;
  border-radius: 10px;
  padding: 14px 16px;
  text-align: center;
}

.stat-num {
  font-size: 22px;
  font-weight: 700;
  color: #172033;
}

.stat-label {
  font-size: 12px;
  color: #5d687a;
  margin-top: 4px;
}

.stat-wide {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-panel {
  padding: 20px 22px;
}

.panel-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.panel-title h2 {
  margin: 0;
}

.panel-title .hint {
  color: #5d687a;
  font-size: 12px;
}

.adder {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  align-items: end;
  margin: 16px 0 8px;
}

.adder .field label {
  font-size: 12px;
  color: #5d687a;
  display: block;
  margin-bottom: 5px;
}

.adder input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #d8dee8;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
}

.adder input:focus {
  border-color: #2563eb;
}

.adder-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.add-btn {
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}

.add-btn:hover {
  background: #1d4ed8;
}

.ghost-btn {
  background: #fff;
  border: 1px solid #d8dee8;
  border-radius: 6px;
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  color: #5d687a;
}

.ghost-btn:hover {
  background: #f4f6fb;
}

.flash.success {
  color: #16a34a;
}

.table-scroll {
  overflow-x: auto;
  margin-top: 14px;
}

#gameTable th,
#gameTable td {
  padding: 11px 12px;
}

#gameTable th {
  text-align: center;
}

.game-id {
  display: inline-block;
  background: #eef3ff;
  color: #2563eb;
  border-radius: 5px;
  padding: 1px 8px;
  font-size: 13px;
  font-weight: 600;
}

.game-name {
  font-weight: 600;
  margin-top: 4px;
  color: #172033;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.acc-chip {
  display: inline-block;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 3px 11px;
  font-size: 13px;
  margin: 2px 6px 2px 0;
  cursor: pointer;
  color: #334155;
}

.acc-chip:hover {
  background: #fef2f2;
  border-color: #dc2626;
  color: #dc2626;
}

.muted {
  color: #9aa4b2;
  font-size: 13px;
}

.danger-note {
  color: #9aa4b2;
  font-size: 12px;
  margin-top: 12px;
}

/* 确认弹窗 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(23, 32, 51, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal {
  background: #fff;
  border-radius: 12px;
  padding: 26px 30px;
  width: 380px;
  max-width: 90%;
  box-shadow: 0 12px 40px rgba(23, 32, 51, 0.2);
  text-align: center;
}

.modal-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: #fef2f2;
  color: #dc2626;
  font-weight: 700;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
}

.modal-msg {
  color: #5d687a;
  font-size: 14px;
  margin: 10px 0 22px;
  line-height: 1.6;
  word-break: break-all;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.modal-actions button {
  padding: 9px 22px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}

.danger-btn {
  background: #dc2626;
  color: #fff;
  border: none;
}

.danger-btn:hover {
  background: #b91c1c;
}

/* Steam Guard 验证码输入弹窗 */
.guard-modal .guard-label {
  font-size: 15px;
  font-weight: 700;
  color: #7a5b00;
}

.guard-modal .guard-input {
  margin: 16px 0 8px;
  justify-content: center;
}

.guard-modal .guard-input input {
  max-width: none;
  flex: 1;
  padding: 10px 12px;
  font-size: 16px;
  letter-spacing: 2px;
  text-align: center;
}

.guard-modal .guard-input button.primary {
  padding: 10px 20px;
}

.guard-modal .guard-cancel {
  margin-top: 22px;
  display: flex;
  justify-content: center;
}

.guard-modal .guard-cancel button.danger-btn {
  padding: 9px 30px;
  font-size: 14px;
}

/* Akamai 清单直链面板：三个输入框始终在同一行（含窄屏） */
.akamai-panel .exp-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.akamai-panel .exp-form>.field {
  min-width: 0;
}

.akamai-panel .exp-form>.field input {
  width: 100%;
  box-sizing: border-box;
}

.akamai-panel #akResult {
  grid-column: 1 / -1;
}

.akamai-panel .copy-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.akamai-panel .copy-row input {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
}

.akamai-panel .copy-row button {
  flex: 0 0 auto;
  padding: 0 18px;
  border: none;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.akamai-panel .copy-row button:hover {
  background: #1d4ed8;
}

@media (max-width: 640px) {
  .adder {
    grid-template-columns: 1fr 1fr;
  }

  .stats {
    flex-direction: column;
  }

  .exp-form,
  .manual-panel .exp-form {
    grid-template-columns: 1fr;
  }

  /* Akamai 面板保持三列同行，仅缩小间距 */
  .akamai-panel .exp-form {
    gap: 10px 8px;
  }

  .guard-input {
    flex-direction: column;
  }

  .guard-input input {
    max-width: none;
  }

  .guard-input button {
    width: 100%;
  }
}