:root {
  --primary: #2f6fed;
  --primary-dark: #1d55c9;
  --ink: #131a24;
  --ink-2: #465063;
  --ink-3: #78829a;
  --line: #e6e9ef;
  --line-2: #eef0f4;
  --bg: #f4f6f9;
  --card: #ffffff;
  --amber: #e0820a;
  --amber-bg: #fff6e6;
  --blue: #2f6fed;
  --blue-bg: #edf3ff;
  --green: #0e9f6e;
  --green-bg: #e9faf3;
  --slate: #8494ab;
  --slate-bg: #f1f4f8;
  --danger: #dc2f45;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow-md: 0 10px 30px -14px rgba(16, 24, 40, .22), 0 2px 6px rgba(16, 24, 40, .05);
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

body.modal-open { overflow: hidden; }

.hidden { display: none !important; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.spacer { flex: 1; }

/* ---------------- 启动 ---------------- */

.boot {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--ink-3);
  background: var(--bg);
  z-index: 60;
}

.boot-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid #dfe4ec;
  border-top-color: var(--primary);
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- 登录页 ---------------- */

.auth {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  min-height: 100vh;
}

.auth-visual {
  background:
    radial-gradient(1200px 600px at 10% 0%, #3f7dfa 0%, transparent 55%),
    radial-gradient(900px 500px at 90% 100%, #7c4dff 0%, transparent 50%),
    linear-gradient(160deg, #16233c 0%, #101b30 60%, #0c1526 100%);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 56px;
}

.auth-visual-inner { max-width: 460px; }

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: .4px;
  margin-bottom: 34px;
  color: #cfe0ff;
}

.auth-logo-mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(140deg, #6ea8ff, #b98bff);
  box-shadow: 0 6px 18px -6px #6ea8ff;
}

.auth-visual h2 {
  font-size: 30px;
  line-height: 1.35;
  margin: 0 0 26px;
  font-weight: 650;
}

.auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }

.auth-points li {
  position: relative;
  padding-left: 20px;
  color: #b9c7de;
  line-height: 1.6;
}

.auth-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6ea8ff;
}

.auth-points b { color: #fff; font-weight: 600; }

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.auth-card {
  width: 100%;
  max-width: 392px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 26px;
  box-shadow: var(--shadow-md);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: #f2f4f8;
  padding: 4px;
  border-radius: 11px;
  margin-bottom: 22px;
}

.auth-tab {
  border: 0;
  background: transparent;
  padding: 9px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--ink-2);
  cursor: pointer;
  font-family: inherit;
  transition: .16s;
}

.auth-tab.is-active { background: #fff; color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm); }

.auth-form { display: grid; gap: 14px; }
.form-error { color: var(--danger); font-size: 12.5px; margin: 0; min-height: 16px; }
.form-hint { color: var(--ink-3); font-size: 12px; margin: 0; line-height: 1.6; }

/* ---------------- 表单元素 ---------------- */

.field { display: grid; gap: 7px; align-content: start; }
.field > span { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.field-tip { color: var(--ink-3); font-weight: 400; margin-left: 6px; font-size: 11.5px; }

.input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  transition: border-color .16s, box-shadow .16s;
}

.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, .14);
}

textarea.input { resize: vertical; line-height: 1.6; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }

/* ---------------- 按钮 ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 13.5px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: .16s;
  font-weight: 500;
}

.btn:hover { border-color: #cfd6e2; background: #fbfcfe; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 6px 16px -8px rgba(47, 111, 237, .8);
}

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

.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { background: #fff; }

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

.btn-danger-ghost { color: var(--danger); border-color: #f4cdd4; background: #fff5f7; }
.btn-danger-ghost:hover { background: #ffe9ed; }

.btn-block { width: 100%; padding: 11px; font-size: 14.5px; }

.btn-mini { padding: 5px 9px; font-size: 12px; border-radius: 8px; }
.btn-mini-danger { color: var(--danger); border-color: #f4cdd4; }
.btn-mini-danger:hover { background: #fff5f7; }

.icon-btn {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  color: var(--ink-2);
  font-size: 15px;
  font-family: inherit;
  transition: .16s;
}

.icon-btn:hover { border-color: #cfd6e2; color: var(--ink); }

/* ---------------- 顶栏 ---------------- */

.app { display: flex; flex-direction: column; height: 100vh; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 20;
}

.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }

.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(140deg, #4a86ff, #8a63ff);
  box-shadow: 0 6px 16px -8px rgba(74, 134, 255, .9);
  flex: none;
}

