/* ===== /disk page — capacity dashboard ===== */
.disk-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.back-link {
  display: inline-block;
  color: var(--primary-dark);
  text-decoration: none;
  font-size: .95rem;
  margin: 8px 0 22px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid #f0dec8;
  transition: background .15s, transform .15s;
}
.back-link:hover { background: #fff5e9; transform: translateX(-2px); }

.stats-grid {
  display: grid;
  gap: 18px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px 26px;
  box-shadow: var(--shadow);
  position: relative;
}
.card h2 {
  margin: 0 0 14px;
  font-size: 1.1rem;
  color: var(--primary-dark);
  letter-spacing: .5px;
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px dashed #f0dec8;
  font-size: .95rem;
  flex-wrap: wrap;
}
.row:last-child { border-bottom: none; }
.row > span { color: var(--ink-soft); flex: 0 0 auto; }
.row > b   {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  text-align: right;
  overflow-wrap: anywhere;
  min-width: 0;
}
.row.total {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid #f0dec8;
  font-size: 1rem;
}
.row.total > b { color: var(--primary-dark); }
.row.hint > b {
  font-size: .85rem;
  color: var(--ink-soft);
  font-weight: 400;
  font-family: 'Caveat', 'Noto Sans TC', cursive;
}

/* Stacked bar: other-used | gallery | free */
.bar {
  position: relative;       /* anchor for the absolutely-positioned segments below */
  height: 22px;
  background: #f5e7d6;
  border-radius: 999px;
  overflow: hidden;
  margin: 10px 0 14px;
  box-shadow: inset 0 1px 3px rgba(80, 50, 30, 0.08);
}
.bar-other,
.bar-mine {
  position: absolute;
  top: 0; bottom: 0;
  transition: width .4s ease, left .4s ease;
}
.bar-other { left: 0; background: linear-gradient(90deg, #b8a89a, #8e7a6a); }
.bar-mine  { background: linear-gradient(90deg, var(--accent), var(--primary)); }

.legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: .82rem;
  color: var(--ink-soft);
  margin-bottom: 14px;
}
.legend .dot {
  display: inline-block;
  width: 11px; height: 11px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 5px;
}
.dot.other { background: #8e7a6a; }
.dot.mine  { background: var(--primary); }
.dot.free  { background: #f5e7d6; border: 1px solid #e0d0bb; }

.loading {
  text-align: center;
  color: var(--ink-soft);
  padding: 60px 20px;
  font-size: 1rem;
}
.loading.error { color: var(--danger); }

.footnote {
  text-align: center;
  font-size: .75rem;
  color: var(--ink-faint);
  margin-top: 22px;
}

@media (max-width: 640px) {
  .disk-main { padding: 0 14px 80px; }
  .card { padding: 18px 18px; }
  .card h2 { font-size: 1rem; }
  .row { font-size: .88rem; gap: 8px; }
  .legend { gap: 10px; font-size: .75rem; }
  .bar { height: 18px; margin: 8px 0 12px; }
  .back-link { font-size: .85rem; margin: 4px 0 16px; }
}
@media (max-width: 380px) {
  .disk-main { padding: 0 10px 80px; }
  .card { padding: 14px 14px; }
  .row { font-size: .82rem; }
  .row.hint > b { font-size: .8rem; }
}
