:root {
  --brand: #155eef;
  --brand-dark: #0e4ac4;
  --brand-soft: #edf4ff;
  --text: #1f2329;
  --text-sub: #5c6470;
  --muted: #8b939f;
  --line: #ebeef2;
  --bg: #f5f6f8;
  --white: #ffffff;
  --success: #12a150;
  --warning: #d97706;
  --danger: #e5484d;
  --info: #2563eb;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 2px 10px rgba(31, 35, 41, 0.06);
  --shadow-lg: 0 10px 30px rgba(31, 35, 41, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--brand);
}

img {
  max-width: 100%;
  display: block;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 12px;
  font-weight: 600;
  line-height: 1.35;
}

h1 {
  font-size: 24px;
}
h2 {
  font-size: 20px;
}
h3 {
  font-size: 16px;
}
h4 {
  font-size: 14px;
}

p {
  margin: 0 0 10px;
}

ul,
ol {
  margin: 0;
  padding-left: 20px;
}

.container {
  width: 1200px;
  max-width: calc(100% - 32px);
  margin: 0 auto;
}

.main-content {
  padding: 20px 0 48px;
  min-height: 60vh;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.btn:hover {
  color: var(--text);
  border-color: #d8dde5;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-primary:hover {
  background: var(--brand-dark);
  color: #fff;
  border-color: transparent;
}

.btn-outline {
  border-color: #d8dde5;
  background: transparent;
}

.btn-outline:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.btn-danger {
  border-color: #f5c2c3;
  color: var(--danger);
  background: #fff;
}

.btn-danger:hover {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-sub);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 13px;
}

.btn-lg {
  padding: 12px 26px;
  font-size: 16px;
}

.btn-block {
  width: 100%;
}

.btn[disabled],
.btn.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ---------- 表单 ---------- */
label {
  display: block;
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 6px;
}

input[type='text'],
input[type='search'],
input[type='password'],
input[type='number'],
input[type='tel'],
input[type='url'],
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #dfe3e9;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(255, 80, 0, 0.12);
}

textarea {
  resize: vertical;
  min-height: 90px;
}

.form-row {
  margin-bottom: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 16px;
}

.form-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
}

.checkbox-line input {
  width: auto;
  margin: 0;
}

/* ---------- 卡片 / 面板 ---------- */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.card + .card {
  margin-top: 16px;
}

.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title h3 {
  margin: 0;
}

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.page-head h1,
.page-head h2 {
  margin: 0;
}

.breadcrumb {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
}

.breadcrumb a:hover {
  color: var(--brand);
}

/* ---------- 表格 ---------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #fff;
}

.data-table th,
.data-table td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.data-table th {
  background: #fafbfc;
  font-weight: 600;
  color: var(--text-sub);
  white-space: nowrap;
}

.data-table tbody tr:hover {
  background: #fcfcfd;
}

.data-table .col-actions {
  white-space: nowrap;
}

.data-table .col-actions form {
  display: inline-block;
  margin-right: 6px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* ---------- 徽标 / 状态 ---------- */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 12px;
  line-height: 18px;
  background: #f1f3f6;
  color: var(--text-sub);
  white-space: nowrap;
}

.badge-success {
  background: #e8f7ee;
  color: var(--success);
}
.badge-warning {
  background: #fff5e6;
  color: var(--warning);
}
.badge-danger {
  background: #fdeced;
  color: var(--danger);
}
.badge-info {
  background: #eaf1ff;
  color: var(--info);
}
.badge-brand {
  background: var(--brand-soft);
  color: var(--brand);
}

.status-0 {
  color: var(--warning);
}
.status-1 {
  color: var(--info);
}
.status-2 {
  color: var(--info);
}
.status-3 {
  color: var(--success);
}
.status-4 {
  color: var(--muted);
}

/* ---------- 提示 ---------- */
.alert {
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 14px;
  border: 1px solid transparent;
}

.alert-success {
  background: #e8f7ee;
  color: #0f7a3d;
  border-color: #bfe6cd;
}

.alert-error {
  background: #fdeced;
  color: #b3282c;
  border-color: #f7c9cb;
}

.alert-warning {
  background: #fff5e6;
  color: #92590a;
  border-color: #f6dcb0;
}

.alert-info {
  background: #eaf1ff;
  color: #1c4fd8;
  border-color: #c6d9ff;
}

/* ---------- 价格 ---------- */
.price {
  color: var(--brand);
  font-weight: 700;
}

.price-lg {
  font-size: 26px;
}

.price-suffix {
  color: var(--muted);
  font-size: 12px;
  margin-left: 2px;
}

.sales {
  color: var(--muted);
  font-size: 12px;
}

/* ---------- 分页 ---------- */
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  margin-top: 24px;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 13px;
  color: var(--text-sub);
}

.pagination a:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.pagination .active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.pagination .disabled {
  opacity: 0.5;
}

.pagination .ellipsis {
  border: none;
  background: transparent;
}

.pagination .page-total {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

/* ---------- 空状态 / 错误页 ---------- */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.empty-icon {
  font-size: 40px;
  margin-bottom: 10px;
  opacity: 0.5;
}

.error-page {
  text-align: center;
  padding: 60px 20px;
}

.error-code {
  font-size: 64px;
  font-weight: 800;
  color: var(--brand);
  line-height: 1;
  margin-bottom: 12px;
}

.error-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}

/* ---------- 工具类 ---------- */
.muted {
  color: var(--muted);
}
.text-sub {
  color: var(--text-sub);
}
.text-right {
  text-align: right;
}
.text-center {
  text-align: center;
}
.nowrap {
  white-space: nowrap;
}
.text-danger {
  color: var(--danger);
}
.mt-8 {
  margin-top: 8px;
}
.mt-16 {
  margin-top: 16px;
}
.mt-24 {
  margin-top: 24px;
}
.mb-0 {
  margin-bottom: 0;
}
.mb-8 {
  margin-bottom: 8px;
}
.mb-16 {
  margin-bottom: 16px;
}
.flex {
  display: flex;
}
.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.flex-center {
  display: flex;
  align-items: center;
  gap: 12px;
}
.flex-wrap {
  flex-wrap: wrap;
}
.grow {
  flex: 1;
  min-width: 0;
}
.hidden {
  display: none !important;
}

/* ---------- 轻提示 ---------- */
.toast {
  position: fixed;
  left: 50%;
  top: 84px;
  transform: translateX(-50%);
  padding: 10px 20px;
  border-radius: 20px;
  background: rgba(31, 35, 41, 0.9);
  color: #fff;
  font-size: 13.5px;
  z-index: 200;
  box-shadow: var(--shadow-lg);
  max-width: 80vw;
  text-align: center;
}

.toast-success {
  background: rgba(18, 161, 80, 0.94);
}

.toast-error {
  background: rgba(229, 72, 77, 0.94);
}
