:root {
  --ink: #274d63;
  --ink-strong: #16455e;
  --ink-soft: #7e9aac;
  --ink-faint: #a5bccb;
  --accent: #0e86c9;
  --accent-soft: #3aaede;
  --teal: #0fb49c;
  --card: rgba(255, 255, 255, 0.72);
  --card-strong: rgba(255, 255, 255, 0.9);
  --line: rgba(255, 255, 255, 0.9);
  --shadow: 0 16px 36px -22px rgba(30, 84, 116, 0.35);
  --radius-card: 28px;
  --radius-inner: 18px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  margin: 0;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 12% -8%, #dcf1fd 0%, transparent 58%),
    radial-gradient(1000px 620px at 106% 10%, #dcfaf3 0%, transparent 52%),
    radial-gradient(900px 520px at 50% 112%, #e6f6fd 0%, transparent 62%),
    linear-gradient(176deg, #f7fcff 0%, #eef7fc 55%, #eaf6f4 100%);
  min-height: 100svh;
  overflow-x: hidden;
}

.blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(72px);
  opacity: 0.32;
  pointer-events: none;
  z-index: 0;
}

.blob-a { width: 340px; height: 340px; background: #b5e1fb; top: -110px; left: -100px; }
.blob-b { width: 300px; height: 300px; background: #b7f3e9; bottom: -100px; right: -80px; }

.shell {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: 0 20px;
}

/* ---------- 页面切换 ---------- */

.page {
  display: none;
  flex: 1;
  flex-direction: column;
  gap: 18px;
  padding: 26px 0 104px;
  animation: page-in 0.3s cubic-bezier(0.25, 1, 0.35, 1);
}

.page.is-active {
  display: flex;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 记录页头部 ---------- */

.rec-header {
  text-align: center;
  padding-top: 6px;
}

.app-name {
  font-size: 17px;
  letter-spacing: 1.5px;
  color: var(--ink-soft);
  font-weight: 600;
}

.today-total {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.tt-label {
  font-size: 13px;
  letter-spacing: 3px;
  color: var(--ink-soft);
  font-weight: 500;
}

.tt-value {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.tt-value strong {
  font-size: 42px;
  line-height: 1;
  color: var(--accent);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
  display: inline-block;
}

.tt-value strong.pop {
  animation: pop 0.4s ease;
}

@keyframes pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.tt-unit {
  font-size: 14px;
  color: var(--ink-soft);
  font-style: normal;
  font-weight: 500;
}

/* ---------- 加减按钮 ---------- */

.cup-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 10px 0 2px;
}

.btn-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.adj-btn {
  width: 88px;
  height: 56px;
  border-radius: 22px;
  border: 1px solid var(--line);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: transform 0.16s ease, box-shadow 0.2s ease, filter 0.2s ease;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3px;
}

.adj-btn.plus {
  color: #ffffff;
  background: linear-gradient(155deg, #5cc8f2 0%, #1391d3 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 14px 26px -16px rgba(19, 145, 211, 0.85);
  border-color: rgba(255, 255, 255, 0.35);
}

.adj-btn.minus {
  color: #8ba3b4;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 22px -18px rgba(30, 84, 116, 0.55);
}

.adj-btn:hover { transform: translateY(-2px); filter: brightness(1.04); }
.adj-btn:active { transform: scale(0.94); }

/* ---------- 水杯 ---------- */

.cup-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cup {
  position: relative;
  width: 176px;
  height: 230px;
}

.cup-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.water-group {
  transform: translateY(155px);
  transition: transform 0.8s cubic-bezier(0.25, 1, 0.35, 1);
}

.bub {
  animation: bub-rise 3.4s ease-in infinite;
}

.bub-2 { animation-duration: 4.3s; animation-delay: -1.5s; }
.bub-3 { animation-duration: 5.2s; animation-delay: -2.8s; }

@keyframes bub-rise {
  0% { transform: translateY(0); opacity: 0; }
  15% { opacity: 0.75; }
  80% { opacity: 0.4; }
  100% { transform: translateY(-92px); opacity: 0; }
}

.cup-reading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 4;
  pointer-events: none;
  color: var(--ink-strong);
}

.cup-num {
  font-size: 36px;
  font-weight: 650;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}

.cup-unit {
  font-size: 10.5px;
  letter-spacing: 3px;
  margin-top: 5px;
  opacity: 0.65;
  font-weight: 500;
}

.cup-shadow {
  width: 116px;
  height: 13px;
  border-radius: 50%;
  background: rgba(30, 84, 116, 0.12);
  filter: blur(7px);
  margin-top: 8px;
}

/* ---------- 保存按钮 ---------- */

.save-btn {
  align-self: center;
  min-width: 230px;
  padding: 15px 40px;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 3px;
  color: #ffffff;
  background: linear-gradient(150deg, #55c5f1 0%, #0e86c9 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 16px 30px -16px rgba(14, 134, 201, 0.75);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.save-btn:hover:not(:disabled) { transform: translateY(-2px); }
.save-btn:active:not(:disabled) { transform: scale(0.96); }

.save-btn:disabled {
  opacity: 0.45;
  cursor: default;
  box-shadow: none;
}

/* ---------- 今日记录列表 ---------- */

.today-log {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 18px 16px 14px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.section-title {
  font-size: 12.5px;
  letter-spacing: 2px;
  color: var(--ink-soft);
  margin-bottom: 12px;
  font-weight: 600;
  padding-left: 4px;
}

.log-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 240px;
  overflow-y: auto;
  scrollbar-width: none;
}

.log-list::-webkit-scrollbar {
  display: none;
}

.log-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-inner);
  background: var(--card-strong);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 18px -14px rgba(30, 84, 116, 0.4);
  animation: slide-in 0.3s cubic-bezier(0.25, 1, 0.35, 1);
}

@keyframes slide-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.log-dot {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(155deg, #eaf8ff, #d5effb);
  flex: none;
}

.log-dot svg {
  width: 17px;
  height: 17px;
  display: block;
}

.log-time {
  flex: 1;
  font-size: 13px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}

.log-ml {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.empty {
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-faint);
  padding: 14px 0 10px;
}

/* ---------- 趋势页 ---------- */

.page-header {
  text-align: center;
}

.page-title {
  font-size: 20px;
  letter-spacing: 1px;
  color: var(--ink-strong);
  font-weight: 650;
}

.page-sub {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--ink-faint);
  letter-spacing: 1px;
}

.chart-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 24px 18px 16px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  height: 218px;
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 6px;
  min-width: 0;
}

.bar-value {
  font-size: 11px;
  font-weight: 600;
  color: #6c8ba0;
  font-variant-numeric: tabular-nums;
  height: 14px;
  line-height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bar-col.today .bar-value {
  color: var(--teal);
}

.bar-track {
  width: 100%;
  max-width: 32px;
  flex: 1;
  border-radius: 12px;
  background: rgba(223, 236, 246, 0.72);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.bar-fill {
  width: 100%;
  border-radius: 12px;
  background: linear-gradient(180deg, #8fdcf5 0%, #2f9fd6 100%);
  box-shadow: 0 6px 12px -6px rgba(47, 159, 214, 0.55);
  transition: height 0.7s cubic-bezier(0.25, 1, 0.35, 1);
  min-height: 0;
}

.bar-col.today .bar-fill {
  background: linear-gradient(180deg, #6fe6d2 0%, #0fb49c 100%);
  box-shadow: 0 6px 12px -6px rgba(15, 180, 156, 0.55);
}

.bar-label {
  font-size: 10.5px;
  color: var(--ink-faint);
  white-space: nowrap;
  letter-spacing: 0.3px;
}

.bar-col.today .bar-label {
  color: var(--teal);
  font-weight: 600;
}

/* ---------- 数据总结 ---------- */

.summary-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 20px 22px 16px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.summary-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 2px;
}

.summary-row + .summary-row {
  border-top: 1px dashed rgba(126, 154, 172, 0.28);
}

.summary-label {
  font-size: 12.5px;
  color: var(--ink-soft);
  flex: none;
  letter-spacing: 1px;
}

.summary-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: normal;
  word-break: break-word;
  line-height: 1.6;
  max-width: 72%;
}

#windowText {
  white-space: pre-line;
}

/* ---------- 我的页 ---------- */

.mine-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 8px 16px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.mine-btn {
  border: none;
  background: transparent;
  font-family: inherit;
  text-align: left;
  padding: 17px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  border-radius: var(--radius-inner);
  transition: background 0.2s ease, transform 0.15s ease;
  position: relative;
}

.mine-btn + .mine-btn {
  border-top: 1px solid rgba(126, 154, 172, 0.16);
}

.mine-btn:hover { background: rgba(255, 255, 255, 0.65); }
.mine-btn:active { transform: scale(0.985); }

.mine-btn::after {
  content: "›";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 21px;
  color: var(--ink-faint);
}

.mine-btn-title {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink-strong);
}

.mine-btn-desc {
  font-size: 12px;
  color: var(--ink-soft);
  padding-right: 22px;
}

.mine-note {
  text-align: center;
  font-size: 11.5px;
  color: var(--ink-faint);
  letter-spacing: 0.5px;
}

/* ---------- 底部导航 ---------- */

.tabbar {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100% - 40px), 440px);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 26px;
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow: 0 20px 44px -20px rgba(30, 84, 116, 0.45);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 8px;
  z-index: 20;
}

.tab {
  border: none;
  background: transparent;
  font-family: inherit;
  border-radius: 18px;
  padding: 8px 0 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  color: var(--ink-faint);
  transition: background 0.22s ease, color 0.22s ease, transform 0.15s ease;
}

.tab:active { transform: scale(0.94); }

.tab.is-active {
  background: linear-gradient(155deg, #e9f7ff, #ddf3ee);
  color: var(--accent);
}

.tab-icon svg {
  width: 21px;
  height: 21px;
  display: block;
}

.tab-label {
  font-size: 11px;
  letter-spacing: 1.5px;
  font-weight: 600;
}

/* ---------- 底部弹窗（隐私说明） ---------- */

.sheet-mask {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(16, 48, 70, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.sheet-mask.show {
  opacity: 1;
}

.sheet {
  width: 100%;
  max-width: 560px;
  max-height: 90svh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #ffffff, #eef9ff);
  border-radius: 32px 32px 0 0;
  box-shadow: 0 -26px 60px -30px rgba(16, 55, 84, 0.55);
  color: var(--ink);
  transform: translateY(102%);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}

.sheet-mask.show .sheet {
  transform: translateY(0);
}

.sheet-hero {
  flex: none;
  background:
    radial-gradient(420px 170px at 85% -20%, rgba(255, 255, 255, 0.5), transparent 60%),
    linear-gradient(140deg, #45bff0, #0e86c9 60%, #0d9f92);
  padding: 26px 26px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.sheet-hero-icon {
  width: 48px;
  height: 48px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  font-size: 23px;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.45);
  flex: none;
}

.sheet-hero h2 {
  font-size: 20px;
  letter-spacing: 1.5px;
  color: #ffffff;
  font-weight: 650;
}

.sheet-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 22px 26px calc(26px + env(safe-area-inset-bottom));
}

.privacy-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.privacy-list li {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 15px 18px;
  border-radius: var(--radius-inner);
  background: var(--card-strong);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 20px -16px rgba(30, 84, 116, 0.5);
}

.privacy-list strong {
  font-size: 14.5px;
  color: var(--accent);
  letter-spacing: 1px;
  font-weight: 650;
}

.privacy-list span {
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--ink-soft);
}

.modal-close {
  margin-top: 26px;
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 15px 0;
  font-size: 15px;
  font-family: inherit;
  font-weight: 600;
  letter-spacing: 3px;
  color: #ffffff;
  background: linear-gradient(150deg, #55c5f1 0%, #0e86c9 100%);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 14px 26px -14px rgba(14, 134, 201, 0.75);
}

.modal-close:hover { transform: translateY(-1px); }
.modal-close:active { transform: scale(0.97); }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 108px;
  transform: translate(-50%, 16px);
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  border: none;
  font-size: 13px;
  line-height: 1.6;
  padding: 12px 18px;
  border-radius: var(--radius-inner);
  max-width: min(84vw, 400px);
  white-space: normal;
  word-break: break-word;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
  z-index: 50;
  box-shadow: 0 16px 30px -14px rgba(30, 84, 116, 0.45);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- 视觉隐藏（文件选择框等） ---------- */

.vis-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  pointer-events: none;
}

/* ---------- 响应式 ---------- */

@media (max-width: 380px) {
  .adj-btn { width: 74px; height: 52px; font-size: 13.5px; border-radius: 19px; }
  .cup { width: 142px; height: 188px; }
  .cup-num { font-size: 30px; }
  .tt-value strong { font-size: 36px; }
  .shell { padding: 0 16px; }
  .chart-card, .summary-card, .today-log { border-radius: 24px; }
}
