/* ============================
   rent.springcore.cn 主样式
   现代、专业、移动优先
   ============================ */

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

:root {
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-light: #818cf8;
  --primary-bg: #eef2ff;
  --secondary: #f59e0b;
  --accent: #ec4899;
  --success: #10b981;
  --text: #111827;
  --text-mid: #4b5563;
  --text-light: #9ca3af;
  --bg: #ffffff;
  --bg-soft: #f9fafb;
  --bg-muted: #f3f4f6;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.15);
  --header-h: 64px;
  --max-w: 1200px;
  --gradient-primary: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #ec4899 100%);
  --gradient-soft: linear-gradient(180deg, #faf5ff 0%, #ffffff 100%);
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  line-height: 1.6;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: 1rem; }

/* ====== Layout ====== */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }
main { min-height: calc(100vh - var(--header-h) - 280px); }

/* ====== Header ====== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 100%;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.1rem; font-weight: 800;
  color: var(--text);
}
.logo-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  background: var(--gradient-primary); border-radius: 10px;
  font-size: 20px; color: white;
  box-shadow: 0 4px 10px rgba(124, 58, 237, 0.3);
}
.main-nav { display: flex; gap: 8px; align-items: center; }
.main-nav a {
  color: var(--text-mid);
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  transition: all 0.2s;
}
.main-nav a:hover { color: var(--primary); background: var(--primary-bg); }
.main-nav a.active { color: var(--primary); background: var(--primary-bg); }

.cart-icon {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  background: var(--bg-muted);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: all 0.2s;
  margin-left: 8px;
}
.cart-icon:hover { background: var(--primary-bg); color: var(--primary); }
.cart-icon svg { width: 20px; height: 20px; }
.cart-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 18px; height: 18px;
  background: var(--accent);
  color: white;
  font-size: 11px; font-weight: 700;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 5px;
  opacity: 0; transform: scale(0);
  transition: all 0.2s;
}
.cart-badge.show { opacity: 1; transform: scale(1); }

/* ====== Hero ====== */
.hero {
  position: relative;
  background: var(--gradient-primary);
  color: white;
  padding: 80px 0 100px;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.15) 0%, transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(255,255,255,0.1) 0%, transparent 40%);
  pointer-events: none;
}
.hero .container { position: relative; text-align: center; }
.hero h1 {
  font-size: 2.8rem; font-weight: 900; line-height: 1.2;
  margin-bottom: 16px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.15);
}
.hero .subtitle { font-size: 1.15rem; opacity: 0.95; margin-bottom: 32px; }
.hero-stats {
  display: flex; justify-content: center; gap: 32px; flex-wrap: wrap;
  margin-top: 40px;
  font-size: 0.95rem; opacity: 0.95;
}
.hero-stats strong { display: block; font-size: 1.6rem; font-weight: 800; margin-bottom: 4px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px;
  background: white; color: var(--primary);
  font-weight: 700; font-size: 1rem;
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  transition: all 0.2s;
  border: none;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-xl); color: var(--primary); }
.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.4);
}
.btn-primary:hover { color: white; }
.btn-block { display: flex; width: 100%; justify-content: center; }
.btn-sm { padding: 6px 14px; font-size: 0.875rem; }
.btn-icon { padding: 8px; width: 36px; height: 36px; justify-content: center; }

/* ====== Sections ====== */
section { padding: 56px 0; }
section h2 {
  font-size: 1.8rem; font-weight: 800;
  text-align: center; margin-bottom: 8px;
}
.section-subtitle {
  text-align: center; color: var(--text-light);
  margin-bottom: 40px; font-size: 0.95rem;
}

/* ====== Category Grid (Homepage) ====== */
.categories { background: var(--bg-soft); }
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.category-card {
  display: flex; flex-direction: column; align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  color: var(--text);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.category-card::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--gradient-primary);
  opacity: 0; transition: opacity 0.25s;
  z-index: 0;
}
.category-card > * { position: relative; z-index: 1; }
.category-card:hover {
  border-color: transparent;
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  color: white;
}
.category-card:hover::before { opacity: 1; }
.category-card:hover .cat-icon { background: rgba(255,255,255,0.2); }
.category-card:hover .cat-count { color: rgba(255,255,255,0.9); }
.cat-icon {
  width: 56px; height: 56px;
  background: var(--primary-bg);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  margin-bottom: 12px;
  transition: background 0.25s;
}
.category-card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 4px; }
.cat-count { color: var(--text-light); font-size: 0.8rem; transition: color 0.25s; }

