/* ===== 基础 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f5f5;
  color: #333;
  min-height: 100vh;
}
a { color: #07c; text-decoration: none; }
img { max-width: 100%; }

/* ===== 导航 ===== */
.nav {
  background: #1a1a2e;
  color: #fff;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-title { font-size: 18px; font-weight: 700; }
.nav-links { display: flex; gap: 16px; }
.nav-links a {
  color: rgba(255,255,255,.65);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 14px;
}
.nav-links a.active, .nav-links a:hover { color: #fff; background: rgba(255,255,255,.1); }

/* ===== 容器 ===== */
.container { max-width: 1000px; margin: 0 auto; padding: 24px 16px; }

/* ===== 统计卡片 ===== */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin: 24px 0; }
.stat-card {
  background: #fff; border-radius: 8px; padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.stat-card h3 { font-size: 14px; color: #888; margin-bottom: 8px; }
.stat-card p { font-size: 28px; font-weight: 700; color: #1a1a2e; }

/* ===== 按钮 ===== */
.btn {
  background: #1a1a2e; color: #fff; border: none; padding: 8px 20px;
  border-radius: 6px; cursor: pointer; font-size: 14px;
}
.btn-secondary { background: #e0e0e0; color: #333; }
.btn:hover { opacity: .85; }
.btn-sm { padding: 4px 12px; font-size: 12px; }
.btn-danger { background: #e74c3c; }

/* ===== 页面头部 ===== */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.page-header h1 { font-size: 22px; }

/* ===== 表格 ===== */
.table {
  width: 100%; border-collapse: collapse; background: #fff;
  border-radius: 8px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid #eee; }
.table th { background: #fafafa; font-weight: 600; font-size: 13px; color: #666; }
.table tr:hover { background: #f8f8f8; }

/* ===== 弹窗 ===== */
.modal {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4);
  align-items: center; justify-content: center; z-index: 200;
}
.modal.show { display: flex; }
.modal-content {
  background: #fff; border-radius: 12px; padding: 24px; width: 90%; max-width: 480px;
  max-height: 90vh; overflow-y: auto;
}
.modal-content h2 { margin-bottom: 16px; font-size: 18px; }
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 13px; color: #666; margin-bottom: 4px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* ===== 筛选栏 ===== */
.filter-bar { margin-bottom: 16px; }
.filter-bar select { padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; }

/* ===== 卡片网格（项目列表） ===== */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.card {
  background: #fff; border-radius: 8px; padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.card h3 { font-size: 16px; margin-bottom: 8px; }
.card p { font-size: 13px; color: #666; margin-bottom: 4px; }
.card-actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================================ */
/* ===== 业主端（移动端优先） ===== */
/* ============================================ */
.client-body { background: #fafafa; padding-bottom: 80px; }

.client-header {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  color: #fff; padding: 24px 16px;
}
.client-header h1 { font-size: 22px; margin-bottom: 4px; }
.client-header p { font-size: 14px; opacity: .8; }

.client-tabs {
  display: flex; overflow-x: auto; gap: 8px; padding: 12px 16px;
  position: sticky; top: 0; background: #fafafa; z-index: 50;
  -webkit-overflow-scrolling: touch;
}
.client-tabs::-webkit-scrollbar { display: none; }
.tab {
  white-space: nowrap; padding: 6px 16px; border-radius: 20px;
  border: 1px solid #ddd; background: #fff; font-size: 13px; cursor: pointer;
}
.tab.active { background: #1a1a2e; color: #fff; border-color: #1a1a2e; }

.client-content { padding: 0 16px; }

.material-card {
  display: flex; gap: 12px; background: #fff; border-radius: 10px;
  padding: 12px; margin-bottom: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.06);
  align-items: center;
}
.material-img {
  width: 72px; height: 72px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 12px; color: #999;
}
.material-info { flex: 1; min-width: 0; }
.material-info h3 { font-size: 15px; margin-bottom: 2px; }
.material-meta { font-size: 12px; color: #888; margin-bottom: 2px; }
.material-price { font-size: 14px; font-weight: 600; color: #e74c3c; }
.material-tag {
  display: inline-block; font-size: 11px; background: #f0f0f0;
  padding: 2px 8px; border-radius: 10px; margin-top: 4px; color: #666;
}

.material-check {
  position: relative; width: 24px; height: 24px; flex-shrink: 0;
}
.material-check input { opacity: 0; width: 0; height: 0; }
.checkmark {
  position: absolute; inset: 0; border: 2px solid #ddd; border-radius: 50%;
  cursor: pointer;
}
.material-check input:checked + .checkmark {
  background: #1a1a2e; border-color: #1a1a2e;
}
.material-check input:checked + .checkmark::after {
  content: '✓'; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px;
}

.client-cart {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff; padding: 12px 16px;
  display: flex; justify-content: space-between; align-items: center;
  box-shadow: 0 -2px 8px rgba(0,0,0,.08); z-index: 100;
}
.client-cart span { font-size: 14px; }
