:root {
  --primary: #1a6fd4;
  --primary-dark: #1357a8;
  --primary-light: #e8f1fd;
  --success: #1a9c5b;
  --warn: #d98324;
  --danger: #d64545;
  --text: #1f2733;
  --text-2: #5b6878;
  --text-3: #8b97a6;
  --line: #e3e8ef;
  --bg: #f5f7fa;
  --card: #ffffff;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 30, 54, .06), 0 8px 24px rgba(16, 30, 54, .06);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

.wrap { max-width: 720px; margin: 0 auto; padding: 16px; }
.wrap-wide { max-width: 1280px; margin: 0 auto; padding: 20px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 14px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 9px; border: 1px solid var(--line);
  background: #fff; color: var(--text); cursor: pointer;
  font-weight: 500; transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: #c3ccd8; background: #fafbfc; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-danger { background: #fff; border-color: #f0c7c7; color: var(--danger); }
.btn-danger:hover { background: #fdf4f4; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--primary); }
.btn-sm { padding: 6px 12px; font-size: 14px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.input, .select, .textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: 9px; background: #fff; outline: none; transition: .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,111,212,.1); }
.textarea { resize: vertical; min-height: 72px; }
.input-sm { padding: 6px 9px; font-size: 14px; }

.row { display: flex; gap: 10px; align-items: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--text-3); font-size: 13px; }
.small { font-size: 13px; }
.center { text-align: center; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; }
.hide { display: none !important; }

.tag {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  font-size: 12px; background: var(--primary-light); color: var(--primary-dark);
}
.tag-gray { background: #eef1f5; color: var(--text-2); }
.tag-green { background: #e7f6ee; color: var(--success); }
.tag-orange { background: #fdf2e5; color: var(--warn); }
.tag-red { background: #fbeaea; color: var(--danger); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
th { background: #f8fafc; font-weight: 600; color: var(--text-2); font-size: 13px; white-space: nowrap; }
tbody tr:hover { background: #fbfcfe; }
.table-scroll { overflow-x: auto; }

.bar { height: 8px; border-radius: 4px; background: #eef1f5; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--primary); border-radius: 4px; transition: width .3s; }

.toast {
  position: fixed; left: 50%; top: 24px; transform: translateX(-50%);
  background: rgba(31,39,51,.92); color: #fff; padding: 10px 20px;
  border-radius: 10px; font-size: 14px; z-index: 9999; max-width: 80vw;
  opacity: 0; transition: .25s; pointer-events: none;
}
.toast.show { opacity: 1; }
.toast.err { background: rgba(198,54,54,.95); }
.toast.ok { background: rgba(24,140,84,.95); }

.modal-mask {
  position: fixed; inset: 0; background: rgba(20,28,40,.45);
  display: flex; align-items: center; justify-content: center; z-index: 999;
  padding: 16px;
}
.modal {
  background: #fff; border-radius: 14px; padding: 22px; width: 100%;
  max-width: 520px; max-height: 86vh; overflow: auto;
}
.modal h3 { margin-bottom: 14px; font-size: 17px; }

.empty {
  padding: 40px 16px; text-align: center; color: var(--text-3); font-size: 14px;
}

.logo-dot {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, #2f8ae0, #1a6fd4);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 15px;
}

@media (max-width: 640px) {
  .wrap { padding: 12px; }
  .card { padding: 14px; border-radius: 10px; }
  .wrap-wide { padding: 12px; }
}
