/* MeowHome 喵喵之家 — 主题样式
   米白背景 / 黑色文字 / 橙色高亮 / 网格卡片 / 轻弥散阴影 / 微柔和圆角 */

:root {
  --bg: #FAF8F2;            /* 偏白米白 */
  --card: #FFFFFF;
  --ink: #26231D;           /* 近黑文字 */
  --muted: #8E8778;
  --line: #EFEAE0;
  --accent: #E8833A;        /* 高亮橙 */
  --accent-deep: #C96A1E;
  --accent-soft: #FCEEDF;
  --green: #7EB66A;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(90, 66, 20, .04), 0 6px 24px rgba(90, 66, 20, .07);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Nunito', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 15px;
  line-height: 1.65;
  background-image: radial-gradient(1100px 420px at 12% -8%, #FDF3E3 0%, rgba(253, 243, 227, 0) 60%);
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 36px 22px 64px; }

/* ---------- 页头 ---------- */
.site-header h1 { margin: 0; font-size: 33px; font-weight: 900; letter-spacing: .4px; }
.site-header h1 .cn { margin-left: 10px; }
.site-header .subtitle { margin: 7px 0 0; color: var(--muted); font-size: 14.5px; letter-spacing: 3px; }

/* ---------- 卡片网格 ---------- */
.cards {
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(345px, 100%), 1fr));
  gap: 22px;
  grid-auto-flow: dense;
}
.card {
  background: var(--card);
  border: 1px solid rgba(239, 234, 224, .6);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px 24px;
  min-width: 0;
}
@media (min-width: 1080px) { .card.wide { grid-column: span 2; } }

.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.card-head h2 { margin: 0; font-size: 16.5px; font-weight: 800; letter-spacing: .5px; }
.card-icon {
  flex: none;
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 11px;
}
.card-icon svg { width: 19px; height: 19px; }

.month-badge { font-size: 12.5px; font-weight: 700; color: var(--muted); margin-left: 6px; letter-spacing: 1px; }

