.account-shell {
  padding: 56px 22px;
  display: grid;
  place-items: center;
  min-height: calc(100vh - 72px);
  background: radial-gradient(circle at 80% 18%, rgba(22, 100, 255, 0.08), transparent 40%), #f7f8fa;
}
.account-card {
  width: 100%;
  max-width: 500px;
  background: #fff;
  border: 1px solid #e5e8ef;
  border-radius: 14px;
  padding: 32px;
  box-shadow: 0 10px 32px rgba(15, 23, 42, 0.04);
  min-width: 0;
}
.account-card h1 { font-size: 26px; color: #1d2129; margin: 10px 0; font-weight: 800; }
.account-card h2, .account-card h3 { color: #1d2129; margin-top: 0; font-weight: 700; }
.account-card p { font-size: 14px; color: #4e5969; line-height: 1.75; }
.account-card label {
  display: grid;
  gap: 6px;
  margin: 14px 0;
  color: #1d2129;
  font-size: 13px;
  font-weight: 600;
}
.account-card input,
.account-card select,
.account-card textarea {
  padding: 10px 12px;
  border: 1px solid #d0d7e2;
  border-radius: 8px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 400;
  color: #1d2129;
  background: #fff;
  min-width: 0;
  width: 100%;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.account-card input:focus,
.account-card select:focus,
.account-card textarea:focus {
  outline: none;
  border-color: #1664ff;
  box-shadow: 0 0 0 3px rgba(22, 100, 255, 0.12);
}
.account-card small, .data-notice { font-size: 12px !important; color: #86909c; font-weight: 400; }
.account-card button { width: 100%; border: 0; cursor: pointer; font: inherit; }
.account-card a { color: #1664ff; font-size: 13px; font-weight: 600; }
button:disabled { opacity: 0.6; cursor: wait; }
#message { color: #d93025; font-size: 14px; font-weight: 500; }

/* Console Main Layout (Douyin Open Platform Console Style) */
.account-main {
  width: 100%;
  max-width: 1200px;
  padding: 32px var(--page-gutter, 28px) 76px;
  margin: auto;
}
.console-subnav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid #e5e8ef;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.03);
}
.console-subnav a {
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #4e5969;
}
.console-subnav a:hover {
  background: #f2f6ff;
  color: #1664ff;
}
.console-subnav a.active {
  background: #1664ff;
  color: #fff;
}
.account-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.account-heading h1 { font-size: 28px; color: #1d2129; margin: 6px 0; font-weight: 800; }
.account-heading h2 { font-size: 22px; color: #1d2129; margin: 8px 0; font-weight: 700; }
.account-main button {
  border: 1px solid #d0d7e2;
  background: #fff;
  color: #1d2129;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}
.account-main button:hover:not(:disabled) {
  border-color: #1664ff;
  color: #1664ff;
  background: #f5f9ff;
}
.account-main button[type="submit"],
.account-main .primary-btn {
  background: linear-gradient(135deg, #1664ff 0%, #0e52d9 100%);
  color: #fff;
  border-color: #1664ff;
  box-shadow: 0 4px 12px rgba(22, 100, 255, 0.2);
}
.account-main button[type="submit"]:hover:not(:disabled),
.account-main .primary-btn:hover:not(:disabled) {
  background: #0e52d9;
  color: #fff;
}
.account-main .account-card {
  max-width: none;
  padding: 26px 28px;
  margin-bottom: 20px;
}
.customer-list { display: grid; gap: 14px; }
.customer-card {
  border: 1px solid #e5e8ef;
  border-radius: 12px;
  background: #fff;
  padding: 20px 22px;
  min-width: 0;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.customer-card:hover {
  border-color: #b8d1ff;
  box-shadow: 0 6px 20px rgba(22, 100, 255, 0.05);
}
.customer-card h3, .customer-card h4 { margin: 0 0 8px; color: #1d2129; }
.customer-card p { overflow-wrap: anywhere; color: #4e5969; font-size: 13.5px; margin: 6px 0; }
.review-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
[hidden] { display: none !important; }

.game-form { max-width: 720px !important; margin-bottom: 22px; }
.game-edit { display: flex; align-items: end; gap: 14px; flex-wrap: wrap; margin-top: 12px; }
.game-edit label { display: grid; gap: 6px; flex: 1; min-width: 140px; font-size: 13px; color: #1d2129; margin: 0; }
.game-edit button { width: auto; flex-shrink: 0; }
#game-panel, #review-panel, #support-review-panel { margin-top: 28px; }
#game-message { color: #1664ff; font-size: 14px; font-weight: 600; }
#game-notice { color: #4e5969; font-size: 14px; }

.delivery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}
.delivery-grid .account-card, .pack-card { max-width: none; margin: 0; }
.form-hint, .section-lead { color: #86909c; font-size: 13px; margin: 4px 0 12px; }
.form-message { color: #1664ff; font-size: 13px; font-weight: 600; min-height: 20px; margin: 8px 0 0; }
.metadata-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0;
}
.metadata-grid label { margin: 0; }
.channel-edit { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.task-section, .channel-section { margin-top: 28px; }

.version-list {
  margin: 8px 0 14px;
  padding: 12px 14px;
  border: 1px solid #e5edf8;
  border-radius: 8px;
  background: #f8fafd;
}
.version-list p { margin: 6px 0 !important; font-size: 12.5px !important; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.version-list button { width: auto; padding: 4px 10px; font-size: 12px; }
.version-form {
  display: grid;
  grid-template-columns: 1fr 1.5fr auto auto;
  gap: 10px;
  margin-bottom: 16px;
}
.version-form button { width: auto; }

/* Stats & Analytics Table */
.stats-section { max-width: none; margin-top: 22px; }
.stats-filter {
  margin: 16px 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  align-items: end;
}
.stats-filter label { margin: 0; min-width: 0; }
.stats-filter button { width: auto; }
.stats-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin: 18px 0;
}
.stat-item {
  display: grid;
  gap: 6px;
  padding: 18px 20px;
  border: 1px solid #e5e8ef;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafd 100%);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.02);
}
.stat-item span { font-size: 12.5px; color: #4e5969; font-weight: 600; }
.stat-item strong { font-size: 24px; color: #1664ff; font-weight: 800; }

.task-toolbar, .task-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.task-actions button { width: auto; }
.task-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}
.task-card .task-actions { grid-column: 2; grid-row: 1 / span 3; justify-content: flex-end; }
.task-card .task-error, .task-detail .task-error { color: #d93025; white-space: pre-wrap; overflow-wrap: anywhere; }
.task-detail { margin-top: 20px; scroll-margin-top: 84px; }
.task-metadata {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 10px 18px;
  font-size: 13px;
  line-height: 1.7;
}
.task-metadata dt { color: #86909c; }
.task-metadata dd { margin: 0; overflow-wrap: anywhere; color: #1d2129; font-weight: 500; }
.task-artifact {
  margin-top: 12px;
  padding: 18px;
  border: 1px solid #e5e8ef;
  border-radius: 10px;
  background: #f8fafd;
}
.task-artifact button { width: auto; }

.pack-card { margin-top: 20px; }
.pack-card #inspect-artifact, .pack-card #clear-icon { width: auto; margin-bottom: 12px; }
.artifact-inspection {
  padding: 16px;
  border: 1px solid #d8e7ff;
  border-radius: 10px;
  background: #f5f9ff;
  margin-bottom: 18px;
}
.icon-preview { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin: 12px 0 20px; }
.icon-preview img { width: 64px; height: 64px; object-fit: contain; border: 1px solid #dce7f7; border-radius: 12px; background: #fff; }
.channel-config-edit {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 12px;
  align-items: end;
}
.channel-config-edit label:last-of-type, .channel-config-edit .form-message { grid-column: 1 / -1; }
.channel-config-edit button { width: auto; justify-self: start; }

.analytics-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid #e5e8ef;
  border-radius: 10px;
  background: #fff;
}
.analytics-table-wrap table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}
.analytics-table-wrap th, .analytics-table-wrap td {
  padding: 12px 14px;
  border-bottom: 1px solid #edf1f7;
  vertical-align: middle;
}
.analytics-table-wrap th { color: #1d2129; background: #f5f8ff; font-weight: 700; white-space: nowrap; }
.analytics-table-wrap td { color: #4e5969; max-width: 260px; overflow-wrap: anywhere; }
.analytics-table-wrap tr:hover td { background: #f9fbff; }
.analytics-table-wrap button { width: auto; padding: 5px 10px; font-size: 12px; }

.analytics-players { display: grid; gap: 14px; }
.analytics-player {
  border: 1px solid #e5e8ef;
  border-radius: 10px;
  background: #f8fafd;
  padding: 18px 20px;
}
.analytics-roles { list-style: none; padding: 0; margin: 12px 0 0; }
.analytics-roles li { padding: 12px; background: #fff; border: 1px solid #e5e8ef; border-radius: 8px; margin-top: 8px; }

.support-review-form { display: grid; gap: 12px; margin-top: 12px; }
.support-review-form button { width: auto; justify-self: start; }

/* Game Box & Red Packet Cards */
.game-box-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.game-box-card {
  border: 1px solid #e5e8ef;
  border-radius: 12px;
  padding: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.game-box-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.game-box-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1664ff, #00b4ff);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 900;
  flex-shrink: 0;
}
.badge-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  background: #eaf2ff;
  color: #1664ff;
}

@media (max-width: 820px) {
  .delivery-grid, .metadata-grid, .game-box-grid, .channel-config-edit, .version-form {
    grid-template-columns: 1fr;
  }
  .task-card { grid-template-columns: 1fr; }
  .task-card .task-actions { grid-column: 1; grid-row: auto; justify-content: flex-start; }
  .task-metadata { grid-template-columns: 1fr; gap: 4px; }
}
