/* ========================================
   小红书博主合作管理系统 - Apple 风格样式
   ======================================== */

:root {
  --blue: #007AFF;
  --blue-hover: #0062CC;
  --blue-light: rgba(0,122,255,0.08);
  --red: #FF3B30;
  --red-hover: #D63028;
  --orange: #FF9500;
  --green: #34C759;
  --teal: #5AC8FA;
  --purple: #AF52DE;
  --gray-50: #FAFAFA;
  --gray-100: #F5F5F7;
  --gray-200: #E8E8ED;
  --gray-300: #D1D1D6;
  --gray-400: #AEAEB2;
  --gray-500: #8E8E93;
  --gray-600: #636366;
  --gray-700: #48484A;
  --gray-800: #3A3A3C;
  --gray-900: #1D1D1F;
  --white: #FFFFFF;
  --sidebar-w: 240px;
  --header-h: 56px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
  --transition: 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--gray-100);
  color: var(--gray-900);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  min-height: 100vh;
}

/* ========== LOGIN ========== */
.login-overlay {
  position: fixed; inset: 0;
  background: var(--gray-100);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.login-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  width: 400px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.login-logo {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, #FF2D55, #FF3B30);
  border-radius: 14px;
  margin: 0 auto 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: #fff;
}
.login-card h1 {
  font-size: 24px; font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -0.3px;
}
.login-card .subtitle {
  font-size: 14px; color: var(--gray-500);
  margin-bottom: 28px;
}
.login-card .form-group {
  margin-bottom: 16px;
  text-align: left;
}
.login-card label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--gray-700); margin-bottom: 6px;
}
.login-card input {
  width: 100%; height: 44px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  padding: 0 14px; font-size: 15px;
  outline: none; transition: var(--transition);
  background: var(--gray-50);
  color: var(--gray-900);
}
.login-card input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,122,255,0.12);
  background: var(--white);
}
.login-card .btn-login {
  width: 100%; height: 44px;
  background: var(--blue);
  color: #fff; border: none;
  border-radius: var(--radius-sm);
  font-size: 16px; font-weight: 600;
  cursor: pointer; transition: var(--transition);
  margin-top: 8px;
}
.login-card .btn-login:hover { background: var(--blue-hover); }
.login-card .login-error {
  color: var(--red); font-size: 13px;
  margin-top: 12px; min-height: 18px;
}

/* ========== LAYOUT ========== */
.app-layout { display: none; height: 100vh; }
.app-layout.active { display: flex; }

/* ---- SIDEBAR ---- */
.sidebar {
  width: var(--sidebar-w);
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid rgba(0,0,0,0.06);
  display: flex; flex-direction: column;
  flex-shrink: 0;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 100;
}
.sidebar-header {
  padding: 20px 20px 16px;
  display: flex; align-items: center; gap: 10px;
}
.sidebar-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, #FF2D55, #FF3B30);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #fff; flex-shrink: 0;
}
.sidebar-title {
  font-size: 15px; font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--gray-900);
}
.sidebar-nav {
  flex: 1; padding: 4px 12px;
  display: flex; flex-direction: column; gap: 2px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  transition: var(--transition);
  border: none; background: none;
  width: 100%; text-align: left;
}
.nav-item:hover { background: var(--gray-200); color: var(--gray-900); }
.nav-item.active {
  background: var(--blue-light);
  color: var(--blue);
  font-weight: 600;
}
.nav-icon { font-size: 18px; width: 22px; text-align: center; flex-shrink: 0; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--gray-200);
}
.user-info {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
}
.user-avatar {
  width: 32px; height: 32px;
  background: var(--gray-300);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--gray-600); font-weight: 600;
}
.user-detail { font-size: 13px; }
.user-name { font-weight: 600; color: var(--gray-900); }
.user-role { color: var(--gray-500); font-size: 11px; }
.btn-logout {
  width: 100%; height: 34px;
  border: none; background: var(--gray-100);
  border-radius: var(--radius-sm); margin-top: 8px;
  font-size: 13px; color: var(--gray-600); cursor: pointer;
  transition: var(--transition);
}
.btn-logout:hover { background: var(--gray-200); color: var(--red); }

