*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #ffffff;
  --bg-subtle: #f7f7f8;
  --bg-hover: #f0f0f2;
  --border: #e8e8ec;
  --primary: #5b6af0;
  --primary-hover: #4a58e0;
  --text: #111118;
  --text-2: #5c5c6e;
  --text-3: #9898a8;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --nav-h: 52px;
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

a { text-decoration: none; color: inherit; }

/* ─────────────────────────────────────────
   LOGIN
───────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--bg-subtle);
}

.login-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 44px 40px;
  width: 380px;
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}

.brand-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.login-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.4px;
  margin-bottom: 6px;
}

.login-desc {
  color: var(--text-2);
  font-size: 13px;
  margin-bottom: 28px;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.15s;
}

.field input:focus {
  border-color: var(--primary);
}

.btn-primary {
  width: 100%;
  padding: 11px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.15s, opacity 0.15s;
}

.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active { opacity: 0.85; }

.error-msg {
  background: #fff2f2;
  color: #c0392b;
  border: 1px solid #fad7d7;
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13px;
  margin-bottom: 16px;
}

/* ─────────────────────────────────────────
   TOP NAV
───────────────────────────────────────── */
.topnav {
  height: var(--nav-h);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 0;
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  z-index: 100;
}

.topnav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.2px;
  margin-right: 32px;
}

.topnav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.topnav-link {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-2);
  font-weight: 500;
  transition: background 0.12s, color 0.12s;
}

.topnav-link:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.topnav-link.active {
  background: var(--bg-hover);
  color: var(--text);
  font-weight: 600;
}

.topnav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.topnav-logout {
  font-size: 13px;
  color: var(--text-3);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  transition: background 0.12s, color 0.12s;
}

.topnav-logout:hover {
  background: var(--bg-hover);
  color: var(--text-2);
}

/* ─────────────────────────────────────────
   PAGE SHELL
───────────────────────────────────────── */
.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 32px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 32px;
}

.page-head h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.page-head p {
  color: var(--text-2);
  font-size: 13px;
  margin-top: 3px;
}

/* ─────────────────────────────────────────
   DASHBOARD — STAT CARDS
───────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 32px;
}

.stat-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  background: var(--bg);
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1;
  margin-bottom: 6px;
}

.stat-change {
  font-size: 12px;
  color: var(--text-3);
}

.stat-change.up { color: #22a06b; }
.stat-change.down { color: #c0392b; }

/* ─────────────────────────────────────────
   DASHBOARD — TWO COLUMN
───────────────────────────────────────── */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
}

/* ─────────────────────────────────────────
   CARD / PANEL
───────────────────────────────────────── */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  overflow: hidden;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.card-head h3 {
  font-size: 14px;
  font-weight: 600;
}

.card-action {
  font-size: 12px;
  color: var(--primary);
  font-weight: 500;
  cursor: pointer;
}

.card-action:hover { text-decoration: underline; }

/* ─────────────────────────────────────────
   TABLE
───────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  padding: 10px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}

tbody td {
  padding: 12px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

tbody tr:last-child td { border-bottom: none; }

tbody tr:hover td { background: var(--bg-subtle); }

/* ─────────────────────────────────────────
   BADGE / TAG
───────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.badge-green  { background: #e6f9f0; color: #1a7a4a; }
.badge-blue   { background: #eef2ff; color: #3a4fd4; }
.badge-orange { background: #fff4e6; color: #b85c00; }
.badge-gray   { background: var(--bg-subtle); color: var(--text-2); }
.badge-red    { background: #fff0f0; color: #c0392b; }

/* ─────────────────────────────────────────
   ACTIVITY LIST
───────────────────────────────────────── */
.activity-list {
  padding: 8px 0;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}

.activity-item:last-child { border-bottom: none; }

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}

.dot-blue   { background: var(--primary); }
.dot-green  { background: #22a06b; }
.dot-orange { background: #e07b00; }
.dot-gray   { background: var(--text-3); }

.activity-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
}

.activity-time {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}

/* ─────────────────────────────────────────
   PROGRESS BAR
───────────────────────────────────────── */
.progress-list { padding: 16px 20px; display: flex; flex-direction: column; gap: 16px; }

.progress-item {}

.progress-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 13px;
}

.progress-name { font-weight: 500; }
.progress-pct  { color: var(--text-2); font-size: 12px; }

.progress-bar {
  height: 6px;
  background: var(--bg-subtle);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--primary);
}

