/* ── Tools: Calculator + Pomodoro + Maker sites ─────────────────── */

/* Maker sites list (简介为主，不起名) */
.maker-site-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 14px 14px 12px;
  cursor: pointer;
}

.maker-site-main {
  width: 100%;
}

.maker-site-desc {
  font-size: 14.5px !important;
  font-weight: 600 !important;
  line-height: 1.45 !important;
  white-space: normal !important;
  display: block !important;
}

.maker-site-url {
  margin-top: 4px;
  font-size: 12px !important;
  word-break: break-all;
  opacity: 0.7;
}

.maker-site-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.maker-site-btns .btn {
  min-height: 42px;
  border-radius: 12px;
  font-size: 14px;
}

/* ── Tools: Calculator + Pomodoro (premium, Edge-first) ─────────── */

.calc-scroll,
.pom-scroll {
  padding-bottom: calc(24px + var(--safe-bottom, 0px));
}

/* Calculator */
.calc-body {
  padding: 8px 12px 20px;
  max-width: 480px;
  margin: 0 auto;
}

.calc-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.calc-tab {
  border: 1px solid rgba(127, 127, 127, 0.25);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 12px;
  padding: 10px 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: inherit;
  cursor: pointer;
}

.calc-tab.active {
  background: linear-gradient(135deg, #5c6bc0, #7e57c2);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(94, 53, 177, 0.28);
}

[data-theme="dark"] .calc-tab {
  background: rgba(40, 40, 48, 0.75);
}

.calc-screen-card {
  background: linear-gradient(160deg, rgba(20, 22, 40, 0.92), rgba(30, 28, 48, 0.88));
  color: #e8eaf6;
  border-radius: 18px;
  padding: 14px 16px 12px;
  margin-bottom: 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  min-height: 96px;
}

.calc-expr {
  font-size: 13px;
  opacity: 0.65;
  min-height: 1.2em;
  word-break: break-all;
  text-align: right;
}

.calc-display {
  font-size: clamp(28px, 8vw, 40px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  text-align: right;
  margin-top: 4px;
  word-break: break-all;
  line-height: 1.15;
}

.calc-meta {
  margin-top: 8px;
  font-size: 11.5px;
  opacity: 0.55;
  text-align: right;
}

.calc-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.calc-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.calc-key {
  appearance: none;
  border: none;
  border-radius: 14px;
  min-height: 52px;
  font-size: 18px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.72);
  color: #1a1a1a;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s;
  touch-action: manipulation;
  user-select: none;
}

.calc-key:active {
  transform: scale(0.96);
}

.calc-key.mini {
  min-height: 40px;
  font-size: 13px;
  border-radius: 12px;
}

.calc-key.op {
  background: rgba(92, 107, 192, 0.18);
  color: #3949ab;
}

.calc-key.primary {
  background: linear-gradient(145deg, #5c6bc0, #7e57c2);
  color: #fff;
}

.calc-key.danger {
  background: rgba(239, 83, 80, 0.15);
  color: #c62828;
}

.calc-key.active {
  outline: 2px solid #7e57c2;
}

.calc-key.swap {
  min-height: 44px;
  margin-top: 18px;
}

[data-theme="dark"] .calc-key {
  background: rgba(50, 50, 60, 0.9);
  color: #f5f5f5;
}

[data-theme="dark"] .calc-key.op {
  background: rgba(121, 134, 203, 0.25);
  color: #c5cae9;
}

.calc-hist {
  margin-top: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.45);
  padding: 10px 12px;
}

[data-theme="dark"] .calc-hist {
  background: rgba(30, 30, 38, 0.65);
}

.calc-hist-title {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.calc-link {
  border: none;
  background: none;
  color: #5c6bc0;
  font-size: 12px;
  cursor: pointer;
}

.calc-hist-item {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 8px 4px;
  border-bottom: 1px solid rgba(127, 127, 127, 0.12);
  cursor: pointer;
  color: inherit;
}

.chi-expr {
  display: block;
  font-size: 12px;
  opacity: 0.65;
}

.chi-res {
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.calc-hist-empty {
  font-size: 12.5px;
  opacity: 0.55;
  text-align: center;
  margin: 8px 0;
}

/* Unit converter */
.unit-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.unit-cat {
  border: 1px solid rgba(127, 127, 127, 0.22);
  background: rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12.5px;
  cursor: pointer;
  color: inherit;
}

.unit-cat.active {
  background: #5c6bc0;
  color: #fff;
  border-color: transparent;
}

.unit-io {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.unit-row-pair {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: end;
}

.unit-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  opacity: 0.9;
  min-width: 0;
}

.unit-field input,
.unit-field select {
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(127, 127, 127, 0.28);
  padding: 0 12px;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.85);
  color: inherit;
}

[data-theme="dark"] .unit-field input,
[data-theme="dark"] .unit-field select {
  background: rgba(40, 40, 48, 0.95);
  color: #eee;
}

.unit-result {
  margin-top: 12px;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(92, 107, 192, 0.15), rgba(126, 87, 194, 0.18));
  text-align: center;
}

.unit-result-label {
  font-size: 12px;
  opacity: 0.65;
}

.unit-result-val {
  font-size: 28px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
  word-break: break-all;
}

.unit-result-unit {
  margin-top: 4px;
  font-size: 13px;
  opacity: 0.7;
  font-weight: 600;
}

.unit-fx-btn {
  width: 100%;
  margin-top: 12px;
  min-height: 46px;
}

.unit-fx-note {
  font-size: 12px;
  opacity: 0.6;
  text-align: center;
  margin: 8px 0 0;
}

/* Pomodoro */
.pom-body {
  padding: 8px 14px 28px;
  max-width: 440px;
  margin: 0 auto;
}

.pom-hero {
  border-radius: 24px;
  padding: 16px 14px 18px;
  background: linear-gradient(165deg, #1a237e 0%, #311b92 45%, #4a148c 100%);
  color: #fff;
  box-shadow: 0 16px 40px rgba(49, 27, 146, 0.35);
  margin-bottom: 14px;
}

.pom-hero.is-short {
  background: linear-gradient(165deg, #00695c 0%, #00897b 50%, #26a69a 100%);
  box-shadow: 0 16px 40px rgba(0, 105, 92, 0.32);
}

.pom-hero.is-long {
  background: linear-gradient(165deg, #0d47a1 0%, #1565c0 50%, #42a5f5 100%);
  box-shadow: 0 16px 40px rgba(13, 71, 161, 0.32);
}

.pom-modes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}

.pom-mode-btn {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  padding: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.pom-mode-btn.active {
  background: rgba(255, 255, 255, 0.95);
  color: #311b92;
  border-color: transparent;
}

.pom-hero.is-short .pom-mode-btn.active {
  color: #004d40;
}

.pom-hero.is-long .pom-mode-btn.active {
  color: #0d47a1;
}

.pom-ring-wrap {
  position: relative;
  width: min(260px, 72vw);
  height: min(260px, 72vw);
  margin: 8px auto 12px;
}

.pom-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.pom-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 8;
}

.pom-ring-fg {
  fill: none;
  stroke: #fff;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.2s linear;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.45));
}

.pom-clock-stack {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

.pom-mode-label {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.8;
  font-weight: 600;
}

.pom-clock {
  font-size: clamp(40px, 12vw, 52px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  margin: 4px 0;
}

.pom-session {
  font-size: 12px;
  opacity: 0.75;
}

.pom-label-row {
  margin: 0 4px 12px;
}

.pom-label-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.18);
  color: #fff;
  border-radius: 12px;
  min-height: 42px;
  padding: 0 12px;
  font-size: 14px;
}

.pom-label-input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.pom-actions {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: 8px;
  align-items: center;
}

.pom-btn {
  min-height: 48px;
  border-radius: 14px !important;
}

.pom-hero .btn-ghost {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
}

.pom-hero .btn-primary {
  background: #fff !important;
  color: #311b92 !important;
  border: none !important;
  font-weight: 700;
  font-size: 16px;
}

.pom-hero.is-short .btn-primary {
  color: #004d40 !important;
}

.pom-hero.is-long .btn-primary {
  color: #0d47a1 !important;
}

.card-block {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

[data-theme="dark"] .card-block {
  background: rgba(32, 32, 40, 0.72);
  border-color: rgba(255, 255, 255, 0.08);
}

.pom-stats-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
}

.pom-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  text-align: center;
  margin-bottom: 12px;
}

.pom-stat b {
  display: block;
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.pom-stat span {
  font-size: 11px;
  opacity: 0.6;
}

.pom-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  align-items: end;
  height: 72px;
  margin-bottom: 10px;
}

.pom-week-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 4px;
}

.pom-week-bar {
  width: 70%;
  min-height: 6px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #7e57c2, #5c6bc0);
  align-self: center;
  transition: height 0.25s ease;
}

.pom-week-col span {
  font-size: 10px;
  opacity: 0.55;
}

.pom-goal-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(127, 127, 127, 0.15);
  overflow: hidden;
}