/* ====== Features ====== */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}
.feature {
  text-align: center;
  padding: 24px 16px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border);
  transition: all 0.2s;
}
.feature:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.feature .icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px;
  background: var(--primary-bg);
  border-radius: 50%;
  font-size: 32px;
  margin-bottom: 12px;
}
.feature h3 { font-size: 1.05rem; margin-bottom: 6px; font-weight: 700; }
.feature p { color: var(--text-light); font-size: 0.9rem; }

/* ====== Page Header ====== */
.page-header {
  background: var(--gradient-soft);
  padding: 48px 0 40px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.page-header h1 {
  font-size: 2rem; font-weight: 800;
  margin-bottom: 8px;
}
.page-header p { color: var(--text-light); font-size: 0.95rem; }

/* ====== Equipment List Page ====== */
.equipment-toolbar {
  position: sticky; top: var(--header-h);
  z-index: 50;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  margin-bottom: 24px;
}
.toolbar-row {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap;
}
.search-box {
  flex: 1; min-width: 200px;
  display: flex; align-items: center;
  background: var(--bg-muted);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  transition: all 0.2s;
}
.search-box:focus-within { background: var(--bg); border-color: var(--primary); }
.search-box input {
  flex: 1; border: none; background: none; outline: none;
  font-size: 0.95rem;
  color: var(--text);
}
.search-box svg { width: 18px; height: 18px; color: var(--text-light); margin-right: 8px; }
.sort-select {
  background: var(--bg-muted);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
}

.filter-tabs {
  display: flex; gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0;
  margin-top: 8px;
  scrollbar-width: thin;
}
.filter-tab {
  flex-shrink: 0;
  padding: 6px 14px;
  background: var(--bg-muted);
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-mid);
  white-space: nowrap;
  transition: all 0.2s;
}
.filter-tab:hover { background: var(--primary-bg); color: var(--primary); }
.filter-tab.active { background: var(--primary); color: white; }

.category-block { margin-bottom: 40px; scroll-margin-top: calc(var(--header-h) + 80px); }
.category-title {
  font-size: 1.3rem; font-weight: 800;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary-bg);
}
.cat-icon-sm {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  background: var(--primary-bg); border-radius: 8px;
  font-size: 18px;
}
.cat-count-badge {
  background: var(--primary-bg); color: var(--primary);
  font-size: 0.75rem; font-weight: 700;
  padding: 2px 10px; border-radius: 999px;
}