/* ---- MAIN ---- */
.main-content {
  flex: 1; margin-left: var(--sidebar-w);
  display: flex; flex-direction: column;
  min-height: 100vh;
}
.page-header {
  padding: 24px 32px 16px;
  position: sticky; top: 0;
  background: var(--gray-100);
  z-index: 50;
}
.page-header h2 {
  font-size: 28px; font-weight: 700;
  letter-spacing: -0.5px;
}
.page-header .page-desc {
  font-size: 14px; color: var(--gray-500);
  margin-top: 4px;
}
.page-body {
  flex: 1; padding: 0 32px 32px;
  overflow-y: auto; overflow-x: hidden;
  min-width: 0;
}

/* ---- PANELS ---- */
.panel { display: none; }
.panel.active { display: block; }

/* ========== TOOLBAR ========== */
.toolbar {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 0;
  flex-wrap: wrap;
}
.toolbar-spacer { flex: 1; }
.toolbar .search-box {
  position: relative; flex: 1; min-width: 200px; max-width: 320px;
}
.toolbar .search-box input {
  width: 100%; height: 36px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  padding: 0 14px 0 36px;
  font-size: 14px; outline: none;
  background: var(--white);
  transition: var(--transition);
}
.toolbar .search-box input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,122,255,0.1);
}
.toolbar .search-box .search-icon {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400); font-size: 14px;
}
.toolbar select {
  height: 36px; padding: 0 32px 0 12px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 13px; outline: none;
  background: var(--white);
  color: var(--gray-700);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238E8E93' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.toolbar select:focus { border-color: var(--blue); }
.toolbar-date {
  height: 36px; padding: 0 10px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  background: var(--white); font-size: 13px;
  color: var(--gray-700); font-family: inherit;
  min-width: 130px;
}
.toolbar-date:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(0,122,255,0.1); }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 16px;
  border: none; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500;
  cursor: pointer; transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); }
.btn-secondary { background: var(--gray-200); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-300); }
.btn-accent { background: rgba(255,45,85,0.1); color: #FF2D55; }
.btn-accent:hover { background: rgba(255,45,85,0.2); }
.btn-scrape { background: rgba(52,199,89,0.1); color: #1B8C3A; }
.btn-scrape:hover { background: rgba(52,199,89,0.2); }
.btn-info { background: rgba(0,122,255,0.1); color: #007AFF; }
.btn-info:hover { background: rgba(0,122,255,0.2); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: var(--red-hover); }
.btn-sm { height: 30px; font-size: 12px; padding: 0 12px; }
.btn-xs { height: 26px; font-size: 11px; padding: 0 10px; border-radius: 6px; }
.btn-icon { width: 30px; height: 30px; padding: 0; justify-content: center; border-radius: 6px; }

/* ========== TABLE ========== */
.table-wrap {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
table {
  width: 100%; border-collapse: collapse;
  font-size: 14px;
}
thead { background: var(--gray-50); }
thead th {
  padding: 12px 16px;
  text-align: left; font-weight: 600;
  font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-500);
  border-bottom: 1px solid var(--gray-200);
}
tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-800);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--gray-50); }
tbody tr { transition: background 0.1s; }

/* ---- BADGES ---- */
.badge {
  display: inline-block; padding: 3px 10px;
  border-radius: 20px; font-size: 12px; font-weight: 500;
  letter-spacing: 0.1px;
}
.badge-green { background: rgba(52,199,89,0.12); color: #1B8C3A; }
.badge-blue { background: rgba(0,122,255,0.1); color: var(--blue); }
.badge-orange { background: rgba(255,149,0,0.1); color: #C46600; }
.badge-red { background: rgba(255,59,48,0.1); color: var(--red); }
.badge-gray { background: var(--gray-200); color: var(--gray-600); }
.badge-purple { background: rgba(175,82,222,0.1); color: var(--purple); }
.badge-teal { background: rgba(90,200,250,0.12); color: #0077A7; }

.tag-chip {
  display: inline-block; padding: 2px 8px;
  background: var(--gray-100); border-radius: 4px;
  font-size: 12px; color: var(--gray-600); margin: 1px 2px;
}

/* ========== MODAL ========== */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 500; align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  width: 580px; max-height: 85vh;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-200);
}
.modal-header h3 {
  font-size: 18px; font-weight: 700;
  letter-spacing: -0.2px;
}
.modal-close {
  width: 28px; height: 28px;
  border: none; background: var(--gray-100);
  border-radius: 50%; font-size: 16px;
  color: var(--gray-500); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.modal-close:hover { background: var(--gray-200); color: var(--gray-900); }
.modal-body {
  padding: 24px; overflow-y: auto; flex: 1;
}
.modal-body .form-row {
  display: flex; gap: 12px; margin-bottom: 16px;
}
.modal-body .form-group {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 16px; flex: 1;
}
.modal-body .form-group label {
  font-size: 13px; font-weight: 600;
  color: var(--gray-700);
}
.modal-body .form-group input,
.modal-body .form-group select,
.modal-body .form-group textarea {
  height: 40px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  padding: 0 12px; font-size: 14px;
  outline: none; background: var(--gray-50);
  color: var(--gray-900); transition: var(--transition);
  font-family: inherit;
}
.modal-body .form-group textarea {
  height: 80px; padding: 10px 12px; resize: vertical;
}
.modal-body .form-group input:focus,
.modal-body .form-group select:focus,
.modal-body .form-group textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,122,255,0.1);
  background: var(--white);
}
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--gray-200);
}

