/* ===== Base ===== */
html, body { padding: 0; margin: 0; }
body {
  background: #f7f7f8;
  color: #111827;
  font-family: system-ui,"Segoe UI",Roboto,"PingFang SC","Microsoft YaHei",sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
a { color: #2563eb; }

/* 页面容器：96vw 居中 */
.page {
  width: 96vw;
  max-width: 1280px;      /* 可按需调整 */
  margin: 24px auto;
}

/* ===== Header & account navigation ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.brand {
  color: #111827;
  font-size: 22px;
  font-weight: 750;
  text-decoration: none;
  letter-spacing: -.02em;
}
.account-nav, .user-chip, .inline-controls, .row-actions, .section-heading, .account-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-chip {
  color: #111827;
  text-decoration: none;
  font-weight: 650;
}
.user-chip img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.inline-form { display: inline; margin: 0; }
.google-btn { display: inline-flex; align-items: center; gap: 8px; background: #fff; color: #1f2937; border: 1px solid #d1d5db; text-decoration: none; box-shadow: 0 1px 2px rgba(0,0,0,.05); white-space: nowrap; }
.google-mark { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: #4285f4; font-weight: 800; background: #f2f6ff; }
.disabled { opacity: .55; cursor: not-allowed; }

/* ===== Cards & Basics ===== */
.card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  margin-bottom: 16px;
}
h2, h3 { margin: 0 0 10px 0; }
.muted { color: #c2410c; font-size: 13px; }
.help { color: #6b7280; font-size: 13px; margin: 6px 0 0; }
.alert { border-radius: 10px; padding: 11px 14px; margin-bottom: 14px; border: 1px solid; }
.alert-success { color: #166534; background: #f0fdf4; border-color: #bbf7d0; }
.alert-error { color: #991b1b; background: #fef2f2; border-color: #fecaca; }
pre {
  white-space: pre-wrap;
  word-break: break-all;
  background: #0b1020;
  color: #d1d5db;
  padding: 12px;
  border-radius: 10px;
  max-height: 360px;
  overflow: auto;
}

/* 按钮 */
.btn { display: inline-block; padding: 10px 16px; border: 1px solid transparent; border-radius: 10px; background: #111827; color: #fff; cursor: pointer; text-decoration: none; font: inherit; line-height: 1.2; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn.copy { float: right; background: #717171; }
.btn-small { padding: 7px 11px; font-size: 13px; border-radius: 8px; }
.btn-ghost { background: #fff; color: #374151; border-color: #d1d5db; }
.btn-danger { background: #fff; color: #b91c1c; border-color: #fecaca; }

/* 输入统一 */
input, textarea, select {
  width: 100%;
  padding: 10px;
  box-sizing: border-box;
  font-family: ui-monospace,Consolas,Menlo,monospace;
  font-size: 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
}
input:focus, textarea:focus, select:focus { outline: 3px solid rgba(37,99,235,.15); border-color: #2563eb; }

/* ===== 表单布局：每行一个，标题在上，控件在下 ===== */
.grid { display: block; }
.grid > div {
  display: block;          /* 每一项单独一行 */
  width: 100%;
  margin-bottom: 12px;
}
.grid > div > label {
  display: block;          /* 标题永远在上方 */
  font-weight: 600;
  margin: 0 0 6px 0;       /* 与下方控件留间距 */
}
.grid > div > .muted {
  display: block;          /* 说明文字在控件下方 */
  margin-top: 6px;
}

/* 表格（TXT 列表等） */
table {
  width: 100%;
  border-collapse: collapse;
  font-family: ui-monospace,Consolas,Menlo,monospace;
}
th, td { border: 1px solid #e5e7eb; padding: 8px; text-align: left; vertical-align: top; }
.copyable { cursor: pointer; text-decoration: underline dotted #9ca3af; }

/* 动作区域 */
.actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.submit-actions { flex-wrap: wrap; }
.submit-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 42px;
  padding-top: 0;
  padding-bottom: 0;
}

/* ===== Personal center ===== */
.account-heading { justify-content: space-between; margin-bottom: 14px; }
.account-heading p { margin: 0; color: #6b7280; }
.account-summary { display: grid; grid-template-columns: 140px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid #e5e7eb; }
.account-summary span { color: #6b7280; }
.form-section { margin-top: 18px; padding-top: 18px; border-top: 1px solid #e5e7eb; }
.form-section label { display: block; font-weight: 650; margin-bottom: 6px; }
.compact-form { max-width: 760px; }
.inline-controls input { flex: 1; }
.inline-controls .btn { flex: 0 0 auto; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.section-heading { justify-content: space-between; align-items: flex-start; }
.table-wrap { overflow-x: auto; }
.account-table { min-width: 720px; }
.issuance-table { min-width: 900px; }
.domain-list { display: grid; gap: 3px; min-width: 180px; }
.domain-list span { overflow-wrap: anywhere; }
.issuance-actions { flex-wrap: wrap; min-width: 210px; }
.row-actions { white-space: nowrap; }
.empty-state { padding: 18px; border: 1px dashed #d1d5db; border-radius: 10px; color: #6b7280; text-align: center; }

/* ===== H5 自适配（小屏优化） ===== */
@media (max-width: 640px) {
  .page { width: 96vw; margin: 12px auto; }
  .btn.copy { float: none; margin-top: 8px; }
  .topbar { align-items: flex-start; }
  .brand { font-size: 18px; }
  .google-btn { padding: 8px 10px; font-size: 13px; }
  .user-chip span { display: none; }
  .account-heading { align-items: flex-start; }
  .form-grid { grid-template-columns: 1fr; }
  .inline-controls { align-items: stretch; flex-direction: column; }
  .account-summary { grid-template-columns: 1fr; gap: 4px; }
}