.progress-fill.green  { background: #22a06b; }
.progress-fill.orange { background: #e07b00; }

/* ─────────────────────────────────────────
   EMPTY STATE
───────────────────────────────────────── */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  color: var(--text-3);
  gap: 10px;
}

.empty-icon { font-size: 40px; }
.empty p    { font-size: 14px; }

/* ─────────────────────────────────────────
   NAV PAGE
───────────────────────────────────────── */
.btn-add {
  padding: 8px 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-add:hover { background: var(--primary-hover); }

.nav-section {
  margin-bottom: 36px;
}

.nav-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.nav-section-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.section-name {
  font-size: 15px;
  font-weight: 700;
}

.section-desc {
  font-size: 12px;
  color: var(--text-3);
}

.nav-section-actions {
  display: flex;
  gap: 6px;
}

.btn-text {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: none;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.btn-text:hover { background: var(--bg-hover); color: var(--text); }
.btn-text.danger { color: #c0392b; border-color: #fad7d7; }
.btn-text.danger:hover { background: #fff0f0; }

.nav-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  transition: background 0.12s;
  position: relative;
}
.nav-card:hover { background: var(--bg-subtle); }
.nav-card:hover .nav-card-ops { opacity: 1; }

.nav-card-favicon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}
.nav-card-favicon img {
  width: 20px;
  height: 20px;
  border-radius: 4px;
}

.nav-card-info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.nav-card-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.12s;
}
.nav-card-name:hover { color: var(--primary); }

.nav-card-desc {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-card-ops {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.12s;
}

.btn-icon {
  width: 26px;
  height: 26px;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-3);
  display: grid;
  place-items: center;
  transition: background 0.12s, color 0.12s;
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text); }
.btn-icon.danger:hover { background: #fff0f0; color: #c0392b; }

.nav-empty {
  font-size: 13px;
  color: var(--text-3);
  padding: 10px 14px;
}

/* ─────────────────────────────────────────
   MODAL
───────────────────────────────────────── */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.modal {
  background: var(--bg);
  border-radius: var(--radius-lg);
  width: 420px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

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

.modal-close {
  border: none;
  background: none;
  font-size: 16px;
  color: var(--text-3);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.modal-close:hover { background: var(--bg-hover); color: var(--text); }

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal-body .field { margin-bottom: 12px; }

.modal-body input,
.modal-body select {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.15s;
}
.modal-body input:focus,
.modal-body select:focus { border-color: var(--primary); }

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

.btn-cancel {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: none;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-2);
}
.btn-cancel:hover { background: var(--bg-hover); }

.btn-confirm {
  padding: 8px 18px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-confirm:hover { background: var(--primary-hover); }

/* ─────────────────────────────────────────
   TOAST
───────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  animation: fadeup 0.2s ease;
  pointer-events: none;
}
.toast-ok  { background: #1a1a2e; color: #fff; }
.toast-err { background: #c0392b; color: #fff; }

@keyframes fadeup {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ─────────────────────────────────────────
   NAV TILE GRID (5列)
───────────────────────────────────────── */
.nav-card-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 8px;
}

.nav-tile {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  transition: box-shadow 0.15s, border-color 0.15s;
  background: var(--bg);
  min-width: 0;
}

.nav-tile:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 12px rgba(91,106,240,0.1);
}

.nav-tile:hover .nav-tile-ops { opacity: 1; }

.nav-tile-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.nav-tile-icon img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
}

.nav-tile-info {
  flex: 1;
  min-width: 0;
}

.nav-tile-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
  line-height: 1.4;
  transition: color 0.12s;
}

.nav-tile-name:hover { color: var(--primary); }

.nav-tile-desc {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 3px;
  word-break: break-word;
  line-height: 1.4;
}

.nav-tile-ops {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.12s;
}

/* ─────────────────────────────────────────
   KANBAN (想法页)
───────────────────────────────────────── */
.kanban {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  align-items: start;
}

.kanban-col {
  border-radius: var(--radius);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  overflow: hidden;
}

.kanban-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.kanban-label {
  font-size: 13px;
  font-weight: 600;
}

.kanban-count {
  font-size: 11px;
  background: var(--border);
  color: var(--text-2);
  padding: 1px 7px;
  border-radius: 20px;
  font-weight: 600;
}

