:root {
  --primary: #f9ab00;
  --primary-dark: #e37400;
  --primary-light: #fde293;
  --primary-soft: #fff8e1;
  --accent: #fbbc04;
  --bg: #f8f9fa;
  --surface: #ffffff;
  --sidebar: #202124;
  --sidebar-hover: #2d2e31;
  --sidebar-active: #3c4043;
  --text: #202124;
  --text-secondary: #5f6368;
  --border: #dadce0;
  --danger: #d93025;
  --success: #188038;
  --shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
  --shadow-sm: 0 1px 2px rgba(60, 64, 67, 0.2);
  --radius: 8px;
  --sidebar-width: 256px;
  --sidebar-collapsed-width: 72px;
  --font: "Google Sans", "Product Sans", "Noto Sans SC", "Roboto", "PingFang SC",
    "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

/* ---------- Login ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(249, 171, 0, 0.25), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(251, 188, 4, 0.2), transparent 35%),
    linear-gradient(160deg, #fff8e1 0%, #f8f9fa 45%, #ffffff 100%);
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 40px 36px 32px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
  background: #ffffff;
  padding: 3px;
  box-sizing: border-box;
}

.brand-logo-lg {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  padding: 4px;
}

.login-brand h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 500;
}

.login-brand p {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.form-control {
  width: 100%;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 14px;
  font-size: 15px;
  outline: none;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(249, 171, 0, 0.25);
}

/* 未选择时显示「请选择」占位样式 */
select.form-control.select-optional:has(option[value=""]:checked) {
  color: var(--text-secondary);
}

select.form-control.select-optional option {
  color: var(--text);
}

select.form-control.select-optional option[value=""] {
  color: var(--text-secondary);
}

textarea.form-control {
  height: auto;
  min-height: 96px;
  padding: 12px 14px;
  resize: vertical;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, opacity 0.15s;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: #202124;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent);
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: #f1f3f4;
}

.btn-danger {
  background: #fce8e6;
  color: var(--danger);
}

.btn-danger:hover:not(:disabled) {
  background: #fad2cf;
}

.btn-text {
  background: transparent;
  color: var(--primary-dark);
}

.btn-text:hover:not(:disabled) {
  background: var(--primary-soft);
}

.btn-block {
  width: 100%;
  height: 44px;
  border-radius: 8px;
}

.alert {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}

.alert-error {
  background: #fce8e6;
  color: var(--danger);
}

.alert-success {
  background: #e6f4ea;
  color: var(--success);
}

/* ---------- Layout ---------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar);
  color: #e8eaed;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  transition: width 0.2s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 84px;
}

.sidebar-brand .brand-logo {
  width: 40px;
  height: 40px;
  background: #ffffff;
  border-radius: 10px;
  object-fit: contain;
  padding: 3px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.sidebar-brand-text {
  flex: 1;
  min-width: 0;
}

.sidebar-brand h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
}

.sidebar-brand-text span {
  display: block;
  font-size: 12px;
  color: #9aa0a6;
  margin-top: 2px;
}

.sidebar-toggle {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #e8eaed;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.2s;
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.16);
}

.sidebar-toggle-icon {
  font-size: 22px;
  line-height: 1;
  font-weight: 600;
}

.sidebar-nav {
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 24px;
  color: #e8eaed;
  font-size: 14px;
  transition: background 0.15s;
}

.nav-item:hover {
  background: var(--sidebar-hover);
}

.nav-item.active {
  background: var(--primary);
  color: #202124;
  font-weight: 500;
}

.nav-icon {
  width: 20px;
  text-align: center;
  opacity: 0.9;
  flex-shrink: 0;
}

.nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  color: #9aa0a6;
  position: relative;
}

.user-menu {
  position: relative;
}

.user-menu-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: #e8eaed;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.user-menu-trigger:hover,
.user-menu.open .user-menu-trigger {
  background: rgba(255, 255, 255, 0.08);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #202124;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  flex-shrink: 0;
}

.user-menu-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-menu-name {
  font-size: 14px;
  color: #e8eaed;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-hint {
  font-size: 12px;
  color: #9aa0a6;
}

.user-menu-caret {
  font-size: 12px;
  color: #9aa0a6;
  flex-shrink: 0;
}

.user-menu-dropdown {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  background: #2d2e31;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 30;
}

.user-menu.open .user-menu-dropdown {
  display: block;
}

.user-menu-item {
  width: 100%;
  display: block;
  border: none;
  background: transparent;
  color: #e8eaed;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}

.user-menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.user-menu-item.danger {
  color: #f28b82;
}

.main {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  transition: margin-left 0.2s ease;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* 窄菜单模式 */
html.sidebar-collapsed {
  --sidebar-width: var(--sidebar-collapsed-width);
}

html.sidebar-collapsed .sidebar-brand {
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 16px 8px;
}

html.sidebar-collapsed .sidebar-brand-text,
html.sidebar-collapsed .nav-label,
html.sidebar-collapsed .user-menu-meta,
html.sidebar-collapsed .user-menu-caret {
  display: none;
}

html.sidebar-collapsed .sidebar-toggle-icon {
  transform: rotate(180deg);
  display: inline-block;
}

html.sidebar-collapsed .nav-item {
  justify-content: center;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  margin: 0 auto;
  padding: 0;
}

html.sidebar-collapsed .user-menu-trigger {
  justify-content: center;
  padding: 8px;
}

html.sidebar-collapsed .user-menu-dropdown {
  left: calc(100% + 8px);
  right: auto;
  bottom: 0;
  width: 160px;
}

.topbar {
  height: 64px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
}

.content {
  padding: 24px 28px 40px;
}

/* ---------- Cards / Panels ---------- */
.panel {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.panel-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
}

.panel-body {
  padding: 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.overview-section {
  margin-top: 20px;
}

.overview-footer {
  margin-top: 28px;
  padding: 16px 4px 4px;
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.overview-footer-sep {
  margin: 0 8px;
  color: #c0c4c8;
}

.stat-card {
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
}

.stat-label {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 10px;
}

.stat-value {
  font-size: 36px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.5px;
}

.stat-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ---------- Filters / Forms ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.field-label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

/* ---------- Table ---------- */
.table-wrap {
  overflow: auto;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table.data-table th,
table.data-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

table.data-table th {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 13px;
  background: #fafafa;
  white-space: nowrap;
}

table.data-table tr:hover td {
  background: #fffbf0;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 16px;
  background: var(--primary-soft);
  color: #7a4f01;
  font-size: 12px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip .remove {
  border: none;
  background: transparent;
  cursor: pointer;
  color: #7a4f01;
  font-size: 14px;
  line-height: 1;
  padding: 0 0 0 2px;
}

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-secondary);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 4px 0;
  flex-wrap: wrap;
}

.pagination-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.pagination-info,
.pagination-status {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.pagination-size,
.pagination-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.pagination-select {
  width: 72px;
  height: 32px;
  padding: 0 8px;
}

.pagination-jump-input {
  width: 64px;
  height: 32px;
  padding: 0 8px;
  text-align: center;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pagination-controls .btn {
  height: 32px;
  padding: 0 12px;
  border-radius: 16px;
}

/* ---------- Multi select ---------- */
.ms-wrap {
  position: relative;
}

.ms-control {
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 10px 0 8px;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  background: #fff;
  overflow: hidden;
}

.ms-control.open,
.ms-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(249, 171, 0, 0.25);
  outline: none;
}

.ms-chips {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  height: 100%;
}

.ms-chips::-webkit-scrollbar {
  height: 4px;
}

.ms-chips::-webkit-scrollbar-thumb {
  background: #dadce0;
  border-radius: 4px;
}

.ms-placeholder {
  color: #9aa0a6;
  font-size: 14px;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ms-caret {
  color: var(--text-secondary);
  font-size: 12px;
  flex-shrink: 0;
}

.ms-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 4px 0 10px;
  border-radius: 14px;
  background: var(--primary-soft);
  color: #7a4f01;
  font-size: 12px;
  flex: 0 0 auto;
  max-width: 180px;
}

.ms-chip-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.ms-chip .remove {
  border: none;
  background: transparent;
  cursor: pointer;
  color: #7a4f01;
  font-size: 16px;
  line-height: 1;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.ms-chip .remove:hover {
  background: rgba(122, 79, 1, 0.12);
}

.ms-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 40;
  display: none;
  overflow: hidden;
}

.ms-dropdown.open {
  display: flex;
  flex-direction: column;
  max-height: 320px;
}

.ms-search-wrap {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.ms-search {
  width: 100%;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 12px;
  font-size: 14px;
  outline: none;
}

.ms-search:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(249, 171, 0, 0.2);
}

.ms-options {
  overflow: auto;
  max-height: 240px;
}

.ms-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 14px;
  margin: 0;
}

.ms-option:hover {
  background: var(--primary-soft);
}

.ms-option.selected {
  background: #fff8e1;
}

.ms-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary-dark);
  flex-shrink: 0;
  cursor: pointer;
}

.ms-option-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.ms-empty {
  padding: 16px 12px;
  color: var(--text-secondary);
  font-size: 13px;
  text-align: center;
}

.ms-wrap-inline {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ms-dropdown-inline {
  position: static;
  display: flex;
  flex-direction: column;
  max-height: min(420px, calc(100vh - 260px));
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: none;
  z-index: auto;
}

.ms-dropdown-inline.open {
  display: flex;
  max-height: min(420px, calc(100vh - 260px));
}

.ms-dropdown-inline .ms-options {
  max-height: none;
  flex: 1;
  min-height: 200px;
}

.modal-select .modal-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.modal-select #eActivities {
  flex: 1;
  min-height: 0;
}

/* ---------- Modal ---------- */
body.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(32, 33, 36, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  overflow: hidden;
  overscroll-behavior: contain;
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  width: 100%;
  max-width: 640px;
  max-height: calc(100vh - 40px);
  overflow: hidden;
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.modal-select {
  max-width: 720px;
  height: min(720px, calc(100vh - 40px));
}

.modal-select .modal-body {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-lg {
  max-width: 760px;
}

.modal-preview {
  width: min(1100px, calc(100vw - 40px));
  max-width: none;
  height: min(860px, calc(100vh - 40px));
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  height: min(860px, calc(100dvh - 40px));
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: #fff;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
}

.modal-close {
  border: none;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
}

.modal-close:hover {
  background: #f1f3f4;
}

.modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 22px;
  -webkit-overflow-scrolling: touch;
}

.modal-body.archive-preview-body {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 12px;
  flex: 1 1 auto;
  min-height: 0;
}

.archive-preview-body .follow-hint {
  flex-shrink: 0;
  margin-bottom: 0;
}

.archive-preview-body iframe {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.modal-footer {
  padding: 14px 22px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  background: #fff;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.compare-table th,
.compare-table td {
  vertical-align: top;
  word-break: break-all;
}

.compare-table .diff {
  background: #fff8e1;
  color: #7a4f01;
}

.compare-table .merge-edit {
  width: 100%;
  min-width: 120px;
  height: 34px;
  padding: 0 10px;
}

.compare-table textarea.merge-edit {
  height: auto;
  min-height: 64px;
  padding: 8px 10px;
}

.existing-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.existing-pick label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}

.existing-pick label.active {
  border-color: var(--primary);
  background: var(--primary-soft);
}

/* ---------- Detail ---------- */
.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.detail-title {
  margin: 0;
  font-size: 28px;
  font-weight: 500;
}

.detail-sub {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

.section-card .section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.section-card .section-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
}

.section-card .section-body {
  padding: 20px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px 20px;
}

.info-grid .full-row {
  grid-column: 1 / -1;
}

/* ---------- Follow form ---------- */
.follow-intro {
  margin: 0 0 20px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.follow-section {
  margin-bottom: 24px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.follow-section h3 {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 500;
}

.follow-section h4 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 500;
}

.follow-q {
  margin-bottom: 18px;
}

.follow-hint {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.checkbox-list label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  line-height: 1.45;
  cursor: pointer;
}

.checkbox-list input {
  margin-top: 3px;
  accent-color: var(--primary-dark);
  flex-shrink: 0;
}

.follow-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 8px;
}

.info-item .label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.info-item .value {
  font-size: 15px;
  word-break: break-all;
}

.notes-box {
  white-space: pre-wrap;
  line-height: 1.6;
  min-height: 48px;
  color: var(--text);
}

.toast-wrap {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  min-width: 240px;
  max-width: 360px;
  background: #323232;
  color: #fff;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: var(--shadow);
  animation: slideIn 0.2s ease;
  pointer-events: auto;
  cursor: default;
  outline: none;
}

.toast:focus-visible {
  box-shadow: var(--shadow), 0 0 0 3px rgba(249, 171, 0, 0.55);
}

.toast.success {
  background: #188038;
}

.toast.error {
  background: #d93025;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1100px) {
  .filter-grid,
  .info-grid,
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.import-tips {
  background: var(--primary-soft);
  border: 1px solid rgba(249, 171, 0, 0.35);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.import-tips p {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.import-tips p:last-child {
  margin-bottom: 0;
}

.import-template-row {
  margin-bottom: 14px;
}

.import-dropzone {
  border: 1.5px dashed var(--border);
  border-radius: 12px;
  background: #fafafa;
  padding: 28px 20px;
  text-align: center;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  outline: none;
}

.import-dropzone:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.import-dropzone:focus-visible {
  outline: 2px solid rgba(249, 171, 0, 0.45);
  outline-offset: 2px;
}

.import-dropzone.dragover {
  border-color: var(--primary-dark);
  background: var(--primary-soft);
  box-shadow: 0 0 0 3px rgba(249, 171, 0, 0.2);
}

.import-dropzone-title {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 6px;
}

.import-dropzone-hint {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

@media (max-width: 860px) {
  .content {
    padding: 16px;
  }

  .form-grid,
  .filter-grid,
  .info-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    padding: 0 16px;
  }
}
