/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --education-primary: #6366f1;
  --education-light: #818cf8;
  --education-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --life-primary: #f43f5e;
  --life-light: #fb7185;
  --life-bg: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --couple-primary: #ec4899;
  --couple-light: #f472b6;
  --couple-bg: linear-gradient(135deg, #ff6b9d 0%, #c44569 100%);
  --weekly-primary: #14b8a6;
  --weekly-light: #2dd4bf;
  --weekly-bg: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --bg-primary: #f8fafc;
  --card-bg: #ffffff;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  min-height: 100vh;
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ==================== 登录页面 ==================== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  padding: 20px;
}

.login-container {
  background: white;
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-xl);
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-icon {
  font-size: 56px;
  display: block;
  margin-bottom: 16px;
}

.login-title {
  font-size: 28px;
  font-weight: 700;
  background: var(--education-bg);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

.auth-form h2 {
  font-size: 20px;
  margin-bottom: 24px;
  text-align: center;
  color: var(--text-primary);
}

.auth-form .form-group {
  margin-bottom: 16px;
}

.auth-form label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.auth-form input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-md);
  font-size: 15px;
  transition: all 0.3s;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--education-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--education-bg);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 8px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.switch-link {
  text-align: center;
  margin-top: 20px;
  color: var(--text-secondary);
  font-size: 14px;
}

.switch-link a {
  color: var(--education-primary);
  text-decoration: none;
  font-weight: 500;
}

.switch-link a:hover {
  text-decoration: underline;
}

/* ==================== 主应用 ==================== */
.app-container {
  max-width: 1800px;
  margin: 0 auto;
  padding: 24px;
  position: relative;
}

/* 装饰背景 */
.bg-decoration {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: float 20s infinite ease-in-out;
}

.blob-1 {
  width: 600px;
  height: 600px;
  background: var(--education-primary);
  top: -200px;
  left: -100px;
  opacity: 0.15;
}

.blob-2 {
  width: 500px;
  height: 500px;
  background: var(--life-primary);
  bottom: -150px;
  right: -100px;
  opacity: 0.12;
  animation-delay: -5s;
}

.blob-3 {
  width: 400px;
  height: 400px;
  background: #8b5cf6;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.08;
  animation-delay: -10s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -30px) scale(1.05); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(20px, 30px) scale(1.02); }
}

/* 头部 */
.header {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  padding: 20px 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.logo-icon {
  font-size: 36px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.logo-text {
  font-size: 28px;
  font-weight: 700;
  background: var(--education-bg);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-watermark {
  font-size: 16px;
  font-weight: 600;
  color: transparent;
  background: linear-gradient(
    90deg,
    #ec4899 0%,
    #f43f5e 25%,
    #f97316 50%,
    #ec4899 75%,
    #f43f5e 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  margin-left: 20px;
  letter-spacing: 2px;
  animation: watermarkShine 3s linear infinite;
  text-shadow: 0 0 20px rgba(236, 72, 153, 0.3);
  position: relative;
}

.logo-watermark::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 20px;
  background: linear-gradient(180deg, #ec4899, #f43f5e);
  border-radius: 2px;
  margin-right: 10px;
}

@keyframes watermarkShine {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.logo-subtitle {
  width: 100%;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 400;
  margin-left: 48px;
  margin-top: -8px;
}

.header-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}

.search-mini {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: all 0.3s;
}

.search-mini:focus-within {
  border-color: var(--education-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-mini input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  width: 150px;
  color: var(--text-primary);
}

.search-mini input::placeholder {
  color: var(--text-secondary);
}

.btn-add {
  background: var(--education-bg);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-lg);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s;
  box-shadow: var(--shadow-md), 0 0 20px rgba(99, 102, 241, 0.3);
}

.btn-add:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), 0 0 30px rgba(99, 102, 241, 0.4);
}

/* 统计卡片 - 5列布局 */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-md);
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.education-stat::before {
  background: var(--education-bg);
}

.life-stat::before {
  background: var(--life-bg);
}

.couple-stat::before {
  background: var(--couple-bg);
}

.weekly-stat::before {
  background: var(--weekly-bg);
}

.total-stat::before {
  background: linear-gradient(90deg, var(--education-primary), var(--life-primary), var(--couple-primary), var(--weekly-primary));
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.stat-icon {
  font-size: 32px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* 四栏布局 */
.main-content {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.column {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-xl);
  padding: 20px;
  min-height: 500px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow-lg);
}

.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(0, 0, 0, 0.05);
}

.column-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.title-icon {
  font-size: 22px;
}

.title-badge {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 500;
}

.education-column .title-badge {
  background: rgba(99, 102, 241, 0.1);
  color: var(--education-primary);
}

.life-column .title-badge {
  background: rgba(244, 63, 94, 0.1);
  color: var(--life-primary);
}

.couple-column .title-badge {
  background: rgba(236, 72, 153, 0.1);
  color: var(--couple-primary);
}

.weekly-column .title-badge {
  background: rgba(20, 184, 166, 0.1);
  color: var(--weekly-primary);
}

.column-add-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg-primary);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  color: var(--text-secondary);
}