/* 数据高亮 */
.hl { color: var(--accent-deep); font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- 使用时间 ---------- */
.sentence { margin: 0 0 10px; font-size: 15.5px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart text.axis { fill: var(--muted); font-size: 10.5px; font-family: inherit; }
.chart text.axis.axis-today { fill: var(--accent-deep); font-weight: 800; }
.chart text.pt-label { fill: var(--accent-deep); font-size: 11.5px; font-weight: 800; font-family: inherit; }

/* ---------- 压力释放指数 ---------- */
.gauge-box svg { width: 100%; max-width: 300px; height: auto; display: block; margin: 0 auto; }
.gauge-box text.axis { fill: var(--muted); font-size: 11px; font-family: inherit; }
.stat-grid {
  margin-top: 14px;
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px dashed var(--line);
  padding-top: 14px; gap: 8px;
}
.stat { text-align: center; min-width: 0; }
.stat .k { display: block; font-size: 12px; color: var(--muted); letter-spacing: .5px; }
.stat .v { display: block; font-size: 17px; font-weight: 800; margin-top: 3px; font-variant-numeric: tabular-nums; }

/* ---------- 使用时段分析 ---------- */
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut { flex: none; width: 196px; }
.donut text.donut-total { fill: var(--ink); font-size: 22px; font-weight: 900; font-family: inherit; }
.donut text.donut-sub { fill: var(--muted); font-size: 11px; font-family: inherit; }
.legend { flex: 1; min-width: 130px; display: flex; flex-direction: column; gap: 9px; }
.lg-row { display: flex; align-items: center; gap: 9px; font-size: 14px; }
.lg-row .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.lg-row .hl { margin-left: auto; }
.empty {
  width: 100%; padding: 34px 10px; text-align: center;
  color: var(--muted); font-size: 13.5px;
  border: 1.5px dashed var(--line); border-radius: 12px;
}

/* ---------- 陪伴日历 ---------- */
.cal-week-row {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px;
  color: var(--muted); font-size: 12px; text-align: center; margin-bottom: 7px;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; }
.cell {
  position: relative;
  height: 52px;
  background: #FBF9F4;
  border-radius: 11px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
  color: var(--ink);
}
.cell.blank { background: transparent; }
.cell.today { outline: 2px solid var(--accent); outline-offset: -2px; font-weight: 800; }
.cell .paw { width: 15px; height: 15px; color: var(--accent); margin-top: 2px; }

/* ---------- 设置禁用时段 ---------- */
.range-block { margin-bottom: 18px; }
.range-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13.5px; color: var(--muted); margin-bottom: 2px;
}
.range-head output { font-size: 16px; font-weight: 800; }

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 30px; background: transparent; cursor: pointer; margin: 0;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 8px; border-radius: 99px;
  background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--p, 50%), #ECE7DC var(--p, 50%), #ECE7DC 100%);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 2.5px solid var(--accent);
  box-shadow: 0 2px 6px rgba(90, 66, 20, .2);
  margin-top: -6px;
}
input[type="range"]::-moz-range-track { height: 8px; border-radius: 99px; background: #ECE7DC; }
input[type="range"]::-moz-range-progress { height: 8px; border-radius: 99px; background: var(--accent); }
input[type="range"]::-moz-range-thumb {
  width: 15px; height: 15px; border-radius: 50%;
  background: #fff; border: 2.5px solid var(--accent);
  box-shadow: 0 2px 6px rgba(90, 66, 20, .2);
}

.crossday { font-size: 12.5px; color: var(--muted); margin: -6px 0 12px; }

.key-row { display: flex; gap: 8px; margin: 4px 0 12px; }
.key-row input {
  flex: 1; min-width: 0;
  font: inherit; font-size: 13.5px;
  padding: 8px 12px;
  border: 1.5px solid var(--line); border-radius: 10px;
  background: #FDFCF9; color: var(--ink);
  outline: none;
}
.key-row input:focus { border-color: var(--accent); }

.actions { display: flex; gap: 10px; align-items: center; }
.linklike {
  margin-left: auto;
  border: none; background: none; cursor: pointer;
  font: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--muted); text-decoration: underline dotted;
  padding: 4px 2px;
}
.linklike:hover { color: var(--accent-deep); }
.btn-primary {
  border: none; cursor: pointer;
  background: var(--accent); color: #fff;
  font: inherit; font-weight: 800; font-size: 14px;
  padding: 9px 26px; border-radius: 999px;
  box-shadow: 0 4px 14px rgba(232, 131, 58, .35);
  transition: transform .12s ease, background .2s;
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary.enabled { background: var(--green); box-shadow: 0 4px 14px rgba(126, 182, 106, .35); }
.btn-primary:disabled, .btn-ghost:disabled { opacity: .55; cursor: default; transform: none; box-shadow: none; }
.btn-ghost {
  border: 1.5px solid var(--line); cursor: pointer;
  background: #fff; color: var(--muted);
  font: inherit; font-weight: 700; font-size: 13.5px;
  padding: 8px 20px; border-radius: 999px;
}
.btn-ghost:hover { color: var(--ink); border-color: #DDD6C8; }
.hint { font-size: 12.5px; color: var(--muted); margin: 14px 0 0; line-height: 1.6; }

.hidden { display: none !important; }

/* ---------- 入场动效：从上到下依次浮现（仅在不减少动效的环境） ---------- */
@media (prefers-reduced-motion: no-preference) {
  @keyframes rise-in {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .site-header { animation: rise-in .5s ease-out both; }
  .card { animation: rise-in .55s ease-out both; }
  .card:nth-child(1) { animation-delay: .08s; }
  .card:nth-child(2) { animation-delay: .18s; }
  .card:nth-child(3) { animation-delay: .28s; }
  .card:nth-child(4) { animation-delay: .38s; }
  .card:nth-child(5) { animation-delay: .48s; }
  .site-footer { animation: rise-in .5s ease-out .6s both; }
}
/* 兜底：若环境冻结了动画（个别 WebView/后台标签），加载后强制显示，绝不让页面空白 */
.no-anim .site-header, .no-anim .card, .no-anim .site-footer { animation: none !important; }

/* ---------- 页脚 / 提示 ---------- */
.site-footer {
  margin-top: 44px; text-align: center;
  color: var(--muted); font-size: 12.5px; letter-spacing: 1px;
}
.paw-foot { width: 15px; height: 15px; color: var(--accent); opacity: .55; vertical-align: -2px; margin-right: 6px; }
.heart { color: #E05B5B; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(16px);
  background: #2E2A22; color: #FDF9F0;
  font-size: 13.5px; line-height: 1.5;
  padding: 10px 20px; border-radius: 12px;
  box-shadow: 0 10px 30px rgba(40, 30, 10, .25);
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  max-width: min(86vw, 480px); text-align: center; z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 520px) {
  .site-header h1 { font-size: 27px; }
  .cell { height: 44px; border-radius: 9px; font-size: 12px; }
  .donut { width: 168px; }
}
