/* ===== 屿豆手作空间 全局样式 ===== */

:root {
  --primary: #e8a87c;       /* 主色 - 温暖珊瑚 */
  --primary-dark: #d4895a;
  --primary-light: #f5d6b8;
  --secondary: #95b8a0;     /* 辅色 - 豆绿 */
  --secondary-light: #c8ddd0;
  --bg: #fef8f4;            /* 背景 - 暖白 */
  --bg-card: #ffffff;
  --bg-dark: #2d2a24;       /* 深色背景 */
  --text: #3d352e;          /* 主文字 */
  --text-light: #8a7e72;
  --text-white: #f5f0ea;
  --gold: #d4a854;
  --shadow: 0 2px 16px rgba(0,0,0,0.06);
  --shadow-hover: 0 8px 32px rgba(0,0,0,0.1);
  --radius: 16px;
  --radius-sm: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ===== TOP BAR ===== */
.top-bar {
  background: var(--bg-dark);
  color: var(--text-white);
  text-align: center;
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}
.top-bar span { opacity: 0.8; }
.top-bar .wechat { color: var(--gold); font-weight: 600; }

/* ===== HEADER ===== */
header {
  background: var(--bg-card);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(255,255,255,0.95);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.8rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-size: 1.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.logo .icon { font-size: 1.8rem; }
.logo .name { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.logo .name-small { font-size: 1rem; }

nav { display: flex; gap: 0.3rem; }
nav a {
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  color: var(--text-light);
  transition: all 0.3s;
  white-space: nowrap;
}
nav a:hover, nav a.active {
  background: var(--primary-light);
  color: var(--primary-dark);
}

/* ===== HERO SECTION ===== */
.hero {
  background: linear-gradient(135deg, #fef8f4, #f5e6d8, #e8d5c0);
  text-align: center;
  padding: 4rem 1.5rem 3rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(232,168,124,0.08) 0%, transparent 50%),
              radial-gradient(circle at 70% 50%, rgba(149,184,160,0.08) 0%, transparent 50%);
  animation: heroFloat 8s ease-in-out infinite alternate;
}
@keyframes heroFloat {
  0% { transform: translate(0,0) rotate(0deg); }
  100% { transform: translate(-20px,-20px) rotate(5deg); }
}
.hero h1 {
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 800;
  position: relative;
  z-index: 1;
}
.hero h1 span { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero p {
  margin-top: 1rem;
  color: var(--text-light);
  font-size: 1.05rem;
  position: relative;
  z-index: 1;
}

/* ===== SECTION ===== */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.section-sub {
  color: var(--text-light);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

/* ===== CARD GRID ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.2rem;
}
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s;
  cursor: pointer;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}
.card-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #f0ebe6;
}
.card-body {
  padding: 0.8rem 1rem;
}
.card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  font-size: 0.78rem;
  color: var(--text-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-tags {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}
.tag {
  padding: 0.15rem 0.5rem;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 500;
}
.tag.warm { background: #fde8d0; color: #c0763a; }
.tag.cool { background: #d0e4fd; color: #3a7cc0; }
.tag.colorful { background: #fdd0e6; color: #c03a7c; }
.tag.bw { background: #e0e0e0; color: #555; }
.tag.easy { background: #d0fdd8; color: #3a8a4a; }
.tag.medium { background: #fde8d0; color: #c0763a; }
.tag.hard { background: #fdd0d0; color: #c03a3a; }

.card-stats {
  display: flex;
  gap: 0.8rem;
  font-size: 0.75rem;
  color: var(--text-light);
}
.card-stats span { display: flex; align-items: center; gap: 0.2rem; }

/* ===== FILTER BAR ===== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  align-items: center;
}
.filter-bar label { font-size: 0.85rem; color: var(--text-light); font-weight: 500; }
.filter-bar select, .filter-bar input {
  padding: 0.4rem 0.8rem;
  border: 1px solid #ddd;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  background: var(--bg-card);
  color: var(--text);
  outline: none;
  transition: border 0.3s;
}
.filter-bar select:focus, .filter-bar input:focus { border-color: var(--primary); }
.filter-btn {
  padding: 0.4rem 1rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: white;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s;
}
.filter-btn:hover { background: var(--primary-dark); }

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 2rem;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 0.85rem;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid #eee;
  transition: all 0.3s;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary-dark); }
.page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* ===== FORM ===== */
.form-container {
  max-width: 600px;
  margin: 0 auto;
  background: var(--bg-card);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.form-group { margin-bottom: 1.2rem; }
.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text);
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid #ddd;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  outline: none;
  transition: border 0.3s;
  font-family: inherit;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary);
}
.form-group textarea { min-height: 80px; resize: vertical; }
.form-group .note {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 0.3rem;
}
.submit-btn {
  width: 100%;
  padding: 0.8rem;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}
.submit-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(232,168,124,0.4); }

/* ===== DETAIL PAGE ===== */
.detail-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}
.detail-header { margin-bottom: 1.5rem; }
.detail-header h1 { font-size: 1.6rem; font-weight: 700; }
.detail-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-light);
}
.detail-img {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--radius);
  background: #f0ebe6;
  margin-bottom: 1.5rem;
}
.detail-actions {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}
.action-btn {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 1.2rem;
  border: 1px solid #ddd;
  border-radius: 20px;
  background: var(--bg-card);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s;
}
.action-btn:hover { border-color: var(--primary); color: var(--primary-dark); }
.action-btn.liked { background: #fde8d0; border-color: var(--primary); color: var(--primary-dark); }

/* ===== COMMENTS ===== */
.comment-section { margin-top: 2rem; }
.comment-section h3 { font-size: 1.1rem; margin-bottom: 1rem; }
.comment-item {
  padding: 0.8rem 0;
  border-bottom: 1px solid #f0ebe6;
}
.comment-item:last-child { border: none; }
.comment-nick { font-weight: 600; font-size: 0.85rem; }
.comment-time { font-size: 0.75rem; color: var(--text-light); margin-left: 0.5rem; }
.comment-content { margin-top: 0.3rem; font-size: 0.9rem; line-height: 1.6; }
.comment-form { margin-top: 1rem; display: flex; gap: 0.5rem; }
.comment-form input[type="text"] { flex: 1; }
.comment-form input { padding: 0.5rem 0.8rem; border: 1px solid #ddd; border-radius: var(--radius-sm); font-size: 0.85rem; outline: none; }
.comment-form input:focus { border-color: var(--primary); }
.comment-form button {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: white;
  font-size: 0.85rem;
  cursor: pointer;
}
.comment-form button:hover { background: var(--primary-dark); }

/* ===== SHOP INFO ===== */
.shop-info {
  background: linear-gradient(135deg, var(--bg-dark), #3d352e);
  color: var(--text-white);
  padding: 2rem 1.5rem;
  text-align: center;
}
.shop-info h3 { font-size: 1.2rem; margin-bottom: 0.8rem; color: var(--gold); }
.shop-info p { font-size: 0.9rem; opacity: 0.8; margin-bottom: 0.3rem; }
.shop-info .highlight { color: var(--gold); font-weight: 600; }
.shop-info .qrcode {
  width: 120px;
  height: 120px;
  margin: 1rem auto;
  background: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: #999;
}

/* ===== FOOTER ===== */
footer {
  background: var(--bg-dark);
  color: var(--text-white);
  text-align: center;
  padding: 1.5rem;
  font-size: 0.8rem;
  opacity: 0.6;
}

/* ===== TOOLS SECTION ===== */
.tools-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.tool-card {
  background: var(--bg-card);
  border: 1px solid #eee;
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all 0.3s;
}
.tool-card:hover { border-color: var(--primary); box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.tool-card h4 { font-size: 1rem; margin-bottom: 0.4rem; }
.tool-card p { font-size: 0.85rem; color: var(--text-light); margin-bottom: 0.8rem; }
.tool-card a {
  display: inline-block;
  padding: 0.4rem 1rem;
  background: var(--primary);
  color: white;
  border-radius: 20px;
  font-size: 0.8rem;
  transition: all 0.3s;
}
.tool-card a:hover { background: var(--primary-dark); }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-dark);
  color: var(--text-white);
  padding: 0.8rem 1.5rem;
  border-radius: 12px;
  font-size: 0.9rem;
  opacity: 0;
  transition: all 0.4s;
  z-index: 999;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-light);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state p { font-size: 0.95rem; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .header-inner { padding: 0.6rem 1rem; }
  .logo { font-size: 1.2rem; }
  nav { gap: 0.2rem; }
  nav a { padding: 0.4rem 0.7rem; font-size: 0.8rem; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.8rem; }
  .hero { padding: 2.5rem 1rem 2rem; }
  .form-container { padding: 1.2rem; }
  .detail-header h1 { font-size: 1.3rem; }
  .tools-list { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; align-items: stretch; }
}

@media (max-width: 480px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
  .card-body { padding: 0.5rem 0.6rem; }
  .card-title { font-size: 0.85rem; }
}