.education-column .column-add-btn:hover {
  background: var(--education-primary);
  color: white;
  transform: scale(1.1);
}

.life-column .column-add-btn:hover {
  background: var(--life-primary);
  color: white;
  transform: scale(1.1);
}

.couple-column .column-add-btn:hover {
  background: var(--couple-primary);
  color: white;
  transform: scale(1.1);
}

.weekly-column .column-add-btn:hover {
  background: var(--weekly-primary);
  color: white;
  transform: scale(1.1);
}

/* Tips列表 */
.tips-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100vh - 350px);
  overflow-y: auto;
  padding-right: 8px;
}

.tips-list::-webkit-scrollbar {
  width: 6px;
}

.tips-list::-webkit-scrollbar-track {
  background: transparent;
}

.tips-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 3px;
}

/* Tip卡片 */
.tip-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s;
  position: relative;
  border-left: 4px solid;
  animation: cardSlideIn 0.3s ease;
}

@keyframes cardSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tip-card.education {
  border-left-color: var(--education-primary);
}

.tip-card.life {
  border-left-color: var(--life-primary);
}

.tip-card.couple {
  border-left-color: var(--couple-primary);
}

.tip-card.weekly {
  border-left-color: var(--weekly-primary);
}

.tip-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateX(4px);
}

.tip-card.highlight {
  animation: highlightPulse 1s ease;
}

@keyframes highlightPulse {
  0%, 100% { box-shadow: var(--shadow-sm); }
  50% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.4); }
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
  gap: 10px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.card-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.3s;
}

.tip-card:hover .card-actions {
  opacity: 1;
}

.action-btn {
  background: var(--bg-primary);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.action-btn:hover {
  background: rgba(99, 102, 241, 0.1);
  transform: scale(1.1);
}

.action-btn.delete:hover {
  background: rgba(244, 63, 94, 0.1);
}

.card-content {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 12px;
}

/* 视频卡片样式 */
.card-video {
  margin-bottom: 12px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000;
}

.card-video video {
  width: 100%;
  max-height: 200px;
  display: block;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--text-secondary);
}

.card-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.tag {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 500;
}

.tip-card.education .tag {
  background: rgba(99, 102, 241, 0.08);
  color: var(--education-primary);
}

.tip-card.life .tag {
  background: rgba(244, 63, 94, 0.08);
  color: var(--life-primary);
}

.tip-card.couple .tag {
  background: rgba(236, 72, 153, 0.08);
  color: var(--couple-primary);
}

.tip-card.weekly .tag {
  background: rgba(20, 184, 166, 0.08);
  color: var(--weekly-primary);
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 40px 16px;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state p {
  color: var(--text-secondary);
  margin-bottom: 12px;
  font-size: 14px;
}

.empty-add-btn {
  background: transparent;
  border: 2px dashed var(--text-secondary);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s;
  font-size: 13px;
}

.empty-add-btn:hover {
  border-style: solid;
  color: var(--education-primary);
  border-color: var(--education-primary);
}

/* 模态框 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: white;
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
  box-shadow: var(--shadow-xl);
}

@keyframes slideUp {
  from { 
    transform: translateY(30px) scale(0.95);
    opacity: 0;
  }
  to { 
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  background: var(--education-bg);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal-close {
  background: var(--bg-primary);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  font-size: 20px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.modal-close:hover {
  background: rgba(244, 63, 94, 0.1);
  color: var(--life-primary);
}

/* 表单 */
#tip-form {
  padding: 24px;
}

