/* ============ 宠安星 全局样式 ============ */
:root {
  --primary: #E53935;
  --primary-light: #FF5252;
  --primary-dark: #C62828;
  --bg: #FAFAFA;
  --text: #333333;
  --text-light: #666;
  --border: #eee;
  --white: #fff;
  --success: #4CAF50;
  --warning: #FF9800;
  --info: #2196F3;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 14px;
}
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea {
  font-family: inherit; font-size: 14px; padding: 10px 12px;
  border: 1px solid #ddd; border-radius: var(--radius); width: 100%;
  outline: none; transition: border-color .2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
textarea { resize: vertical; min-height: 80px; }

/* ============ 按钮 ============ */
.btn {
  display: inline-block; padding: 10px 22px; border: none; border-radius: var(--radius);
  font-size: 14px; font-weight: 500; transition: all .2s; text-align: center;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-danger { background: var(--primary); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-block { display: block; width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ============ 导航栏 ============ */
.navbar {
  background: #fff; box-shadow: var(--shadow); position: sticky; top: 0; z-index: 100;
}
.navbar-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between; height: 64px;
}
.logo { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 700; color: var(--primary); }
.logo img { width: 32px; height: 32px; }
.nav-links { display: flex; gap: 28px; list-style: none; }
.nav-links a { color: var(--text); font-weight: 500; }
.nav-links a:hover, .nav-links a.active { color: var(--primary); }
.nav-actions { display: flex; gap: 12px; }

/* ============ Hero ============ */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff; text-align: center; padding: 80px 20px;
}
.hero h1 { font-size: 42px; margin-bottom: 16px; font-weight: 700; }
.hero p { font-size: 18px; opacity: .9; margin-bottom: 32px; }
.hero-btns { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.hero .btn-white { background: #fff; color: var(--primary); }
.hero .btn-ghost { background: transparent; color: #fff; border: 2px solid #fff; }

/* ============ 通用容器 ============ */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.section { padding: 60px 0; }
.section-title { text-align: center; font-size: 28px; margin-bottom: 12px; }
.section-sub { text-align: center; color: var(--text-light); margin-bottom: 40px; }

/* ============ 卡片网格 ============ */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.card {
  background: #fff; border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow); transition: transform .2s;
}
.card:hover { transform: translateY(-4px); }
.card-icon { font-size: 40px; margin-bottom: 16px; }
.card h3 { margin-bottom: 10px; }
.card p { color: var(--text-light); }

/* ============ 宠托师卡片 ============ */
.sitter-card { text-align: center; }
.sitter-avatar {
  width: 80px; height: 80px; border-radius: 50%; background: #ffebee;
  display: flex; align-items: center; justify-content: center; font-size: 36px;
  margin: 0 auto 12px;
}
.rating { color: #FFC107; }

/* ============ 页脚 ============ */
.footer {
  background: #222; color: #aaa; padding: 40px 20px 20px; margin-top: 60px;
}
.footer-inner { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; }
.footer h4 { color: #fff; margin-bottom: 14px; }
.footer ul { list-style: none; }
.footer li { margin-bottom: 8px; }
.footer a { color: #aaa; }
.footer a:hover { color: #fff; }
.footer-bottom { text-align: center; margin-top: 30px; padding-top: 20px; border-top: 1px solid #333; }

/* ============ 登录页 ============ */
.login-page {
  min-height: calc(100vh - 64px); display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #fff5f5 0%, #ffebee 100%); padding: 40px 20px;
}
.login-box {
  background: #fff; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.1);
  padding: 40px; width: 100%; max-width: 420px;
}
.login-tabs { display: flex; margin-bottom: 28px; border-bottom: 2px solid var(--border); }
.login-tabs button {
  flex: 1; background: none; border: none; padding: 12px; font-size: 16px;
  color: var(--text-light); border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.login-tabs button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; }
.role-select { display: flex; gap: 10px; }
.role-select label {
  flex: 1; text-align: center; padding: 10px; border: 1px solid #ddd; border-radius: var(--radius);
  cursor: pointer; margin: 0;
}
.role-select input { display: none; }
.role-select input:checked + span { color: var(--primary); }
.role-select label:has(input:checked) { border-color: var(--primary); background: #ffebee; }
.admin-login-hint {
  margin-top: 16px; text-align: center; padding: 10px; background: #fff3e0;
  border-radius: var(--radius); font-size: 13px; color: #e65100;
}

/* ============ Dashboard 布局 ============ */
.dash-layout { display: flex; min-height: calc(100vh - 64px); }
.sidebar {
  width: 220px; background: #fff; border-right: 1px solid var(--border);
  padding: 20px 0; flex-shrink: 0;
}
.sidebar ul { list-style: none; }
.sidebar li a {
  display: flex; align-items: center; gap: 10px; padding: 12px 24px;
  color: var(--text); border-left: 3px solid transparent;
}
.sidebar li a:hover { background: #fafafa; }
.sidebar li a.active { color: var(--primary); border-left-color: var(--primary); background: #ffebee; font-weight: 600; }
.dash-main { flex: 1; padding: 24px; overflow-x: hidden; }
.page-title { font-size: 22px; margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center; }

/* ============ 统计卡片 ============ */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.stat-card .label { color: var(--text-light); font-size: 13px; margin-bottom: 8px; }
.stat-card .value { font-size: 26px; font-weight: 700; color: var(--primary); }
.stat-card .sub { font-size: 12px; color: var(--text-light); margin-top: 4px; }

/* ============ 表格 ============ */
.table-wrap { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: #fafafa; font-weight: 600; font-size: 13px; }
tr:hover td { background: #fcfcfc; }

/* ============ 状态标签 ============ */
.tag { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; }
.tag-pending { background: #fff3e0; color: #e65100; }
.tag-accepted { background: #e3f2fd; color: #1565c0; }
.tag-ongoing { background: #f3e5f5; color: #7b1fa2; }
.tag-completed { background: #e8f5e9; color: #2e7d32; }
.tag-cancelled { background: #ffebee; color: #c62828; }
.tag-verified { background: #e8f5e9; color: #2e7d32; }
.tag-unverified { background: #fff3e0; color: #e65100; }

/* ============ 筛选栏 ============ */
.filter-bar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.filter-bar select, .filter-bar input { width: auto; }

/* ============ 模态框 ============ */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 1000;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff; border-radius: 12px; padding: 28px; width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
}
.modal h3 { margin-bottom: 20px; }
.modal-close { float: right; background: none; border: none; font-size: 22px; color: #999; }

/* ============ 空状态 ============ */
.empty { text-align: center; padding: 60px 20px; color: #999; }
.empty .icon { font-size: 48px; margin-bottom: 12px; }

/* ============ 弹窗提示 ============ */
.toast {
  position: fixed; top: 80px; left: 50%; transform: translateX(-50%);
  background: #333; color: #fff; padding: 12px 24px; border-radius: 24px;
  z-index: 2000; opacity: 0; transition: opacity .3s; pointer-events: none;
}
.toast.show { opacity: 1; }
.toast.success { background: var(--success); }
.toast.error { background: var(--primary); }

/* ============ 签名板 ============ */
.signature-pad {
  border: 2px dashed #ccc; border-radius: var(--radius); background: #fff;
  width: 100%; height: 180px; touch-action: none; cursor: crosshair;
}

/* ============ 星星评分 ============ */
.star-rating { display: inline-flex; gap: 4px; cursor: pointer; font-size: 24px; }
.star-rating .star { color: #ddd; }
.star-rating .star.active { color: #FFC107; }

/* ============ 打卡网格 ============ */
.checkin-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 16px 0; }
.checkin-item {
  background: #fff; border: 2px solid var(--border); border-radius: var(--radius);
  padding: 16px; text-align: center; cursor: pointer; transition: all .2s;
}
.checkin-item.done { border-color: var(--success); background: #e8f5e9; }
.checkin-item .icon { font-size: 28px; margin-bottom: 6px; }
.checkin-item .time { font-size: 11px; color: var(--text-light); margin-top: 4px; }

/* ============ 柱状图 ============ */
.chart-bar-wrap { display: flex; align-items: flex-end; gap: 12px; height: 200px; padding: 20px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.chart-bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.chart-bar .bar { width: 100%; background: var(--primary); border-radius: 4px 4px 0 0; min-height: 2px; transition: height .3s; }
.chart-bar .label { font-size: 11px; color: var(--text-light); }
.chart-bar .val { font-size: 11px; font-weight: 600; }

/* ============ 日记卡片 ============ */
.diary-card { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.diary-card .meta { color: var(--text-light); font-size: 12px; margin-bottom: 10px; }
.diary-photos { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.diary-photo {
  width: 100px; height: 100px; border-radius: var(--radius); background: #ffebee;
  display: flex; align-items: center; justify-content: center; font-size: 32px;
}

/* ============ 图片预览 ============ */
.photo-preview { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.photo-preview .thumb {
  width: 80px; height: 80px; border-radius: var(--radius); background: #ffebee;
  display: flex; align-items: center; justify-content: center; font-size: 28px;
}

/* ============ 公共页面 ============ */
.public-page { max-width: 800px; margin: 0 auto; padding: 40px 20px; }
.public-page h1 { margin-bottom: 24px; }
.public-page h2 { margin: 24px 0 12px; color: var(--primary); }
.public-page p, .public-page li { margin-bottom: 10px; color: var(--text-light); }
.faq-item { background: #fff; border-radius: var(--radius); padding: 16px 20px; margin-bottom: 12px; box-shadow: var(--shadow); }
.faq-item h4 { margin-bottom: 8px; }

/* ============ 响应式 ============ */
@media (max-width: 1199px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 767px) {
  .nav-links { display: none; }
  .hero h1 { font-size: 28px; }
  .hero { padding: 50px 16px; }
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .dash-layout { flex-direction: column; }
  .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); padding: 10px 0; }
  .sidebar ul { display: flex; overflow-x: auto; }
  .sidebar li a { border-left: none; border-bottom: 3px solid transparent; white-space: nowrap; padding: 10px 16px; }
  .sidebar li a.active { border-bottom-color: var(--primary); }
  .dash-main { padding: 16px; }
  .checkin-grid { grid-template-columns: repeat(3, 1fr); }
  .section { padding: 40px 0; }
}
