/* ============================================================
   UniCode 校服溯源码系统 —— 公共样式（设计变量 / 按钮 / 表单 / 弹层 / 提示）
   引入顺序：common.css -> admin.css / t.css
   ============================================================ */

:root {
  --c-primary: #1d6ff2;
  --c-primary-dark: #155bd0;
  --c-primary-light: #eaf1fe;
  --c-success: #07a35a;
  --c-success-bg: #e6f7ef;
  --c-danger: #e34d59;
  --c-danger-bg: #fdecee;
  --c-warning: #d98a1c;
  --c-warning-bg: #fdf3e3;
  --c-text: #1f2329;
  --c-text-2: #4e5969;
  --c-text-3: #86909c;
  --c-border: #e5e6eb;
  --c-bg: #f5f6f8;
  --c-card: #ffffff;
  --radius: 8px;
  --radius-sm: 5px;
  --shadow: 0 2px 10px rgba(31, 35, 41, 0.06);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  color: var(--c-text);
  background: var(--c-bg);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--c-primary);
  text-decoration: none;
}

a:hover {
  color: var(--c-primary-dark);
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--c-text);
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  user-select: none;
}

.btn:hover {
  border-color: var(--c-primary);
  color: var(--c-primary);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  border-color: var(--c-border);
  color: var(--c-text-3);
  background: #f7f8fa;
}

.btn-primary {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--c-primary-dark);
  border-color: var(--c-primary-dark);
  color: #fff;
}

.btn-danger {
  background: var(--c-danger);
  border-color: var(--c-danger);
  color: #fff;
}

.btn-danger:hover {
  background: #cc3b46;
  border-color: #cc3b46;
  color: #fff;
}

.btn-success {
  background: var(--c-success);
  border-color: var(--c-success);
  color: #fff;
}

.btn-success:hover {
  background: #068b4c;
  border-color: #068b4c;
  color: #fff;
}

.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-ghost {
  background: transparent;
}

/* ---------- 徽标 ---------- */
.badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 20px;
  white-space: nowrap;
}

.badge-success {
  background: var(--c-success-bg);
  color: var(--c-success);
}

.badge-danger {
  background: var(--c-danger-bg);
  color: var(--c-danger);
}

.badge-warning {
  background: var(--c-warning-bg);
  color: var(--c-warning);
}

.badge-muted {
  background: #f0f1f3;
  color: var(--c-text-3);
}

.badge-primary {
  background: var(--c-primary-light);
  color: var(--c-primary);
}

/* ---------- 表单 ---------- */
.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--c-text);
}

.field label .req {
  color: var(--c-danger);
  margin-left: 2px;
}

.field .hint {
  margin-top: 4px;
  font-size: 12px;
  color: var(--c-text-3);
}

.input,
.select,
.textarea {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 14px;
  color: var(--c-text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.textarea {
  height: auto;
  min-height: 70px;
  padding: 8px 10px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 2px rgba(29, 111, 242, 0.12);
}

.input.is-error,
.select.is-error,
.textarea.is-error {
  border-color: var(--c-danger);
}

.input[disabled],
.select[disabled] {
  background: #f7f8fa;
  color: var(--c-text-3);
  cursor: not-allowed;
}

.field-error {
  margin-top: 4px;
  font-size: 12px;
  color: var(--c-danger);
  min-height: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0 16px;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--c-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.card + .card {
  margin-top: 16px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px;
}

.card-subtitle {
  color: var(--c-text-3);
  font-size: 12px;
  margin: 0 0 12px;
}

/* ---------- 弹层 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(31, 35, 41, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal-mask.show {
  display: flex;
}

.modal {
  background: #fff;
  border-radius: 10px;
  width: 100%;
  max-width: 460px;
  max-height: 86vh;
  overflow: auto;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.16);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--c-border);
  font-weight: 600;
}

.modal-close {
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: var(--c-text-3);
  cursor: pointer;
}

.modal-body {
  padding: 18px;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--c-border);
}

/* ---------- 提示条（toast 由 JS 简单 alert 兜底，此样式用于行内提示） ---------- */
.msg-box {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 12px;
}

.msg-box.info {
  background: var(--c-primary-light);
  color: var(--c-primary);
}

.msg-box.warn {
  background: var(--c-warning-bg);
  color: var(--c-warning);
}

.msg-box.error {
  background: var(--c-danger-bg);
  color: var(--c-danger);
}

/* ---------- 空态 ---------- */
.empty {
  text-align: center;
  color: var(--c-text-3);
  padding: 40px 16px;
}

/* ---------- 工具 ---------- */
.flex {
  display: flex;
  align-items: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gap-8 {
  gap: 8px;
}

.gap-12 {
  gap: 12px;
}

.mt-8 {
  margin-top: 8px;
}

.mt-16 {
  margin-top: 16px;
}

.mb-8 {
  margin-bottom: 8px;
}

.mb-16 {
  margin-bottom: 16px;
}

.text-muted {
  color: var(--c-text-3);
}

.text-small {
  font-size: 12px;
}

.text-center {
  text-align: center;
}

.mono {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

/* ---------- 页脚（ICP + 公安备案号悬挂，全站统一） ---------- */
.site-footer {
  text-align: center;
  color: var(--c-text-3);
  font-size: 12px;
  line-height: 1.9;
  padding: 20px 16px 28px;
}

.site-footer a {
  color: var(--c-text-3);
}

.site-footer a:hover {
  color: var(--c-primary);
}

.site-footer a img {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  margin-right: 3px;
}

/* ---------- 分页 ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 12px;
}

.pagination .page-info {
  color: var(--c-text-2);
  font-size: 13px;
}