/* ========== SEARCH SELECT ========== */
.search-select {
  position: relative;
}
.search-select input {
  height: 40px; width: 100%;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  padding: 0 12px; font-size: 14px;
  outline: none; background: var(--gray-50);
  color: var(--gray-900); transition: var(--transition);
  font-family: inherit;
}
.search-select input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,122,255,0.1);
  background: var(--white);
}
.search-select-dropdown {
  display: none;
  position: absolute; top: 100%; left: 0; right: 0;
  max-height: 200px; overflow-y: auto;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  z-index: 50;
  margin-top: 4px;
}
.search-select-dropdown.active { display: block; }
.search-select-item {
  padding: 10px 14px; cursor: pointer;
  font-size: 14px; transition: background 0.1s;
  border-bottom: 1px solid var(--gray-100);
}
.search-select-item:last-child { border-bottom: none; }
.search-select-item:hover { background: var(--blue-light); color: var(--blue); }
.search-select-item.selected { background: var(--blue-light); color: var(--blue); font-weight: 600; }
.search-select-item .ss-info {
  font-size: 12px; color: var(--gray-500); margin-top: 2px;
}
.search-select-empty {
  padding: 16px; text-align: center;
  color: var(--gray-400); font-size: 13px;
}

/* ========== CALENDAR ========== */
.calendar-nav {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 20px;
}
.calendar-nav .month-label {
  font-size: 20px; font-weight: 700;
  min-width: 120px; text-align: center;
}
.calendar-nav .nav-arrow {
  width: 32px; height: 32px;
  border: none; background: var(--white);
  border-radius: 50%; font-size: 16px;
  color: var(--gray-600); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.calendar-nav .nav-arrow:hover { background: var(--gray-200); color: var(--gray-900); }
.calendar-nav .btn { border-radius: var(--radius-sm); box-shadow: none; }
.calendar-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 12px;
  box-shadow: var(--shadow-sm);
}
.calendar-weekday {
  text-align: center; font-size: 11px;
  font-weight: 600; text-transform: uppercase;
  color: var(--gray-500); padding: 8px 0;
  letter-spacing: 0.5px;
}
.calendar-day {
  min-height: 90px;
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
  cursor: default;
  position: relative;
  transition: background 0.1s;
}
.calendar-day:hover { background: var(--gray-50); }
.calendar-day.other-month { color: var(--gray-300); }
.calendar-day.today {
  background: var(--blue-light);
  font-weight: 700;
  color: var(--blue);
}
.calendar-day .day-num {
  margin-bottom: 2px; font-size: 12px;
}
.calendar-event {
  font-size: 10px; padding: 2px 6px;
  border-radius: 4px; margin-top: 2px;
  white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  background: rgba(0,122,255,0.08);
  color: var(--blue);
  font-weight: 500;
}
.calendar-event.published {
  background: rgba(52,199,89,0.1);
  color: #1B8C3A;
}

/* ========== EMPTY ========== */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--gray-400);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; color: var(--gray-300); }
.empty-state p { font-size: 15px; }

/* ========== TOAST ========== */
.toast {
  position: fixed; top: 24px; left: 50%;
  transform: translateX(-50%);
  background: var(--gray-900);
  color: #fff; padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 14px; font-weight: 500;
  z-index: 9999;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.2s forwards;
}
.toast.error { background: var(--red); }
.toast.success { background: var(--green); }

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