.pom-goal-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #5c6bc0, #ab47bc);
  transition: width 0.3s ease;
}

.pom-goal-note {
  font-size: 12px;
  opacity: 0.6;
  margin: 8px 0 0;
}

.pom-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.pom-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}

.pom-field input {
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(127, 127, 127, 0.28);
  padding: 0 10px;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.8);
  color: inherit;
}

[data-theme="dark"] .pom-field input {
  background: rgba(40, 40, 48, 0.95);
}

.pom-toggles {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pom-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(127, 127, 127, 0.1);
}

.pom-toggle input {
  width: 18px;
  height: 18px;
  accent-color: #5c6bc0;
}

.pom-notify-btn {
  width: 100%;
  margin-top: 12px;
  min-height: 44px;
}

/* ── Custom photo bg: transparent tool frames (not frosted) ── */
html[data-bg="custom"] .calc-tab,
html[data-bg="custom"] .card-block,
html[data-bg="custom"][data-ui] .calc-tab,
html[data-bg="custom"][data-ui] .card-block,
html[data-bg="custom"][data-theme] .calc-tab,
html[data-bg="custom"][data-theme] .card-block,
html[data-bg="custom"][data-ui][data-theme] .calc-tab,
html[data-bg="custom"][data-ui][data-theme] .card-block {
  background: transparent !important;
  background-image: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
  border: 1px solid rgba(255, 255, 255, 0.45) !important;
  color: #fff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85) !important;
}