.col-todo   .kanban-label { color: var(--text-2); }
.col-doing  .kanban-label { color: #3a4fd4; }
.col-done   .kanban-label { color: #1a7a4a; }
.col-drop   .kanban-label { color: var(--text-3); }

.col-doing  { border-top: 2px solid #5b6af0; }
.col-done   { border-top: 2px solid #22a06b; }
.col-drop   { border-top: 2px solid var(--border); }
.col-todo   { border-top: 2px solid #e07b00; }

.kanban-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 80px;
}

.kanban-empty {
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
  padding: 20px 0;
}

.idea-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  transition: box-shadow 0.12s;
}

.idea-card:hover { box-shadow: var(--shadow-sm); }
.idea-card:hover .idea-card-ops { opacity: 1; }

.idea-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.idea-card-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  flex: 1;
}

.idea-card-ops {
  display: flex;
  gap: 2px;
  opacity: 0;
  flex-shrink: 0;
  transition: opacity 0.12s;
}

.idea-card-desc {
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 8px;
  line-height: 1.4;
}

.idea-card-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.idea-cat-tag {
  font-size: 11px;
  color: var(--text-3);
  background: var(--bg-subtle);
  padding: 1px 7px;
  border-radius: 20px;
}

.idea-status-btns {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.btn-status {
  font-size: 11px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: none;
  color: var(--text-3);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

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

/* 分类管理列表 */
.modal-wide { width: 560px; }

.cat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.cat-row:last-child { border-bottom: none; }

.cat-row-info { display: flex; align-items: baseline; gap: 10px; }
.cat-row-name { font-size: 14px; font-weight: 500; }
.cat-row-desc { font-size: 12px; color: var(--text-3); }
.cat-row-ops  { display: flex; gap: 6px; }

/* btn-outline */
.btn-outline {
  background: none;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: #eef2ff; }

/* ─────────────────────────────────────────
   USER MENU
───────────────────────────────────────── */
.topnav-right {
  position: relative;
}

.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 130px;
  overflow: hidden;
  z-index: 200;
}

.user-menu-item {
  display: block;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s;
  text-decoration: none;
}

.user-menu-item:hover { background: var(--bg-hover); }

/* ─────────────────────────────────────────
   PROFILE MODAL
───────────────────────────────────────── */
.profile-avatar-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 4px;
}

.profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.profile-name-display {
  font-size: 16px;
  font-weight: 600;
}

.profile-accout {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}

.profile-divider {
  border-top: 1px solid var(--border);
  margin: 16px 0 12px;
  position: relative;
}

.profile-divider span {
  position: absolute;
  top: -9px;
  left: 0;
  background: var(--bg);
  padding-right: 10px;
  font-size: 11px;
  color: var(--text-3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ─────────────────────────────────────────
   IDEAS — 状态筛选 tabs
───────────────────────────────────────── */
.status-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
}

.status-tab {
  padding: 6px 16px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s;
}

.status-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.status-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* 全铺展示区 */
.idea-flat {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  align-items: start;
}

/* 拖拽手柄 */
.drag-handle {
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  font-size: 14px;
  cursor: grab;
  opacity: 0;
  transition: opacity 0.12s;
  user-select: none;
}

.idea-card {
  position: relative;
  padding-left: 22px;
}

.idea-card:hover .drag-handle { opacity: 1; }

.idea-card.dragging {
  opacity: 0.4;
  border: 2px dashed var(--primary);
}

.kanban-body.drag-over {
  background: #eef2ff;
}

/* ─────────────────────────────────────────
   NAV — 左侧定位侧边栏
───────────────────────────────────────── */
.nav-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.nav-sidebar {
  width: 140px;
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--nav-h) + 16px);
  max-height: calc(100vh - var(--nav-h) - 40px);
  overflow-y: auto;
  padding: 4px 0;
}

.nav-sidebar-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 0 10px 10px;
}

.nav-sidebar-item {
  display: block;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--text-2);
  border-radius: var(--radius-sm);
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
}

.nav-sidebar-item:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.nav-sidebar-item.active {
  background: #eef2ff;
  color: var(--primary);
  font-weight: 600;
}

.nav-content {
  flex: 1;
  min-width: 0;
}

/* ─────────────────────────────────────────
   IDEAS — 分类筛选栏
───────────────────────────────────────── */
.cat-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.cat-filter-btn {
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: none;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.12s;
}

.cat-filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.cat-filter-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ─────────────────────────────────────────
   PLAN PAGE
───────────────────────────────────────── */
.plan-group {
  margin-bottom: 28px;
}

.plan-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.plan-group-label {
  font-size: 14px;
  font-weight: 700;
}