/* ========== CONFIRM DIALOG ========== */
.confirm-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(4px);
  z-index: 600; align-items: center; justify-content: center;
}
.confirm-overlay.active { display: flex; }
.confirm-dialog {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px 28px 20px;
  width: 360px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.confirm-dialog h4 { font-size: 16px; margin-bottom: 8px; }
.confirm-dialog p { font-size: 14px; color: var(--gray-500); margin-bottom: 20px; }
.confirm-dialog .confirm-actions {
  display: flex; gap: 10px; justify-content: center;
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ========== MOBILE TOPBAR ========== */
.mobile-topbar {
  display: none;
  position: sticky; top: 0; z-index: 90;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--gray-200);
  padding: 10px 16px;
  align-items: center; gap: 12px;
}
.mobile-topbar-title {
  font-size: 16px; font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--gray-900);
}

/* Hamburger */
.hamburger-btn {
  width: 32px; height: 32px;
  border: none; background: none;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 5px; cursor: pointer;
  padding: 4px; border-radius: 6px;
  flex-shrink: 0;
}
.hamburger-btn span {
  display: block; width: 20px; height: 2px;
  background: var(--gray-700);
  border-radius: 2px;
  transition: var(--transition);
}
.hamburger-btn:hover { background: var(--gray-100); }

/* Sidebar overlay */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.3); z-index: 95;
}

/* Sidebar close btn */
.sidebar-close-btn {
  display: none;
  width: 28px; height: 28px;
  border: none; background: var(--gray-100);
  border-radius: 50%; font-size: 14px;
  color: var(--gray-500); cursor: pointer;
  align-items: center; justify-content: center;
  margin-left: auto; flex-shrink: 0;
  transition: var(--transition);
}
.sidebar-close-btn:hover { background: var(--gray-200); color: var(--gray-900); }

/* ========== RESPONSIVE: <= 1024 (Tablet) ========== */
@media (max-width: 1024px) {
  :root { --sidebar-w: 220px; }
  .page-header { padding: 20px 20px 12px; }
  .page-body { padding: 0 20px 24px; }
  .calendar-day { min-height: 64px; }
  table { font-size: 13px; }
  thead th, tbody td { padding: 10px 12px; }
}