html[data-bg="custom"] .calc-tab.active,
html[data-bg="custom"][data-ui] .calc-tab.active,
html[data-bg="custom"][data-ui][data-theme] .calc-tab.active {
  background: rgba(255, 255, 255, 0.22) !important;
  border-color: #fff !important;
  color: #fff !important;
  box-shadow: none !important;
}

html[data-bg="custom"] .pom-stats-title,
html[data-bg="custom"] .pom-stat b,
html[data-bg="custom"] .pom-stat span,
html[data-bg="custom"] .pom-goal-note,
html[data-bg="custom"] .pom-toggle,
html[data-bg="custom"] .pom-field,
html[data-bg="custom"][data-ui] .pom-stats-title,
html[data-bg="custom"][data-ui][data-theme] .pom-stats-title {
  color: #fff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85) !important;
}

html[data-bg="custom"] .pom-field input,
html[data-bg="custom"][data-ui] .pom-field input,
html[data-bg="custom"][data-ui][data-theme] .pom-field input {
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.45) !important;
  color: #fff !important;
}

/* Keep calculator display readable (device screen, not chrome frame) */
html[data-bg="custom"] .calc-screen-card {
  background: linear-gradient(160deg, rgba(20, 22, 40, 0.88), rgba(30, 28, 48, 0.84)) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