.plan-group-count {
  font-size: 11px;
  background: var(--bg-subtle);
  color: var(--text-2);
  padding: 1px 8px;
  border-radius: 20px;
  font-weight: 600;
}

.plan-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  transition: box-shadow 0.12s;
  gap: 16px;
}

.plan-row:hover { box-shadow: var(--shadow-sm); }

.plan-row-left { flex: 1; min-width: 0; }

.plan-row-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 3px;
}

.plan-row-desc {
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 5px;
}

.plan-row-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.plan-date {
  font-size: 12px;
  color: var(--text-3);
}

.plan-owner {
  font-size: 11px;
  background: var(--bg-subtle);
  color: var(--text-2);
  padding: 1px 8px;
  border-radius: 20px;
}

.plan-row-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.plan-row-ops {
  display: flex;
  align-items: center;
  gap: 6px;
}

.plan-empty {
  font-size: 13px;
  color: var(--text-3);
  padding: 20px 0;
  text-align: center;
}

/* 天数 badge */
.days-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.days-badge.ongoing  { background: #e6f9f0; color: #1a7a4a; }
.days-badge.today    { background: #fff4e6; color: #b85c00; }
.days-badge.overdue  { background: #fff0f0; color: #c0392b; }
.days-badge.upcoming { background: #eef2ff; color: #3a4fd4; }

/* 状态下拉 */
.status-dropdown {
  position: relative;
}

.dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 100px;
  z-index: 100;
  overflow: hidden;
}

.dropdown-item {
  padding: 9px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.12s;
}

.dropdown-item:hover { background: var(--bg-hover); }

/* 日期并排 */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ─────────────────────────────────────────
   DASHBOARD — 想法分布
───────────────────────────────────────── */
.idea-stat-list {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.idea-stat-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.idea-stat-row .badge {
  width: 52px;
  justify-content: center;
  flex-shrink: 0;
}

.idea-stat-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--bg-subtle);
  border-radius: 99px;
  overflow: hidden;
}

.idea-stat-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 99px;
  transition: width 0.4s ease;
  min-width: 2px;
}

.idea-stat-num {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  width: 28px;
  text-align: right;
  flex-shrink: 0;
}

/* ─────────────────────────────────────────
   EMAIL TEST PAGE
───────────────────────────────────────── */
.email-test-wrap {
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.email-test-card .email-test-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field-tip {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 400;
}

.input-with-tag {
  position: relative;
}

.input-with-tag input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.15s;
}

.input-with-tag input:focus { border-color: var(--primary); }

.input-tag {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  background: #eef2ff;
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
  pointer-events: none;
}

.email-preview-tip {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.tip-icon { font-size: 20px; flex-shrink: 0; }

.tip-content { font-size: 13px; color: var(--text); line-height: 1.5; }

.btn-send {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  margin-top: 4px;
}

.btn-send:hover:not(:disabled) { background: var(--primary-hover); }
.btn-send:disabled { opacity: 0.45; cursor: not-allowed; }

.send-result {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 1px solid;
}

.result-ok  { background: #e6f9f0; border-color: #b7ecd4; }
.result-err { background: #fff0f0; border-color: #fad7d7; }

.result-icon { font-size: 20px; flex-shrink: 0; }

.result-msg {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.result-sub {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 3px;
}

.config-card .config-body {
  padding: 16px 20px;
}

.config-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.config-row:last-of-type { border-bottom: none; }

.config-key { color: var(--text-2); }
.config-val { font-weight: 500; }

.config-tip {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 12px;
  line-height: 1.6;
}

.config-tip code {
  background: var(--bg-subtle);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 12px;
}

/* ═════════════════════════════════════════
   RESPONSIVE — 移动端适配
   断点：
   ≤768px  手机竖屏
   ≤1024px 平板 / 手机横屏
═════════════════════════════════════════ */

/* ── 汉堡按钮（默认隐藏） ── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.nav-hamburger:hover { background: var(--bg-hover); }
.nav-hamburger span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.2s;
}

/* 移动端抽屉导航 */
.mobile-nav-drawer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
}
.mobile-nav-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
}
.mobile-nav-panel {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 260px;
  background: var(--bg);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow-y: auto;
}
.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.mobile-nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 16px;
}
.mobile-nav-close {
  border: none;
  background: none;
  font-size: 20px;
  color: var(--text-3);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}
.mobile-nav-close:hover { background: var(--bg-hover); }
.mobile-nav-links {
  flex: 1;
  padding: 12px 0;
}
.mobile-nav-link {
  display: flex;
  align-items: center;
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
  gap: 10px;
}
.mobile-nav-link:hover,
.mobile-nav-link.active { background: var(--bg-hover); color: var(--text); }
.mobile-nav-link.active { font-weight: 700; color: var(--primary); }
.mobile-nav-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mobile-nav-footer a,
.mobile-nav-footer div {
  display: block;
  padding: 10px 0;
  font-size: 14px;
  color: var(--text-2);
  cursor: pointer;
  text-decoration: none;
}
.mobile-nav-footer a:hover,
.mobile-nav-footer div:hover { color: var(--text); }

/* ── 平板（≤1024px） ── */
@media (max-width: 1024px) {
  .page { padding: 28px 20px; }

  .stat-grid { grid-template-columns: repeat(2, 1fr); }

  .dash-grid { grid-template-columns: 1fr; }

  .nav-card-grid { grid-template-columns: repeat(3, 1fr); }

  .kanban { grid-template-columns: repeat(2, 1fr); }
  .idea-flat { grid-template-columns: repeat(3, 1fr); }

  .nav-sidebar { display: none; }
  .nav-layout  { display: block; }
  .nav-content { width: 100%; }

  .plan-row { flex-wrap: wrap; gap: 10px; }
  .plan-row-right { width: 100%; justify-content: flex-start; }
}

/* ── 手机（≤768px） ── */
@media (max-width: 768px) {

  /* 导航栏 */
  .topnav { padding: 0 16px; }
  .topnav-links { display: none; }          /* 隐藏桌面导航链接 */
  .topnav-logout { display: none; }
  .nav-hamburger { display: flex; }         /* 显示汉堡按钮 */
  .topnav-brand { margin-right: auto; }

  /* 页面内边距 */
  .page { padding: 20px 16px; }

  /* 页头 */
  .page-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
  }
  .page-head h1 { font-size: 20px; }

  /* 统计卡片 */
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-value { font-size: 22px; }

  /* Dashboard 双列 → 单列 */
  .dash-grid { grid-template-columns: 1fr; }

  /* 表格横向滚动 */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 480px; }

  /* 导航 tile 3列 → 2列 */
  .nav-card-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .nav-tile { padding: 10px; }
  .nav-tile-ops { opacity: 1; }   /* 移动端常显操作按钮 */

  /* 导航侧边栏隐藏 */
  .nav-sidebar { display: none; }
  .nav-layout  { display: block; }

  /* 导航分区头部 */
  .nav-section-head { flex-wrap: wrap; gap: 8px; }
  .nav-section-actions { flex-wrap: wrap; }

  /* 看板 4列 → 1列（tab 切换） */
  .kanban { grid-template-columns: 1fr; gap: 12px; }
  .idea-flat { grid-template-columns: repeat(2, 1fr); }

  /* 想法卡片操作按钮常显 */
  .idea-card-ops { opacity: 1; }
  .drag-handle   { display: none; }

  /* 状态 tabs 横向滚动 */
  .status-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .status-tabs::-webkit-scrollbar { display: none; }
  .status-tab { white-space: nowrap; flex-shrink: 0; }

  /* 分类筛选横向滚动 */
  .cat-filter-bar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .cat-filter-bar::-webkit-scrollbar { display: none; }
  .cat-filter-btn { white-space: nowrap; flex-shrink: 0; }

  /* 计划行 */
  .plan-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .plan-row-right { width: 100%; flex-wrap: wrap; }
  .plan-row-meta  { flex-wrap: wrap; gap: 6px; }

  /* 弹窗全屏 */
  .modal-mask { align-items: flex-end; }
  .modal {
    width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 90vh;
    overflow-y: auto;
  }
  .modal-wide { width: 100%; }

  /* 日期并排 → 单列 */
  .field-row { grid-template-columns: 1fr; }

  /* 邮件测试 */
  .email-test-wrap { max-width: 100%; }

  /* 登录卡片 */
  .login-card {
    width: calc(100vw - 32px);
    padding: 32px 24px;
    border-radius: var(--radius-lg);
  }

  /* 个人信息弹窗 */
  .profile-avatar-row { flex-direction: column; align-items: flex-start; }

  /* Toast 底部安全区 */
  .toast { bottom: calc(20px + env(safe-area-inset-bottom)); }
}

/* ── 超小屏（≤400px） ── */
@media (max-width: 400px) {
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-value { font-size: 20px; }
  .nav-card-grid { grid-template-columns: repeat(2, 1fr); }
  .page { padding: 16px 12px; }
}