/* ========== RESPONSIVE: <= 768 (Mobile) ========== */
@media (max-width: 768px) {
  /* ---- Mobile topbar visible ---- */
  .mobile-topbar { display: flex; }

  /* ---- Sidebar becomes drawer ---- */
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 280px; max-width: 85vw;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.25, 0.1, 0.25, 1);
    z-index: 100;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.active { display: block; }
  .sidebar-close-btn { display: flex; }

  /* ---- Main content full width ---- */
  .main-content {
    margin-left: 0 !important;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  /* ---- Page header ---- */
  .page-header { padding: 16px 16px 8px; }
  .page-header h2 { font-size: 22px; }
  .page-body { padding: 0 12px 20px; }

  /* ---- Toolbar ---- */
  .toolbar {
    flex-wrap: wrap; gap: 8px;
    padding: 12px 0;
  }
  .toolbar .search-box {
    flex: 1 1 100%; min-width: 0; max-width: none;
    order: -1;
  }
  .toolbar select { flex: 1 1 auto; min-width: 100px; font-size: 12px; }
  .toolbar-date { min-width: 110px; font-size: 12px; height: 32px; }
  .toolbar .btn { flex-shrink: 0; }
  .toolbar-spacer { display: none; }

  /* ---- Tables → Cards (mobile, no horizontal scroll) ---- */
  .table-wrap { overflow: hidden; }
  .table-wrap table { min-width: 0; width: 100%; table-layout: fixed; }
  .table-wrap table thead { display: none; }
  .table-wrap table tbody tr {
    display: block;
    margin-bottom: 14px;
    border: 1px solid var(--gray-200);
    border-radius: 14px;
    background: var(--white);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    overflow: hidden;
  }
  .table-wrap table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid var(--gray-50);
    text-align: right;
    font-size: 13px;
    gap: 12px;
  }
  .table-wrap table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--gray-500);
    font-size: 12px;
    flex-shrink: 0;
    text-align: left;
    white-space: nowrap;
  }
  .table-wrap table tbody td:last-child { border-bottom: none; }
  .table-wrap table tbody td.td-actions {
    justify-content: flex-end;
    gap: 6px; flex-wrap: wrap;
    padding: 10px 14px;
  }
  .table-wrap table tbody td.td-actions::before { display: none !important; }
  .table-wrap table tbody tr:hover { background: var(--white); }
  .table-wrap .empty-state { padding: 40px 20px; }
  .table-wrap table tbody td .tag-chip { font-size: 11px; padding: 2px 8px; }
  .table-wrap table tbody td .badge { font-size: 11px; }

  /* 卡片模式下移除桌面端的宽高截断，让内容自然换行 */
  .table-wrap table tbody td {
    max-width: none !important;
    white-space: normal !important;
    word-break: break-word;
  }

  /* ---- 博主列表：桌面表格隐藏，手机卡片显示 ---- */
  .blogger-cards { display: block; width: 100%; max-width: 100%; overflow: hidden; }
  .blogger-desktop-table { display: none; }

  /* ---- 博主卡片 (手机端) ---- */
  .blogger-card {
    background: var(--white);
    border-radius: 16px;
    border: 1px solid var(--gray-200);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 14px;
    overflow: hidden;
    width: 100%; max-width: 100%;
    box-sizing: border-box;
  }
  .blogger-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 15px 10px;
  }
  .blogger-card-avatar {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff5a5f, #e8434b);
    color: #fff;
    font-size: 17px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }
  .blogger-card-title { flex: 1; min-width: 0; }
  .card-name {
    font-size: 15px; font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .card-name a { color: var(--blue); text-decoration: none; }
  .card-badges { display: flex; gap: 6px; flex-wrap: wrap; }

  .blogger-card-stats {
    display: flex;
    flex-wrap: nowrap;
    padding: 0 15px 12px;
    gap: 8px;
    overflow: hidden;
  }
  .card-stat {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    padding: 8px 4px;
    background: var(--gray-50);
    border-radius: 10px;
    overflow: hidden;
  }
  .card-stat .stat-value {
    display: block;
    font-size: 16px; font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 2px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .card-stat .stat-label {
    font-size: 11px;
    color: var(--gray-400);
    font-weight: 500;
  }

  .blogger-card-detail {
    padding: 0 15px 8px;
  }
  .blogger-card-detail .card-field {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 0;
    font-size: 13px;
    border-top: 1px solid var(--gray-50);
  }
  .blogger-card-detail .field-label {
    color: var(--gray-400);
    flex-shrink: 0;
    font-size: 12px;
    min-width: 32px;
  }
  .blogger-card-detail .field-value {
    color: var(--gray-700);
    word-break: break-word;
    flex: 1;
  }

  .blogger-card-meta {
    display: flex;
    justify-content: space-between;
    padding: 6px 15px;
    font-size: 11px;
    color: var(--gray-400);
    border-top: 1px solid var(--gray-50);
  }

  .blogger-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 15px 14px;
    border-top: 1px solid var(--gray-100);
    justify-content: flex-end;
  }
  .blogger-card-actions .btn { font-size: 11px; height: 30px; padding: 0 10px; }
}

/* ==================== Desktop (>768px) ==================== */
@media (min-width: 769px) {
  .blogger-cards { display: none; }
  .blogger-desktop-table { display: table; }
}

/* ==================== Phone (<=768px) ==================== */
/* ------------------------------------------------------------------ */
/*                       电话部分 (max-width: 768px)                     */
/* ------------------------------------------------------------------ */
@media (max-width: 768px) {
  .modal {
    width: 100vw !important; height: 100vh; max-height: 100vh;
    border-radius: 0; margin: 0;
  }
  .modal-header { padding: 16px 16px; }
  .modal-header h3 { font-size: 17px; }
  .modal-body { padding: 12px; }
  .modal-footer { padding: 12px 16px; }
  .modal-body .form-row {
    flex-direction: column; gap: 0;
  }

  /* ---- Calendar ---- */
  .calendar-nav {
    flex-wrap: wrap; gap: 8px;
  }
  .calendar-nav .month-label {
    font-size: 16px; min-width: auto;
    order: 0; flex: 1; text-align: center;
  }
  .calendar-nav button {
    width: 28px; height: 28px; font-size: 14px;
  }
  .calendar-nav .nav-arrow { width: 28px; height: 28px; }
  .calendar-nav .btn { width: auto; height: 32px; }
  .calendar-grid { padding: 6px; gap: 2px; }
  .calendar-weekday { font-size: 10px; padding: 6px 0; }
  .calendar-day {
    min-height: 52px; padding: 4px; font-size: 11px;
    border-radius: 4px;
  }
  .calendar-day .day-num { font-size: 10px; }
  .calendar-event { font-size: 9px; padding: 1px 4px; }

  /* ---- Login card ---- */
  .login-card {
    width: 90%; max-width: 360px;
    padding: 32px 24px;
    border-radius: var(--radius-lg);
  }
  .login-card h1 { font-size: 20px; }
  .login-logo { width: 44px; height: 44px; border-radius: 12px; font-size: 22px; }

  /* ---- Confirm dialog ---- */
  .confirm-dialog {
    width: 85%; max-width: 320px;
    padding: 24px 20px 16px;
  }

  /* ---- Toast ---- */
  .toast {
    top: 12px; left: 12px; right: 12px;
    transform: none;
    text-align: center;
    font-size: 13px; padding: 10px 16px;
    animation: toastInMobile 0.3s ease, toastOut 0.3s ease 2.2s forwards;
  }
  @keyframes toastInMobile {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
  }

  /* ---- Buttons touch-friendly ---- */
  .btn { height: 38px; min-width: 44px; justify-content: center; }
  .btn-xs { height: 30px; min-width: 36px; }
  .btn-sm { height: 32px; }

  /* ---- Form inputs touch-friendly ---- */
  .modal-body .form-group input,
  .modal-body .form-group select {
    height: 42px; font-size: 16px; /* prevent iOS zoom */
  }
  .login-card input {
    height: 46px; font-size: 16px;
  }
}