.topbar-title h1 { font-size: 16.5px; margin: 0; font-weight: 650; letter-spacing: .2px; }
.topbar-sub { font-size: 12px; color: var(--ink-3); }
.topbar-right { display: flex; align-items: center; gap: 10px; position: relative; }

.segmented { display: flex; gap: 3px; background: #f2f4f8; padding: 3px; border-radius: 11px; }

.segmented button {
  border: 0;
  background: transparent;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--ink-2);
  transition: .16s;
}

.segmented button.is-active { background: #fff; color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm); }

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  border-radius: 999px;
  border: 1px solid var(--line);
  cursor: pointer;
  font-size: 13px;
  transition: .16s;
}

.user-chip:hover { background: #fbfcfe; }

.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(140deg, #6ea8ff, #a78bfa);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 600;
  flex: none;
}

.avatar-sm { width: 30px; height: 30px; font-size: 13px; }
.avatar-xs { width: 20px; height: 20px; font-size: 11px; }

.user-menu {
  position: absolute;
  right: 0;
  top: 46px;
  width: 230px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 6px;
  z-index: 40;
}

.user-menu-head { padding: 9px 10px 10px; border-bottom: 1px solid var(--line-2); display: grid; gap: 3px; margin-bottom: 5px; }
.user-menu-head b { font-size: 13.5px; }
.user-menu-head span { font-size: 12px; color: var(--ink-3); }

.user-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 10px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  font-size: 13.5px;
  font-family: inherit;
  cursor: pointer;
  color: var(--ink-2);
}

.user-menu button:hover { background: #f4f6f9; color: var(--ink); }

/* ---------------- 品牌标签 ---------------- */

.brandtabs {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  overflow-x: auto;
  background: #fff;
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}

.brandtab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--ink-2);
  white-space: nowrap;
  transition: .16s;
}

