:root {
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-light: #818cf8;
  --accent: #0f172a;
  --accent-mid: #1e293b;
  --accent-light: #334155;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --info: #0284c7;
  --bg: #fafaf9;
  --bg-warm: #f5f0eb;
  --text: #1c1917;
  --text-secondary: #57534e;
  --text-muted: #a8a29e;
  --border: #e7e5e4;
  --card-shadow: 0 1px 3px rgba(0,0,0,.04), 0 4px 12px rgba(0,0,0,.03);
  --card-shadow-hover: 0 4px 20px rgba(0,0,0,.08);
  --radius: 14px;
  --radius-sm: 10px;
  --transition: all .25s cubic-bezier(.4,0,.2,1);
}
* { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
a { text-decoration: none; color: inherit; }
::selection { background: var(--primary); color: #fff; }

/* ── 导航栏：毛玻璃 + 渐变 ── */
.navbar {
  background: linear-gradient(135deg, rgba(249,115,22,.95), rgba(154,52,18,.94));
  backdrop-filter: blur(16px) saturate(1.6);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  padding: 0 28px; display: flex; align-items: center; height: 62px;
  box-shadow: 0 4px 24px rgba(249,115,22,.18);
  position: sticky; top: 0; z-index: 100;
}
.navbar .logo {
  font-size: 20px; font-weight: 800; color: #fff; display: flex; align-items: center; gap: 10px;
  letter-spacing: -0.5px; text-shadow: 0 1px 4px rgba(0,0,0,.1);
}
.navbar .logo .logo-icon {
  width: 34px; height: 34px; background: rgba(255,255,255,.2);
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 22px; backdrop-filter: blur(4px);
}
.navbar nav { display: flex; gap: 2px; margin-left: auto; }
.navbar nav a {
  color: rgba(255,255,255,.85); padding: 8px 14px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; transition: var(--transition); position: relative;
}
.navbar nav a:hover { background: rgba(255,255,255,.15); color: #fff; }
.navbar nav a.active {
  background: rgba(255,255,255,.22); color: #fff; font-weight: 600;
  box-shadow: inset 0 -2px 0 rgba(255,255,255,.4);
}
.navbar .mobile-menu-btn { display: none; background: none; border: none; color: #fff; font-size: 24px; cursor: pointer; padding: 4px; }

/* ── 通用容器 ── */
.container { max-width: 1000px; margin: 28px auto; padding: 0 20px; }
.card {
  background: #fff; border-radius: var(--radius); padding: 28px;
  box-shadow: var(--card-shadow); margin-bottom: 20px;
  border: 1px solid rgba(0,0,0,.04);
  transition: var(--transition);
}
.card:hover { box-shadow: var(--card-shadow-hover); }
.card h2 { font-size: 20px; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; color: var(--accent); }
.card h3 { font-size: 16px; margin: 16px 0 8px; color: var(--text-secondary); }

/* ── 表单 ── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: var(--text-secondary); }
.form-input {
  width: 100%; padding: 11px 14px; border: 2px solid var(--border); border-radius: var(--radius-sm);
  font-size: 15px; transition: var(--transition); outline: none; background: #fff;
  font-family: inherit;
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.1); }
.form-input::placeholder { color: var(--text-muted); }
textarea.form-input { resize: vertical; min-height: 80px; }
select.form-input { cursor: pointer; 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='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

/* ── 标签选择 ── */
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  padding: 6px 16px; border-radius: 20px; border: 2px solid var(--border);
  font-size: 14px; cursor: pointer; transition: var(--transition); user-select: none;
  color: var(--text-secondary); -webkit-tap-highlight-color: transparent;
}
.tag:hover { border-color: var(--primary); color: var(--primary); background: rgba(79,70,229,.04); }
.tag.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(79,70,229,.25);
}
.tag.active:hover {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(79,70,229,.35);
}

/* ── 按钮 ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 24px; border: none; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600; cursor: pointer; transition: var(--transition);
  font-family: inherit; position: relative; overflow: hidden;
}
.btn::after {
  content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255,255,255,.15), transparent);
  opacity: 0; transition: opacity .2s;
}
.btn:hover::after { opacity: 1; }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; box-shadow: 0 2px 8px rgba(79,70,229,.2);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(79,70,229,.3); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-secondary { background: #f1f5f9; color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: #e2e8f0; border-color: #cbd5e1; }
.btn-success { background: linear-gradient(135deg, var(--success), #047857); color: #fff; box-shadow: 0 2px 8px rgba(5,150,105,.2); }
.btn-success:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(5,150,105,.3); }

/* ── 结果区 ── */
.result-box {
  background: linear-gradient(135deg, #fefefe, #f8fafc);
  border: 2px solid var(--border); border-radius: 12px;
  padding: 20px; margin-top: 16px; display: none; position: relative;
}
.result-box.show { display: block; animation: slideUp .35s cubic-bezier(.4,0,.2,1); }
.result-box pre {
  white-space: pre-wrap; word-break: break-word; font-family: inherit;
  font-size: 15px; line-height: 1.8; color: var(--text); background: transparent;
}
.result-actions { display: flex; gap: 8px; margin-top: 12px; }
.btn-copy { position: absolute; top: 12px; right: 12px; }
.btn-copy.copied { background: var(--success) !important; color: #fff !important; border-color: var(--success) !important; }

/* ── 加载动画 ── */
.loading { text-align: center; padding: 28px 20px; color: var(--text-muted); display: none; }
.loading.show { display: block; }
.spinner {
  display: inline-block; width: 28px; height: 28px;
  border: 3px solid rgba(79,70,229,.15); border-top-color: var(--primary);
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .6; } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

/* ── 首页 Hero ── */
.hero {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 40%, #9a3412 100%);
  border-radius: 20px; padding: 48px 36px; margin-bottom: 28px; color: #fff;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: -50%; right: -20%; width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,.08) 0%, transparent 70%);
  border-radius: 50%;
}
.hero::after {
  content: ''; position: absolute; bottom: -30%; left: -10%; width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,.06) 0%, transparent 70%);
  border-radius: 50%;
}
.hero-content { position: relative; z-index: 1; text-align: center; }
.hero-icon { font-size: 56px; margin-bottom: 16px; animation: float 3s ease-in-out infinite; display: inline-block; }
.hero h1 { font-size: 34px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 10px; text-shadow: 0 2px 8px rgba(0,0,0,.1); }
.hero p { font-size: 16px; opacity: .9; max-width: 500px; margin: 0 auto; line-height: 1.7; }
.hero-stats {
  display: flex; justify-content: center; gap: 32px; margin-top: 28px; flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.hero-stat .num { font-size: 28px; font-weight: 800; display: block; }
.hero-stat .label { font-size: 13px; opacity: .75; }

/* ── 首页卡片 ── */
.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.home-card {
  background: #fff; border-radius: var(--radius); padding: 28px; cursor: pointer;
  border: 2px solid transparent; transition: var(--transition);
  box-shadow: var(--card-shadow); position: relative; overflow: hidden;
}
.home-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--card-color, var(--primary)), transparent);
  opacity: 0; transition: opacity .3s;
}
.home-card:hover { border-color: var(--card-color, var(--primary)); transform: translateY(-4px); box-shadow: var(--card-shadow-hover); }
.home-card:hover::before { opacity: 1; }
.home-card .icon-wrap {
  width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  font-size: 28px; margin-bottom: 16px;
}
.home-card h3 { font-size: 17px; margin-bottom: 6px; color: var(--accent); font-weight: 700; }
.home-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.home-card .badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; margin-top: 12px;
}
.badge-done { background: #ecfdf5; color: #047857; }
.badge-new { background: #eef2ff; color: #4338ca; }
.badge-soon { background: #eef2ff; color: #4338ca; }

/* ── 照片上传 ── */
.photo-section { margin-bottom: 16px; }
.photo-upload-area {
  border: 2px dashed var(--border); border-radius: 12px; padding: 24px;
  text-align: center; cursor: pointer; transition: var(--transition); color: var(--text-muted);
}
.photo-upload-area:hover, .photo-upload-area.dragover {
  border-color: var(--primary); color: var(--primary); background: rgba(79,70,229,.03);
}
.photo-preview-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.photo-preview-item {
  position: relative; width: 80px; height: 80px; border-radius: 10px; overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.photo-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.photo-remove-btn {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px;
  background: rgba(0,0,0,.55); color: #fff; border: none; border-radius: 50%;
  font-size: 11px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.photo-remove-btn:hover { background: rgba(239,68,68,.8); }
.photo-count-badge {
  display: none; background: var(--primary); color: #fff; padding: 2px 10px;
  border-radius: 12px; font-size: 12px; margin-left: 8px; font-weight: 600;
}

/* ── Toast 通知 ── */
.toast-container { position: fixed; top: 80px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #fff; border-radius: var(--radius-sm); padding: 14px 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,.12); display: flex; align-items: center; gap: 10px;
  animation: slideInRight .35s cubic-bezier(.4,0,.2,1);
  font-size: 14px; font-weight: 500; min-width: 260px; border-left: 4px solid var(--primary);
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
@keyframes slideInRight { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }

/* ── 页脚 ── */
.footer {
  text-align: center; padding: 32px 20px; color: var(--text-muted); font-size: 13px;
  border-top: 1px solid var(--border); margin-top: 40px;
}
.footer a { color: var(--primary); font-weight: 500; }

/* ── 响应式布局 ── */
@media (max-width: 768px) {
  /* 导航栏优化 */
  .navbar { padding: 0 16px; }
  .navbar .logo { font-size: 18px; }
  .navbar .logo .logo-icon { width: 30px; height: 30px; font-size: 18px; }
  .navbar nav {
    display: none; position: absolute; top: 62px; left: 0; right: 0;
    background: linear-gradient(135deg, rgba(249,115,22,.98), rgba(154,52,18,.97));
    flex-direction: column; padding: 12px; gap: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,.2);
    max-height: 70vh; overflow-y: auto;
  }
  .navbar nav.show { display: flex; }
  .navbar nav a { padding: 14px 18px; border-radius: 10px; font-size: 16px; }
  .navbar .mobile-menu-btn { display: block; margin-left: auto; font-size: 28px; }

  /* 容器优化 */
  .container { margin: 12px auto; padding: 0 12px; }

  /* Hero区域 */
  .hero { padding: 24px 16px; margin-bottom: 20px; }
  .hero-icon { font-size: 42px; }
  .hero h1 { font-size: 22px; }
  .hero p { font-size: 14px; }
  .hero-stats { gap: 16px; margin-top: 20px; }
  .hero-stat .num { font-size: 20px; }
  .hero-stat .label { font-size: 12px; }

  /* 首页卡片 */
  .home-grid { grid-template-columns: 1fr; }
  .home-card { padding: 20px; margin-bottom: 12px; }
  .home-card .icon-wrap { width: 44px; height: 44px; font-size: 24px; }
  .home-card h3 { font-size: 16px; }

  /* 卡片优化 */
  .card { padding: 16px; margin-bottom: 16px; }
  .card h2 { font-size: 18px; margin-bottom: 12px; }
  .card h3 { font-size: 15px; margin: 12px 0 6px; }

  /* 表单优化 - 手机端更容易点击 */
  .form-group { margin-bottom: 14px; }
  .form-group label { font-size: 13px; margin-bottom: 6px; }
  .form-input {
    padding: 14px 16px; font-size: 16px; /* 16px防止iOS缩放 */
    border-radius: 10px;
  }
  textarea.form-input { min-height: 100px; }
  select.form-input { padding: 14px 36px 14px 16px; font-size: 16px; }

  /* 按钮优化 - 更大更易点击 */
  .btn {
    padding: 14px 20px; font-size: 15px;
    border-radius: 10px; width: 100%;
    margin-bottom: 10px;
  }
  .btn:last-child { margin-bottom: 0; }
  .btn-success, .btn-primary, .btn-secondary { width: 100%; }

  /* 标签选择优化 */
  .tags { gap: 8px; }
  .tag { padding: 10px 16px; font-size: 14px; border-radius: 20px; }

  /* 表格优化 - 手机端改为卡片式 */
  .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -12px; padding: 0 12px; }
  .table { display: block; }
  .table thead { display: none; }
  .table tbody { display: block; }
  .table tr {
    display: block; background: #fff; border-radius: 12px;
    padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.06);
    border: 1px solid var(--border);
  }
  .table td {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 0; border: none; border-bottom: 1px solid var(--border);
    font-size: 14px;
  }
  .table td:last-child { border-bottom: none; }
  .table td::before {
    content: attr(data-label); font-weight: 600; color: var(--text-secondary);
    font-size: 13px;
  }
  .table td .btn, .table td button { width: auto; margin: 4px 0; }

  /* 结果区域 */
  .result-box { padding: 16px; }
  .result-box pre { font-size: 14px; }
  .result-actions { flex-direction: column; }

  /* 照片上传 */
  .photo-upload-area { padding: 20px; }
  .photo-preview-grid { justify-content: center; }
  .photo-preview-item { width: 70px; height: 70px; }

  /* 标签页优化 */
  .tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; gap: 8px; padding-bottom: 8px; }
  .tabs button { white-space: nowrap; padding: 10px 16px; font-size: 14px; }

  /* 统计卡片 */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-card { padding: 16px; }
  .stat-card .num { font-size: 24px; }
  .stat-card .label { font-size: 12px; }

  /* 进度条 */
  .progress-bar { height: 10px; border-radius: 5px; }

  /* 模态框优化 */
  .modal { padding: 16px; }
  .modal-content { padding: 20px; border-radius: 16px; }

  /* 页面头部 */
  .page-header { padding: 16px; margin: -16px -12px 16px -12px; }
  .page-header h2 { font-size: 18px; }
  .page-header .subtitle { font-size: 13px; }

  /* Toast通知 - 移动端优化 */
  .toast-container {
    left: 12px; right: 12px; top: 70px;
    transform: none !important;
  }
  .toast { min-width: auto; width: 100%; }

  /* 分页优化 */
  .pagination { flex-wrap: wrap; justify-content: center; }
  .pagination button { padding: 10px 14px; font-size: 14px; }
}

/* 超小屏幕优化 */
@media (max-width: 375px) {
  .container { padding: 0 10px; }
  .hero { padding: 20px 12px; }
  .card { padding: 14px; }
  .navbar { padding: 0 12px; }
  .stats-grid { grid-template-columns: 1fr; }
  .form-input { padding: 12px 14px; font-size: 16px; }
  .btn { padding: 12px 16px; font-size: 14px; }
}

/* 平板适配 */
@media (min-width: 769px) and (max-width: 1024px) {
  .container { max-width: 90%; }
  .home-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
}