/* ========== RESPONSIVE: <= 480 (Small Mobile / iPhone) ========== */
@media (max-width: 480px) {
  .sidebar { width: 260px; max-width: 85vw; }
  .page-header h2 { font-size: 20px; }
  .page-header .page-desc { font-size: 13px; }
  .page-body { padding: 0 8px 16px; }

  /* 卡片更紧凑，但字号与 768px 一致 */
  .table-wrap table tbody tr { margin-bottom: 10px; border-radius: 10px; }
  .table-wrap table tbody td { padding: 8px 12px; font-size: 13px; max-width: none !important; white-space: normal !important; word-break: break-word; }
  .table-wrap table tbody td::before { font-size: 12px; }
  .table-wrap table tbody td.td-actions { gap: 4px; padding: 8px 12px; }
  .table-wrap table tbody td.td-actions .btn { font-size: 11px; height: 28px; padding: 0 10px; }

  /* 博主卡片紧凑化 */
  .blogger-card { margin-bottom: 10px; border-radius: 12px; }
  .blogger-card-header { padding: 12px 12px 8px; gap: 10px; }
  .blogger-card-avatar { width: 36px; height: 36px; font-size: 15px; }
  .card-name { font-size: 14px; }
  .blogger-card-stats { padding: 0 12px 8px; }
  .card-stat { padding: 6px 4px; }
  .card-stat .stat-value { font-size: 14px; }
  .card-stat .stat-label { font-size: 10px; }
  .blogger-card-detail { padding: 0 12px 6px; }
  .blogger-card-detail .card-field { font-size: 12px; padding: 4px 0; }
  .blogger-card-meta { padding: 4px 12px; }
  .blogger-card-actions { padding: 8px 12px 10px; gap: 4px; }
  .blogger-card-actions .btn { font-size: 10px; height: 28px; padding: 0 8px; }

  /* 日历适配 */
  .calendar-day { min-height: 42px; }
  .calendar-weekday { font-size: 10px; }
  .calendar-day .day-num { font-size: 11px; }
  .calendar-event { font-size: 9px; padding: 1px 3px; }
  .calendar-nav { gap: 4px; }
  .calendar-nav .month-label { font-size: 15px; }
  .calendar-nav .btn { font-size: 12px; height: 30px; padding: 0 10px; }

  /* 工具栏紧凑 */
  .toolbar { gap: 6px; padding: 8px 0; }
  .toolbar select { font-size: 12px; height: 34px; padding: 0 28px 0 8px; min-width: 90px; }
  .toolbar-date { min-width: 100px; font-size: 12px; height: 34px; }
  .toolbar .btn { height: 34px; font-size: 13px; padding: 0 12px; }
  .toolbar .search-box input { height: 34px; font-size: 14px; }

  /* 登录 */
  .login-card { padding: 28px 20px; border-radius: 16px; }
  .login-card h1 { font-size: 20px; }
  .modal-body { padding: 12px; }

  /* Toast 全宽 */
  .toast { left: 8px; right: 8px; font-size: 13px; padding: 10px 14px; }
}
