/* ========== CSS Custom Properties ========== */
:root {
  --primary: #63666A;
  --primary-dark: #4A4D50;
  --primary-light: #7D8085;
  --secondary: #F0EDE5;
  --accent: #AD8B5E;
  --accent-light: #C4A574;
  --text-dark: #3A3A3C;
  --text-medium: #63666A;
  --text-light: #9A9DA0;
  --white: #FFFFFF;
  --warm-white: #F7F5F0;
  --font-stack: -apple-system, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --max-width: 1200px;
  --header-height: 72px;
  --radius: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.1);
  --transition: 0.3s ease;
}

/* ========== Reset ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-stack);
  color: var(--text-dark);
  background: var(--warm-white);
  line-height: 1.7;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
  background: none;
}
button { cursor: pointer; }

/* ========== Typography ========== */
h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.02em;
  color: var(--text-dark);
}
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }
p { color: var(--text-medium); line-height: 1.8; }

/* ========== Layout ========== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}
.section {
  padding: 100px 0;
}
.section--alt {
  background: var(--secondary);
}
.section--white {
  background: var(--white);
}
.section-title {
  text-align: center;
  margin-bottom: 16px;
}
.section-subtitle {
  text-align: center;
  color: var(--text-light);
  max-width: 640px;
  margin: 0 auto 56px;
  font-size: 0.95rem;
}

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 32px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  transition: all var(--transition);
  letter-spacing: 0.03em;
  gap: 8px;
}
.btn--primary {
  background: var(--primary);
  color: var(--white);
}
.btn--primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn--secondary {
  border: 1.5px solid var(--primary);
  color: var(--primary);
  background: transparent;
}
.btn--secondary:hover {
  background: var(--primary);
  color: var(--white);
}
.btn--accent {
  background: var(--accent);
  color: var(--white);
}
.btn--accent:hover {
  background: #B89A74;
  transform: translateY(-1px);
}
.btn--block {
  width: 100%;
}
.btn--lg {
  padding: 16px 40px;
  font-size: 1rem;
}

/* ========== Cards ========== */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* ========== Placeholder Images ========== */
.placeholder-img {
  background: linear-gradient(135deg, #D1D5DB 0%, #9CA3AF 50%, #6B7280 100%);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.5);
  font-size: 2rem;
  position: relative;
  overflow: hidden;
}
.placeholder-img::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99,102,106,0.15), rgba(173,139,94,0.15));
}
.placeholder-img--warm {
  background: linear-gradient(135deg, var(--secondary), var(--accent-light), var(--primary-light));
}
.placeholder-img--cool {
  background: linear-gradient(135deg, var(--primary-light), #8BAABB, var(--secondary));
}

/* Camera icon for placeholders */
.placeholder-icon {
  position: relative;
  z-index: 1;
  opacity: 0.4;
}
.placeholder-icon svg {
  width: 48px;
  height: 48px;
  fill: currentColor;
}

/* ========== Form Elements ========== */
.form-group {
  margin-bottom: 20px;
}
.form-label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-medium);
  margin-bottom: 8px;
  font-weight: 500;
}
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid #D1D5DB;
  border-radius: var(--radius);
  font-size: 0.95rem;
  color: var(--text-dark);
  background: var(--white);
  transition: border-color var(--transition);
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,106,0.1);
}
.form-textarea {
  resize: vertical;
  min-height: 100px;
}
.form-input::placeholder { color: var(--text-light); }

/* ========== Tags ========== */
.tag {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  border: 1px solid var(--primary-light);
  color: var(--primary);
  cursor: pointer;
  transition: all var(--transition);
}
.tag:hover, .tag.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

/* ========== Divider ========== */
.divider {
  width: 48px;
  height: 2px;
  background: var(--accent);
  margin: 24px auto;
}

/* ========== Scroll Animations ========== */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}
.fade-in-left {
  opacity: 0;
  transform: translateX(-24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}
.fade-in-right {
  opacity: 0;
  transform: translateX(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* ========== Grid Utilities ========== */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 24px; }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-5 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
  .section { padding: 64px 0; }
  .container { padding: 0 16px; }
  :root { --header-height: 60px; }
}

/* ========== Misc ========== */
.text-center { text-align: center; }
.text-accent { color: var(--accent); }
.text-primary { color: var(--primary); }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

/* Toast notification */
.toast {
  position: fixed;
  top: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--text-dark);
  color: var(--white);
  padding: 12px 32px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  z-index: 10000;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.success { background: #3A855E; }
.toast.error { background: #C0392B; }