.form-group {
  margin-bottom: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group.half {
  margin-bottom: 0;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
}

.label-icon {
  font-size: 13px;
}

.type-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.type-btn {
  padding: 10px 8px;
  border: 2px solid rgba(0, 0, 0, 0.08);
  background: white;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.type-btn:hover {
  border-color: var(--education-primary);
}

.type-btn.active {
  border-color: var(--education-primary);
  background: rgba(99, 102, 241, 0.05);
  color: var(--education-primary);
}

.type-btn[data-type="life"].active {
  border-color: var(--life-primary);
  background: rgba(244, 63, 94, 0.05);
  color: var(--life-primary);
}

.type-btn[data-type="couple"].active {
  border-color: var(--couple-primary);
  background: rgba(236, 72, 153, 0.05);
  color: var(--couple-primary);
}

.type-btn[data-type="weekly"].active {
  border-color: var(--weekly-primary);
  background: rgba(20, 184, 166, 0.05);
  color: var(--weekly-primary);
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.3s;
  color: var(--text-primary);
  background: white;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--education-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-textarea {
  min-height: 80px;
  resize: vertical;
}

/* 视频上传区域 */
.video-upload-area {
  border: 2px dashed rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-md);
  padding: 12px;
  transition: all 0.3s;
}

.video-upload-area:hover {
  border-color: var(--education-primary);
  background: rgba(99, 102, 241, 0.02);
}

.video-upload-btns {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-upload-video {
  background: var(--bg-primary);
  border: none;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s;
  color: var(--text-secondary);
}

.btn-upload-video:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--education-primary);
}

.video-filename {
  font-size: 12px;
  color: var(--text-secondary);
}

.video-preview {
  margin-top: 12px;
}

.video-preview-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.video-preview video {
  width: 100%;
  max-height: 150px;
  border-radius: var(--radius-sm);
  background: #000;
}

.remove-video-btn {
  background: rgba(244, 63, 94, 0.1);
  color: var(--life-primary);
  border: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  align-self: flex-start;
}

.remove-video-btn:hover {
  background: var(--life-primary);
  color: white;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.btn-cancel {
  padding: 10px 20px;
  border: none;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.3s;
}

.btn-cancel:hover {
  background: rgba(0, 0, 0, 0.05);
}

.btn-save {
  background: var(--education-bg);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s;
  box-shadow: var(--shadow-md);
}

.btn-save:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-save:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* 删除模态框 */
.delete-modal {
  text-align: center;
  padding: 40px;
  max-width: 400px;
}

.delete-icon {
  font-size: 56px;
  margin-bottom: 16px;
}

.delete-modal h3 {
  font-size: 22px;
  margin-bottom: 8px;
}

.delete-modal p {
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.delete-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn-delete {
  background: var(--life-bg);
  color: white;
  border: none;
  padding: 12px 32px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: var(--shadow-md);
}

.btn-delete:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* 响应式 */
@media (max-width: 1400px) {
  .main-content {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .stats-bar {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1024px) {
  .main-content {
    grid-template-columns: 1fr;
  }
  
  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .stat-card {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .app-container {
    padding: 12px;
  }
  
  .header {
    padding: 16px 20px;
  }
  
  .header-content {
    flex-direction: column;
    gap: 16px;
  }
  
  .logo-subtitle {
    margin-left: 0;
  }
  
  .header-actions {
    width: 100%;
    flex-direction: column;
  }
  
  .search-mini {
    width: 100%;
  }
  
  .search-mini input {
    width: 100%;
  }
  
  .btn-add {
    width: 100%;
    justify-content: center;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .form-group.half {
    margin-bottom: 16px;
  }
  
  .card-actions {
    opacity: 1;
  }
  
  .column {
    padding: 16px;
  }
  
  .type-selector {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .stats-bar {
    grid-template-columns: 1fr 1fr;
  }
}

/* 删除确认框 z-index 要高于设置模态框 */
#delete-modal-overlay {
  z-index: 10001 !important;
}

.delete-modal {
  max-width: 360px;
  text-align: center;
  padding: 32px;
}

.delete-modal .delete-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.delete-modal h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.delete-modal p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 24px;
}

.delete-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.delete-actions .btn-cancel {
  padding: 10px 24px;
  background: #f1f5f9;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 14px;
}

.delete-actions .btn-delete {
  padding: 10px 24px;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 14px;
}

.delete-actions .btn-delete:hover {
  background: #dc2626;
}

/* ==================== 设置模态框 ==================== */
.settings-modal {
  max-width: 600px;
  z-index: 10000;
}

.settings-tabs {
  display: flex;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 24px;
}

.settings-tabs .tab-btn {
  padding: 12px 20px;
  background: none;
  border: none;
  font-size: 15px;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.3s;
}

.settings-tabs .tab-btn:hover {
  color: var(--text-primary);
}

.settings-tabs .tab-btn.active {
  color: var(--education-primary);
  border-bottom-color: var(--education-primary);
}

.settings-content {
  display: none;
  padding: 24px;
}

.settings-content.active {
  display: block;
}

/* 栏目列表 */
.categories-list {
  margin-bottom: 16px;
}

.category-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
}

.category-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-icon {
  font-size: 24px;
}

.category-name {
  font-weight: 500;
}

.category-key {
  color: var(--text-secondary);
  font-size: 12px;
}

.category-actions {
  display: flex;
  gap: 8px;
}

.btn-edit-cat, .btn-delete-cat {
  background: white;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-edit-cat:hover {
  background: rgba(99, 102, 241, 0.1);
}

.btn-delete-cat:hover {
  background: rgba(239, 68, 68, 0.1);
}

.btn-add-category {
  width: 100%;
  padding: 12px;
  background: var(--bg-primary);
  border: 2px dashed #e2e8f0;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
  transition: all 0.3s;
}

.btn-add-category:hover {
  border-color: var(--education-primary);
  color: var(--education-primary);
}

.add-category-form {
  margin-top: 16px;
  padding: 16px;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
}

/* 图标选择器 */
.icon-picker {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.icon-option {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: white;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.icon-option:hover {
  background: #f1f5f9;
  transform: scale(1.1);
}

.icon-option.selected {
  border-color: var(--education-primary);
  background: rgba(99, 102, 241, 0.1);
}

/* 颜色选择器 */
.color-picker {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.color-option {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid white;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.color-option:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.color-option.selected {
  border-color: #1e293b;
  transform: scale(1.1);
  box-shadow: 0 0 0 3px rgba(30, 41, 59, 0.2);
}

/* 按钮 */
.btn-settings {
  background: white;
  border: 2px solid #e2e8f0;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
}

.btn-settings:hover {
  border-color: var(--education-primary);
  color: var(--education-primary);
}

.btn-logout {
  background: rgba(239, 68, 68, 0.1);
  border: none;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 14px;
  color: #ef4444;
  transition: all 0.3s;
}

.btn-logout:hover {
  background: #ef4444;
  color: white;
}

/* 表单选择器 */
.form-select {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: inherit;
  background: white;
  cursor: pointer;
}

.form-select:focus {
  outline: none;
  border-color: var(--education-primary);
}

/* 输入颜色选择器 */
input[type="color"] {
  height: 42px;
  padding: 4px;
  cursor: pointer;
}

/* 统计卡片颜色 */
.stat-card {
  position: relative;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--cat-color, var(--education-primary));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* 动态栏目列 */
.main-content {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* 加载动画 */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px;
  grid-column: 1 / -1;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e2e8f0;
  border-top-color: var(--education-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading-spinner p {
  margin-top: 16px;
  color: var(--text-secondary);
}

@media (min-width: 1200px) {
  .main-content {
    grid-template-columns: repeat(4, 1fr);
  }
}