.brandtab:hover { border-color: #cfd6e2; }

.brandtab.is-active {
  background: #eef3ff;
  border-color: #bcd0ff;
  color: var(--primary-dark);
  font-weight: 600;
}

.brandtab-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand, #94a3b8); flex: none; }
.brandtab-dot-all { background: linear-gradient(140deg, #6ea8ff, #a78bfa); }

.brandtab-count {
  font-size: 11.5px;
  background: #f2f4f8;
  color: var(--ink-3);
  padding: 1px 7px;
  border-radius: 999px;
}

.brandtab.is-active .brandtab-count { background: #dbe7ff; color: var(--primary-dark); }
.brandtab-add { border-style: dashed; color: var(--ink-3); }

/* ---------------- 主区域 ---------------- */

.main { flex: 1; overflow: auto; padding: 0 20px 30px; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 16px 0 12px;
  position: sticky;
  top: 0;
  background: linear-gradient(var(--bg) 78%, rgba(244, 246, 249, 0));
  z-index: 10;
}

.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.page-title { font-size: 16px; font-weight: 650; }

.month-nav { display: flex; align-items: center; gap: 6px; }

.month-label {
  border: 0;
  background: transparent;
  font-size: 15.5px;
  font-weight: 650;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  min-width: 118px;
}

.month-label:hover { background: #eaeef5; }

.status-filters { display: flex; gap: 6px; }

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 12.5px;
  font-family: inherit;
  color: var(--ink-3);
  cursor: pointer;
  transition: .16s;
}

.status-chip-dot { width: 7px; height: 7px; border-radius: 50%; background: #c8cfdb; }
.status-chip.is-on { color: var(--ink); border-color: #cfd6e2; }
.status-chip.st-making.is-on { background: var(--amber-bg); border-color: #f5dcae; color: #a35f00; }
.status-chip.st-ready.is-on { background: var(--blue-bg); border-color: #c5d7ff; color: var(--primary-dark); }
.status-chip.st-done.is-on { background: var(--green-bg); border-color: #b6e8d3; color: #0a7a54; }
.status-chip.st-canceled.is-on { background: var(--slate-bg); border-color: #dbe2ec; color: #5b6b83; }
.status-chip.st-making.is-on .status-chip-dot { background: var(--amber); }
.status-chip.st-ready.is-on .status-chip-dot { background: var(--blue); }
.status-chip.st-done.is-on .status-chip-dot { background: var(--green); }
.status-chip.st-canceled.is-on .status-chip-dot { background: var(--slate); }

.search input {
  width: 220px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-size: 13.5px;
  font-family: inherit;
  background: #fff;
}

.search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 111, 237, .13); }

/* ---------------- 统计 ---------------- */

.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }

.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-sm);
}

.stat-label { font-size: 12.5px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.stat-label i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.stat-value { font-size: 22px; font-weight: 650; letter-spacing: -.4px; }

.stat-total { background: linear-gradient(140deg, #f7f9ff, #fff); }
.stat-card.st-making .stat-label i, .stat-card.st-making .stat-value { color: var(--amber); }
.stat-card.st-making .stat-label i { background: var(--amber); }
.stat-card.st-making .stat-value { color: var(--ink); }
.stat-card.st-ready .stat-label i { background: var(--blue); }
.stat-card.st-done .stat-label i { background: var(--green); }
.stat-card.st-canceled .stat-label i { background: var(--slate); }

/* ---------------- 月历 ---------------- */

.calendar {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.cal-head {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  background: #fafbfd;
  border-bottom: 1px solid var(--line);
}

.cal-head-cell {
  padding: 9px 10px;
  font-size: 12.5px;
  color: var(--ink-3);
  font-weight: 500;
  text-align: center;
}

.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }

.day {
  min-height: 148px;
  padding: 8px;
  border-right: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: background .15s;
}

.cal-grid .day:nth-child(7n) { border-right: 0; }
.day:hover { background: #fafcff; }
.day.is-out { background: #fbfcfd; }
.day.is-out .day-num { color: #b8c0cd; }
.day.is-today { background: #f6f9ff; box-shadow: inset 0 0 0 2px rgba(47, 111, 237, .28); }

.day-head { display: flex; align-items: center; gap: 6px; }
.day-num { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.day-tag { font-size: 10.5px; background: var(--primary); color: #fff; padding: 1px 6px; border-radius: 999px; }
.day-count { margin-left: auto; font-size: 11px; color: var(--ink-3); }
.day-body { display: flex; flex-direction: column; gap: 5px; }

.chip {
  --st: #8494ab;
  --st-bg: #f1f4f8;
  --st-line: #dde4ee;
  background: var(--st-bg);
  border: 1px solid var(--st-line);
  border-left: 3px solid var(--st);
  border-radius: 9px;
  padding: 6px 8px;
  box-shadow: var(--shadow-sm);
  transition: transform .14s, box-shadow .14s;
  overflow: hidden;
}

/* 整块颜色 = 内容当前状态 */
.chip.st-making { --st: #e0820a; --st-bg: #fef4e6; --st-line: #f6ddb5; }
.chip.st-ready { --st: #2f6fed; --st-bg: #e9f0ff; --st-line: #c6d8ff; }
.chip.st-done { --st: #0e9f6e; --st-bg: #e5f7ef; --st-line: #b0e5d0; }
.chip.st-canceled { --st: #8494ab; --st-bg: #eff2f7; --st-line: #dde4ee; }

.chip:hover { transform: translateY(-1px); box-shadow: 0 8px 18px -10px rgba(16, 24, 40, .35); }

.chip-top { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }

.chip-brand {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--ink-2);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip-brand i { width: 7px; height: 7px; border-radius: 50%; background: var(--brand, #94a3b8); flex: none; }

.chip-status {
  margin-left: auto;
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 999px;
  white-space: nowrap;
}

.chip-status { background: var(--st); color: #fff; font-weight: 600; }
.chip.st-canceled .chip-status { background: #8494ab; }

.chip-title {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.chip-meta { display: flex; flex-direction: column; gap: 1px; margin-top: 4px; }

.plt {
  font-size: 10.5px;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plt-main { color: #3f5a8a; font-weight: 500; }
.chip.is-canceled { background: #eff2f7; }
.chip.is-canceled .chip-title { text-decoration: line-through; color: var(--ink-3); }

.view-hint { margin: 10px 2px 0; font-size: 12px; color: var(--ink-3); }

/* ---------------- 总表 ---------------- */

.table-wrap {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: auto;
  box-shadow: var(--shadow-sm);
  max-height: calc(100vh - 320px);
}

.data-table { width: 100%; border-collapse: collapse; min-width: 940px; }

.data-table thead th {
  position: sticky;
  top: 0;
  background: #fafbfd;
  text-align: left;
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 500;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  z-index: 2;
}

.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-2);
  font-size: 13px;
  vertical-align: top;
}

.data-table tbody tr:hover { background: #fafcff; }
.data-table tbody tr:last-child td { border-bottom: 0; }

.cell-date { white-space: nowrap; }
.date-main { display: block; font-weight: 600; }
.date-week { font-size: 11.5px; color: var(--ink-3); }

.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 12%, #fff);
  color: color-mix(in srgb, var(--brand) 78%, #16233c);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
}

.brand-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }

.cell-title { max-width: 320px; }
.title-main { display: block; font-weight: 600; }
.title-note { display: block; font-size: 12px; color: var(--ink-3); margin-top: 2px; line-height: 1.5; }

.status-select {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  font-weight: 500;
}

.status-select.st-making { background: var(--amber-bg); color: #a35f00; }
.status-select.st-ready { background: var(--blue-bg); color: var(--primary-dark); }
.status-select.st-done { background: var(--green-bg); color: #0a7a54; }
.status-select.st-canceled { background: var(--slate-bg); color: #5b6b83; }

.cell-dist { max-width: 220px; }

.tag {
  display: inline-block;
  background: #f2f4f8;
  color: var(--ink-2);
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 6px;
  margin: 0 4px 4px 0;
}

.cell-meta { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.cell-actions { white-space: nowrap; display: flex; gap: 6px; }
tr.is-canceled .title-main { text-decoration: line-through; color: var(--ink-3); }

/* ---------------- 设置 ---------------- */

.settings { display: grid; gap: 14px; }

.settings-tabs { display: flex; gap: 6px; flex-wrap: wrap; }

.settings-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--ink-2);
  transition: .16s;
}

.settings-tab.is-active { border-color: #bcd0ff; background: #eef3ff; color: var(--primary-dark); font-weight: 600; }
.settings-tab-count { font-size: 11.5px; background: #f2f4f8; padding: 1px 7px; border-radius: 999px; color: var(--ink-3); }
.settings-tab.is-active .settings-tab-count { background: #dbe7ff; color: var(--primary-dark); }

.settings-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 14px;
}

.setting-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.setting-head h3 { margin: 0 0 5px; font-size: 16px; }
.setting-head p { margin: 0; font-size: 12.5px; max-width: 620px; line-height: 1.6; }
.setting-sub { margin: 8px 0 0; font-size: 13.5px; color: var(--ink-2); }

.add-inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.add-inline .input { width: 240px; }

.setting-list { display: grid; gap: 8px; }
.empty-line { padding: 14px; background: #fafbfd; border-radius: 10px; margin: 0; font-size: 13px; }

.setting-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid var(--line-2);
  border-radius: 11px;
  background: #fdfefe;
}

.drag-order {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: #f2f4f8;
  color: var(--ink-3);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.plat-icon { width: 24px; text-align: center; color: var(--primary); flex: none; }

.color-input {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2px;
  background: #fff;
  cursor: pointer;
  flex: none;
}

.input-inline { max-width: 260px; padding: 7px 10px; font-size: 13.5px; }
.setting-count { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.row-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.member-name { display: grid; gap: 2px; font-size: 13.5px; }
.member-name .muted { font-size: 12px; }

.role-pill {
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #f2f4f8;
  color: var(--ink-2);
}

.role-pill.is-owner { background: #f3edff; color: #6d3fd1; }

.invite-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px dashed #cfd6e2;
  border-radius: 11px;
  background: #fafcff;
}

.invite-box > div { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.invite-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 16px; font-weight: 700; letter-spacing: 2px; color: var(--primary-dark); }

/* ---------------- 历史 ---------------- */

.history-filters { display: flex; gap: 6px; flex-wrap: wrap; }

.mini-chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 12.5px;
  font-family: inherit;
  color: var(--ink-3);
  cursor: pointer;
}

.mini-chip.is-on { background: #eef3ff; border-color: #bcd0ff; color: var(--primary-dark); font-weight: 600; }

.history-list { display: grid; gap: 8px; }

.history-row {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line-2);
  border-radius: 11px;
  background: #fdfefe;
}

.history-time { display: grid; gap: 3px; font-size: 12px; color: var(--ink-2); }
.history-time b { font-weight: 600; }
.history-body { display: grid; gap: 6px; }
.history-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; }
.history-target { color: var(--ink-2); }
.history-note { font-size: 12.5px; color: var(--ink-3); }

.action-pill { font-size: 11.5px; padding: 2px 9px; border-radius: 999px; background: #f2f4f8; color: var(--ink-2); }
.action-pill.tone-green { background: var(--green-bg); color: #0a7a54; }
.action-pill.tone-blue { background: var(--blue-bg); color: var(--primary-dark); }
.action-pill.tone-red { background: #fdeef1; color: #b32238; }
.action-pill.tone-purple { background: #f3edff; color: #6d3fd1; }

.history-changes {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  background: #f7f9fc;
  border-radius: 9px;
  font-size: 12.5px;
}

.change { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.change-label { color: var(--ink-3); min-width: 62px; }
.change-from { color: var(--ink-3); text-decoration: line-through; }
.change-arrow { color: #b8c0cd; }
.change-to { color: var(--ink); font-weight: 600; }

.load-more { justify-self: center; }

/* ---------------- 弹窗 ---------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
  animation: fade .16s ease-out;
}

.modal {
  background: #fff;
  border-radius: 16px;
  width: min(560px, 100%);
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 30px 60px -20px rgba(16, 24, 40, .45);
  animation: pop .18s ease-out;
}

.modal-wide { width: min(760px, 100%); }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.985); } }

.modal-head { padding: 20px 22px 14px; border-bottom: 1px solid var(--line-2); }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-sub { font-size: 12px; color: var(--ink-3); display: block; margin-top: 5px; }
.modal-body { padding: 18px 22px; display: grid; gap: 14px; }
.modal-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--line-2);
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fcfdfe;
  border-radius: 0 0 16px 16px;
}

.confirm-text { margin: 0; line-height: 1.7; color: var(--ink-2); }

.status-picker { display: flex; gap: 8px; flex-wrap: wrap; }

.status-option { cursor: pointer; }
.status-option input { position: absolute; opacity: 0; pointer-events: none; }

.status-option span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-2);
  transition: .16s;
}

.status-option span i { width: 8px; height: 8px; border-radius: 50%; background: #c8cfdb; }
.status-option:hover span { border-color: #cfd6e2; }
.status-option input:checked + span { font-weight: 600; }

.status-option.st-making input:checked + span { background: var(--amber-bg); border-color: #f0d19a; color: #a35f00; }
.status-option.st-making input:checked + span i { background: var(--amber); }
.status-option.st-ready input:checked + span { background: var(--blue-bg); border-color: #bcd0ff; color: var(--primary-dark); }
.status-option.st-ready input:checked + span i { background: var(--blue); }
.status-option.st-done input:checked + span { background: var(--green-bg); border-color: #b0e3cc; color: #0a7a54; }
.status-option.st-done input:checked + span i { background: var(--green); }
.status-option.st-canceled input:checked + span { background: var(--slate-bg); border-color: #dbe2ec; color: #5b6b83; }
.status-option.st-canceled input:checked + span i { background: var(--slate); }

.platform-picker { display: flex; flex-wrap: wrap; gap: 6px; }

.plat-option { cursor: pointer; }
.plat-option input { position: absolute; opacity: 0; pointer-events: none; }

.plat-option span {
  display: inline-block;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-2);
  transition: .16s;
}

.plat-option:hover span { border-color: #cfd6e2; }
.plat-option input:checked + span { background: #eef3ff; border-color: #bcd0ff; color: var(--primary-dark); font-weight: 600; }

/* ---------------- 空状态 / 提示 ---------------- */

.empty {
  background: #fff;
  border: 1px dashed #d7dde8;
  border-radius: var(--radius);
  padding: 60px 24px;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 8px;
}

.empty-art { font-size: 34px; }
.empty h3 { margin: 0; font-size: 17px; }
.empty p { margin: 0 0 10px; color: var(--ink-3); font-size: 13.5px; }

.toast-root {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  display: grid;
  gap: 8px;
  z-index: 70;
  justify-items: center;
  pointer-events: none;
}

.toast {
  background: #16233c;
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: 0 18px 40px -18px rgba(16, 24, 40, .7);
  animation: toastIn .2s ease-out;
  max-width: 80vw;
}

.toast-success { background: #0d7a58; }
.toast-error { background: #b32238; }
.toast.is-out { opacity: 0; transform: translateY(6px); transition: .4s; }

@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

/* ---------------- 响应式 ---------------- */

@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .auth { grid-template-columns: 1fr; }
  .auth-visual { padding: 32px; }
  .auth-visual h2 { font-size: 24px; }
  .cal-grid, .cal-head { min-width: 900px; }
  .calendar { overflow-x: auto; }
  .grid-2 { grid-template-columns: 1fr; }
  .search input { width: 160px; }
  .history-row { grid-template-columns: 1fr; }
}

/* ---------------- 分发平台执行状态（绿色=已执行，红色=未执行） ---------------- */

.dist-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
  transition: background .16s, box-shadow .16s;
}

.dist-dot.is-done {
  background: #0e9f6e;
  box-shadow: 0 0 0 2px rgba(14, 159, 110, .18);
}

.dist-dot.is-todo {
  background: #e5484d;
  box-shadow: 0 0 0 2px rgba(229, 72, 77, .16);
}

.dist-dot.is-muted { background: #c9d1dd; box-shadow: none; }

.plt-dist {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 9px;
  overflow: visible;
  white-space: normal;
  text-overflow: clip;
}

.dist-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 3px;
  border-radius: 5px;
  cursor: pointer;
  transition: background .14s;
}

.dist-item:hover { background: #eef2f8; }

.cell-dist .dist-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.tag-dist {
  border: 0;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  transition: background .14s;
}

.tag-dist:hover { background: #e6ebf3; }

.dist-progress {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-left: 4px;
  white-space: nowrap;
}

.plat-row {
  display: inline-flex;
  align-items: center;
  gap: 1px;
}

.plat-row:not(.is-planned) .plat-option span { opacity: .65; }

.dist-dot-btn {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  transition: background .14s;
}

.dist-dot-btn:hover { background: #eef2f8; }
.dist-dot-btn .dist-dot { width: 11px; height: 11px; }

.dist-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 9px;
  font-size: 12px;
  color: var(--ink-2);
}

.dist-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.dist-legend .dist-all-btn { margin-left: auto; }

/* 日历卡片内的提示文字放宽一点，方便点小圆点 */
.chip-meta .plt-dist { margin-top: 2px; }

/* ---------------- 主发平台的大圆点 ---------------- */

.main-dot {
  display: inline-block;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  flex: none;
  transition: background .16s, box-shadow .16s;
}

.main-dot.is-done {
  background: #0e9f6e;
  box-shadow: 0 0 0 3px rgba(14, 159, 110, .2);
}

.main-dot.is-todo {
  background: #e5484d;
  box-shadow: 0 0 0 3px rgba(229, 72, 77, .18);
}

.main-dot.is-muted { background: #c9d1dd; box-shadow: none; }

.main-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 3px;
  border-radius: 5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .14s;
}

.main-item:hover { background: #eef2f8; }
.main-item.is-disabled { cursor: default; color: var(--ink-3); font-weight: 400; }
.main-item.is-disabled:hover { background: transparent; }

.plt-main { white-space: normal; overflow: visible; text-overflow: clip; }

.main-picker {
  display: flex;
  align-items: center;
  gap: 10px;
}

.main-picker select { flex: 1; min-width: 0; }

.main-dot-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
  transition: border-color .14s, background .14s;
}

.main-dot-btn:hover { border-color: #cfd6e2; background: #fbfcfe; }

.dist-dot-btn {
  gap: 6px;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--ink-2);
  white-space: nowrap;
}

.dist-dot-btn .dist-state { padding-right: 2px; }
.plat-row:not(.is-planned) .dist-dot-btn { color: var(--ink-3); }

/* ---------------- 总表：整行跟随状态上色 ---------------- */

.data-table tbody tr td:first-child { border-left: 3px solid transparent; }

.data-table tbody tr.st-making { background: #fef4e6; }
.data-table tbody tr.st-ready { background: #e9f0ff; }
.data-table tbody tr.st-done { background: #e5f7ef; }
.data-table tbody tr.st-canceled { background: #eff2f7; }

.data-table tbody tr.st-making td:first-child { border-left-color: #e0820a; }
.data-table tbody tr.st-ready td:first-child { border-left-color: #2f6fed; }
.data-table tbody tr.st-done td:first-child { border-left-color: #0e9f6e; }
.data-table tbody tr.st-canceled td:first-child { border-left-color: #8494ab; }

/* 悬停时用描边提示，不改底色，避免盖掉状态颜色 */
.data-table tbody tr:hover { box-shadow: inset 0 0 0 1px rgba(47, 111, 237, .28); }

/* 状态下拉改成实心色块，和卡片颜色呼应 */
.status-select { font-weight: 600; border: 0; }
.status-select.st-making { background: #e0820a; color: #fff; }
.status-select.st-ready { background: #2f6fed; color: #fff; }
.status-select.st-done { background: #0e9f6e; color: #fff; }
.status-select.st-canceled { background: #8494ab; color: #fff; }