.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
/* 紧凑模式：更小更密 */
.flat-grid {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}
.item-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.item-card:hover {
  border-color: var(--primary-light);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.item-image {
  aspect-ratio: 1/1;
  width: 100%;
  background: var(--bg-muted);
  overflow: hidden;
  position: relative;
}
.item-image img { width: 100%; height: 100%; object-fit: cover; }
.item-body { padding: 14px; flex: 1; display: flex; flex-direction: column; }

/* 紧凑模式卡片 */
.item-card-compact .item-image { aspect-ratio: 4/3; }
.item-card-compact .item-body { padding: 10px 12px 12px; }
.item-card-compact .item-name {
  font-size: 0.82rem; font-weight: 600;
  line-height: 1.35;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.3em;
}
.item-card-compact .item-meta { margin-top: 0; }
.item-card-compact .item-price .amount { font-size: 1.3rem; }
.item-card-compact .item-price .currency { font-size: 0.8em; }
.item-card-compact .item-price .unit { font-size: 0.72rem; }
.item-card-compact .add-cart-btn {
  padding: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
}
.item-card-compact .add-cart-btn svg { width: 14px; height: 14px; }

/* 类别标签 */
.item-cat-tag {
  position: absolute;
  top: 8px; left: 8px;
  background: rgba(0,0,0,0.55);
  color: white;
  font-size: 0.7rem; font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  max-width: calc(100% - 16px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-name {
  font-size: 0.92rem; font-weight: 600;
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}
.item-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: auto; }
.item-price {
  color: var(--primary);
  display: flex; align-items: baseline; gap: 1px;
  font-weight: 800;
}
.item-price .currency { font-size: 0.85em; font-weight: 600; }
.item-price .amount { font-size: 1.6rem; }
.item-price .unit { font-size: 0.8rem; color: var(--text-light); font-weight: 500; }
.item-actions { display: flex; gap: 8px; margin-top: 12px; }
.add-cart-btn {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 12px;
  background: var(--gradient-primary);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 600;
  transition: all 0.2s;
}
.add-cart-btn:hover { transform: scale(1.02); color: white; }
.add-cart-btn:active { transform: scale(0.98); }
.add-cart-btn.added { background: var(--success); }
.add-cart-btn svg { width: 16px; height: 16px; }

/* 视图切换按钮 */
.view-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-muted);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.view-toggle:hover { background: var(--primary-bg); color: var(--primary); }
.view-toggle.active { background: var(--primary); color: white; }

.days-input {
  display: flex; align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg);
}
.days-input button {
  width: 28px; height: 32px;
  background: var(--bg-muted);
  color: var(--text);
  font-size: 14px; font-weight: 600;
  transition: background 0.2s;
}
.days-input button:hover { background: var(--primary-bg); color: var(--primary); }
.days-input input {
  width: 36px; height: 32px;
  border: none; text-align: center;
  font-size: 0.875rem; font-weight: 600;
  color: var(--text);
  outline: none;
  -moz-appearance: textfield;
}
.days-input input::-webkit-outer-spin-button,
.days-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ====== Notice / About Content ====== */
.notice-content, .about-content { max-width: 800px; margin: 0 auto; }
.notice-block, .about-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.notice-block h2, .about-block h2 {
  text-align: left; font-size: 1.25rem;
  margin-bottom: 16px; color: var(--primary);
  display: flex; align-items: center; gap: 8px;
}
.notice-block ul, .about-block ul { list-style: none; }
.notice-block li, .about-block li {
  padding: 6px 0 6px 24px;
  position: relative;
  line-height: 1.7;
  color: var(--text-mid);
}
.notice-block li::before, .about-block li::before {
  content: '▸';
  position: absolute; left: 0; top: 6px;
  color: var(--primary); font-weight: 700;
}
.notice-block li strong, .about-block li strong { color: var(--text); }
.advantages {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px; margin-top: 16px;
}
.advantage {
  padding: 18px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.advantage h3 { font-size: 1rem; margin-bottom: 6px; color: var(--text); }
.advantage p { color: var(--text-light); font-size: 0.9rem; }

/* ====== Footer ====== */
.site-footer {
  background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
  color: #d1d5db;
  padding: 48px 0 24px;
  margin-top: 64px;
}
.footer-content {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}
.footer-col h4 { color: white; margin-bottom: 12px; font-size: 0.95rem; font-weight: 700; }
.footer-col ul { list-style: none; }
.footer-col li { padding: 4px 0; }
.footer-col a { color: #d1d5db; font-size: 0.9rem; }
.footer-col a:hover { color: white; }
.footer-col p { color: #9ca3af; font-size: 0.9rem; line-height: 1.7; }
.footer-bottom {
  border-top: 1px solid #374151;
  padding-top: 20px;
  text-align: center;
  color: #9ca3af;
  font-size: 0.85rem;
}

/* ====== Animations ====== */
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.shake { animation: shake 0.4s ease; }

/* ====== Responsive ====== */
@media (max-width: 768px) {
  :root { --header-h: 56px; }
  .container { padding: 0 16px; }
  .hero { padding: 56px 0 72px; }
  .hero h1 { font-size: 1.85rem; }
  .hero .subtitle { font-size: 1rem; }
  .hero-stats { gap: 20px; font-size: 0.85rem; }
  .hero-stats strong { font-size: 1.3rem; }
  section { padding: 40px 0; }
  section h2 { font-size: 1.4rem; }
  .main-nav { gap: 4px; }
  .main-nav a { padding: 6px 10px; font-size: 0.85rem; }
  .page-header { padding: 32px 0 24px; }
  .page-header h1 { font-size: 1.5rem; }
  .footer-content { grid-template-columns: 1fr 1fr; gap: 24px; }
  .category-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .category-card { padding: 16px 8px; }
  .cat-icon { width: 44px; height: 44px; font-size: 22px; }
  /* 紧凑卡片移动端：3 列 */
  .flat-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .item-card-compact .item-body { padding: 8px 10px 10px; }
  .item-card-compact .item-name { font-size: 0.75rem; min-height: 2em; }
  .item-card-compact .item-price .amount { font-size: 1.05rem; }
  .item-card-compact .item-cat-tag { font-size: 0.6rem; padding: 1px 6px; top: 6px; left: 6px; }
  .items-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .item-name { font-size: 0.85rem; min-height: 2.4em; }
  .item-body { padding: 10px; }
  .item-price .amount { font-size: 1.3rem; }
  .add-cart-btn { font-size: 0.8rem; padding: 6px 8px; }
  .view-toggle span { display: none; }
  .view-toggle { padding: 8px; }
}

@media (max-width: 480px) {
  .logo-text { display: none; }
  .hero h1 { font-size: 1.6rem; }
  .filter-tab { padding: 5px 10px; font-size: 0.8rem; }
  .footer-content { grid-template-columns: 1fr; }
  .notice-block, .about-block { padding: 20px; }
  .flat-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .item-card-compact .item-name { font-size: 0.72rem; }
  .item-card-compact .item-price .amount { font-size: 0.95rem; }
}
