:root {
  --primary: #3b82f6;
  --bg: #f5f6fa;
  --text: #0f172a;
  --muted: #64748b;
  --border: #dbe3ef;
  --panel: #ffffff;
  --panel-soft: #fafbfe;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); }
a { text-decoration: none; }
button, input, select, textarea { font: inherit; }
.container { width: min(100% - 32px, var(--container-max-width, 1200px)); margin: 0 auto; }
.site-header { background: #fff; border-bottom: 1px solid var(--border); }
.header-inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand-wrap { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.brand-logo { width: 38px; height: 38px; border-radius: 999px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; overflow: hidden; }
.brand-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.main-nav { display: flex; gap: 28px; margin-left: 10px; }
.main-nav a { color: var(--muted); font-size: 14px; }
.main-nav a.active { color: var(--primary); font-weight: 600; }
.wallet-btn, .primary-btn, .secondary-btn { border-radius: 10px; height: 46px; padding: 0 20px; cursor: pointer; }
.wallet-btn { height: 40px; background: #fff; color: var(--primary); border: 1px solid var(--primary); font-weight: 600; }
.page-main, .admin-main { padding: 28px 0 40px; }
.breadcrumb { font-size: 13px; color: #94a3b8; margin-bottom: 14px; }
.main-card, .admin-card, .admin-login-card { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 20px 22px; box-shadow: 0 8px 30px rgba(15,23,42,.04); }
.admin-card, .admin-login-card { margin-bottom: 18px; }
.toolbar-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid #eef2f7; padding-bottom: 18px; }
.toolbar-left { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.select-wrap { position: relative; }
.select-wrap select { appearance: none; border: 1px solid var(--border); background: #fff; height: 44px; min-width: 170px; padding: 0 40px 0 14px; border-radius: 10px; color: #1e293b; font-size: 14px; }
.select-arrow { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: #94a3b8; pointer-events: none; }
.token-type-row { display: flex; flex-wrap: wrap; gap: 8px; }
.token-type-btn { height: 44px; border-radius: 10px; padding: 0 16px; border: 1px solid var(--border); background: #fff; color: #334155; cursor: pointer; }
.token-type-btn.active { background: #eaf3ff; color: var(--primary); border-color: #d7e7ff; font-weight: 600; }
.token-type-btn.disabled { background: #f1f5f9; color: #94a3b8; border-color: #e2e8f0; cursor: not-allowed; }
.form-shell { margin-top: 24px; width: 100%; }
.grid-form { display: grid; gap: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); background: var(--panel-soft); border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.field-block label { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 14px; font-weight: 600; color: #1e3a5f; }
.field-block label em { color: var(--primary); font-style: normal; }
.field-block .tip { font-size: 12px; color: #94a3b8; font-weight: 500; }
.field-block input, .admin-input, .json-editor, .input-with-suffix { width: 100%; border-radius: 10px; border: 1px solid #cfd8e5; background: #fff; color: #0f172a; }
.field-block input, .admin-input { height: 48px; padding: 0 16px; }
.input-with-suffix { display: flex; align-items: center; height: 48px; padding: 0 16px; }
.input-with-suffix input { flex: 1; border: none; height: 100%; padding: 0; outline: none; background: transparent; }
.input-with-suffix span { color: #94a3b8; font-weight: 600; }
.span-2 { grid-column: 1 / -1; }
.action-row { margin-top: 22px; display: flex; gap: 16px; flex-wrap: wrap; }
.primary-btn { background: var(--primary); color: #fff; border: none; font-weight: 700; box-shadow: 0 10px 24px rgba(59,130,246,.22); }
.secondary-btn { background: #fff; color: #334155; border: 1px solid #cbd5e1; font-weight: 600; }
.status-panel { margin-top: 18px; border-radius: 12px; background: #f8fafc; border: 1px solid #e2e8f0; padding: 14px 16px; color: #475569; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.admin-main h2 { margin: 0 0 14px; font-size: 18px; }
.admin-grid { display: grid; gap: 16px; }
.admin-grid.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.admin-grid.three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-3 { grid-column: 1 / -1; }
.compact-grid { align-items: end; }
.inline-end { display: flex; justify-content: flex-end; }
.admin-label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 600; color: #334155; }
.json-editor { min-height: 280px; padding: 14px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.compact-editor { min-height: 96px; }
.card-tip { color: #64748b; font-size: 13px; margin: -4px 0 12px; }
.table-wrap { overflow: auto; }
.order-table { width: 100%; border-collapse: collapse; min-width: 980px; }
.order-table th, .order-table td { border-bottom: 1px solid #e2e8f0; padding: 12px 10px; text-align: left; font-size: 13px; vertical-align: top; }
.order-table th { color: #475569; background: #f8fafc; position: sticky; top: 0; }
.sticky-actions { position: sticky; bottom: 10px; z-index: 2; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.muted { color: #94a3b8; }
@media (max-width: 980px) {
  .grid-form, .admin-grid.two-col, .admin-grid.three-col { grid-template-columns: 1fr; }
  .span-3 { grid-column: auto; }
  .span-2 { grid-column: auto; }
  .main-nav { display: none; }
  .container { width: min(100% - 20px, var(--container-max-width, 1200px)); }
}
