:root {
  --card-bg: rgba(24, 34, 28, 0.44);
  --card-border: rgba(255, 255, 255, 0.16);
  --card-blur: 20px;
  --wallpaper-blur: 0px;
  --wallpaper-dim: 0.22;
  --icon-size: 64px;
  --icon-radius: 18px;
  --page-max-width: 1320px;
  --page-scale: 1;
  --accent: #4ade80;
  --text-main: #ffffff;
  --text-sub: rgba(255, 255, 255, 0.72);
  --text-muted: rgba(255, 255, 255, 0.54);
  --shadow-soft: 0 12px 36px rgba(0, 0, 0, 0.26);
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--text-main);
  background: #14221b;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.hidden {
  display: none !important;
}

/* ---------- Wallpaper ---------- */
.wallpaper-bg {
  position: fixed;
  inset: -24px;
  z-index: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(var(--wallpaper-blur));
  transform: scale(1.03);
  transition: background-image 0.5s ease, filter 0.3s ease;
}

.wallpaper-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: radial-gradient(circle at 50% 20%, rgba(0, 0, 0, calc(var(--wallpaper-dim) * 0.6)), rgba(0, 0, 0, calc(var(--wallpaper-dim) + 0.14)));
  pointer-events: none;
  transition: background 0.3s ease;
}

/* Preset Wallpapers (Zero-CDN Pure CSS Art) */
.wp-forest-light {
  background-image:
    radial-gradient(ellipse at 25% 15%, rgba(163, 214, 114, 0.55) 0%, transparent 50%),
    radial-gradient(ellipse at 82% 25%, rgba(238, 210, 128, 0.36) 0%, transparent 48%),
    radial-gradient(ellipse at 50% 85%, rgba(44, 94, 52, 0.85) 0%, transparent 65%),
    linear-gradient(145deg, #3c5d37 0%, #587843 32%, #2f4b2f 68%, #1a2d1e 100%);
}
.wp-aurora-night {
  background-image:
    radial-gradient(ellipse at 20% 20%, rgba(56, 189, 248, 0.45) 0%, transparent 55%),
    radial-gradient(ellipse at 78% 18%, rgba(74, 222, 128, 0.42) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(129, 140, 248, 0.35) 0%, transparent 60%),
    linear-gradient(160deg, #0b132b 0%, #112240 48%, #0c1b2a 100%);
}
.wp-sunset-silk {
  background-image:
    radial-gradient(ellipse at 75% 22%, rgba(251, 146, 60, 0.55) 0%, transparent 52%),
    radial-gradient(ellipse at 20% 35%, rgba(244, 114, 182, 0.45) 0%, transparent 55%),
    linear-gradient(145deg, #2d1b3d 0%, #5c2c4d 45%, #1e1b2e 100%);
}
.wp-ocean-mist {
  background-image:
    radial-gradient(ellipse at 30% 25%, rgba(45, 212, 191, 0.45) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 75%, rgba(59, 130, 246, 0.42) 0%, transparent 55%),
    linear-gradient(155deg, #0f293a 0%, #164e63 45%, #0c1929 100%);
}
.wp-turquoise-ripple {
  background-image:
    radial-gradient(ellipse at 22% 18%, rgba(64, 224, 208, 0.56) 0%, transparent 52%),
    radial-gradient(ellipse at 78% 28%, rgba(94, 234, 212, 0.36) 0%, transparent 48%),
    radial-gradient(ellipse at 52% 88%, rgba(13, 148, 136, 0.72) 0%, transparent 62%),
    linear-gradient(148deg, #0d5c63 0%, #178a88 34%, #115e59 68%, #072f36 100%);
}

/* ---------- Layout ---------- */
.page-shell {
  position: relative;
  z-index: 2;
  max-width: var(--page-max-width);
  min-height: calc(100vh / var(--page-scale, 1));
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  padding: 20px 24px 20px;
  zoom: var(--page-scale);
}

/* ---------- Top Bar ---------- */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  user-select: none;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-text h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  line-height: 1.2;
}

.brand-text span {
  display: block;
  font-size: 10px;
  letter-spacing: 2.2px;
  color: var(--text-sub);
  margin-top: 2px;
  text-transform: uppercase;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.glass-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  backdrop-filter: blur(var(--card-blur));
  -webkit-backdrop-filter: blur(var(--card-blur));
  color: var(--text-main);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
}

.glass-pill:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.32);
  transform: translateY(-1px);
}

.url-switch-pill {
  padding: 0 14px 0 8px;
  gap: 10px;
}

.switch-track {
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  position: relative;
  transition: background 0.22s ease;
  flex-shrink: 0;
}

.switch-track.active {
  background: #34d399;
}

.switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.switch-track.active .switch-thumb {
  transform: translateX(16px);
}

.switch-labels {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
}

.switch-labels strong {
  font-size: 12px;
  font-weight: 600;
}

.switch-labels small {
  font-size: 10px;
  color: var(--text-sub);
}

.auth-pill .auth-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
}

.auth-pill.guest .auth-dot {
  background: #fbbf24;
  box-shadow: 0 0 8px #fbbf24;
}

/* ---------- Clock ---------- */
.hero-clock {
  text-align: center;
  margin: 8px 0 22px;
  user-select: none;
}

.clock-time {
  font-size: clamp(46px, 6.2vw, 72px);
  font-weight: 300;
  letter-spacing: 3px;
  line-height: 1.08;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 6px 26px rgba(0, 0, 0, 0.34);
}

.clock-date {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.6px;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

/* ---------- Search Bar ---------- */
.search-section {
  max-width: 640px;
  margin: 0 auto 24px;
  position: relative;
  z-index: 30;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  height: 50px;
  padding: 0 10px 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #1f2937;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  border: 2px solid transparent;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.search-wrapper:focus-within {
  border-color: rgba(74, 222, 128, 0.7);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

.engine-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border: none;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: #334155;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.engine-trigger:hover {
  background: rgba(15, 23, 42, 0.12);
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 0 12px;
  font-size: 14px;
  color: #111827;
  min-width: 0;
}

.search-input::placeholder {
  color: #6b7280;
}

.search-clear {
  border: none;
  background: rgba(0, 0, 0, 0.08);
  color: #4b5563;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  margin-right: 8px;
}

.search-kbd {
  display: inline-flex;
  gap: 4px;
  margin-right: 6px;
  flex-shrink: 0;
}

.search-kbd kbd {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 7px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #64748b;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
}

.engine-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 190px;
  padding: 6px;
  border-radius: 16px;
  background: rgba(20, 28, 24, 0.88);
  backdrop-filter: blur(22px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 40;
}

.engine-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}

.engine-option:hover, .engine-option.active {
  background: rgba(255, 255, 255, 0.14);
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  max-height: 360px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px;
  border-radius: 20px;
  background: rgba(18, 26, 22, 0.9);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.42);
  z-index: 35;
}

.search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 13px;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.14s ease;
}

.search-item:hover, .search-item.selected {
  background: rgba(255, 255, 255, 0.14);
}

.search-item-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
  font-weight: 700;
  font-size: 14px;
}

.search-item-icon img {
  width: 72%;
  height: 72%;
  object-fit: contain;
}

.search-item-main {
  flex: 1;
  min-width: 0;
}

.search-item-title {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-item-group {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-sub);
  font-weight: 500;
}

.search-item-url {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* ---------- Glass Cards & Widgets ---------- */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(var(--card-blur));
  -webkit-backdrop-filter: blur(var(--card-blur));
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 16px 20px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  min-width: 0;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.26);
}

.widgets-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.35fr) minmax(0, 0.95fr) minmax(0, 1.1fr);
  gap: 16px;
  margin-bottom: 18px;
}

.widget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.widget-title, .widget-title-btn {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  background: none;
  border: none;
  padding: 0;
}

.widget-title-btn {
  cursor: pointer;
}

.widget-title-btn:hover {
  color: var(--accent);
}

.widget-link-btn {
  border: none;
  background: none;
  color: var(--text-sub);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease;
}

.widget-link-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.widget-loading {
  color: var(--text-sub);
  font-size: 13px;
  padding: 24px 0;
  text-align: center;
}

/* Weather Widget */
.weather-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}

.weather-now {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.weather-temp-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.weather-temp {
  font-size: 42px;
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.weather-now-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.weather-desc {
  font-size: 15px;
  font-weight: 600;
}

.weather-wind {
  font-size: 12px;
  color: var(--text-sub);
}

.weather-badges {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 2px;
}

.weather-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 2px 8px;
  border-radius: 7px;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
}

.weather-badge.aqi-good { background: rgba(74, 222, 128, 0.22); color: #bbf7d0; }
.weather-badge.aqi-mid { background: rgba(250, 204, 21, 0.22); color: #fef08a; }
.weather-badge.aqi-bad { background: rgba(248, 113, 113, 0.24); color: #fecaca; }

.weather-forecast {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.forecast-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 6px 2px;
  border-radius: 12px;
  min-width: 0;
}

.forecast-day:hover {
  background: rgba(255, 255, 255, 0.08);
}

.forecast-name {
  font-size: 12px;
  color: var(--text-sub);
}

.forecast-temps {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.88);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Calendar Widget */
.cal-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 128px;
}

.cal-main {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 4px 0 12px;
}

.cal-day-col {
  display: flex;
  flex-direction: column;
}

.cal-weekday {
  font-size: 12px;
  color: var(--text-sub);
}

.cal-big-day {
  font-size: 46px;
  font-weight: 700;
  line-height: 1.05;
  color: #fbbf77;
  font-variant-numeric: tabular-nums;
}

.cal-lunar-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cal-lunar-date {
  font-size: 16px;
  font-weight: 600;
}

.cal-day-tag {
  font-size: 12px;
  color: var(--text-sub);
}

.cal-week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  gap: 4px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cal-week-item {
  font-size: 12px;
  color: var(--text-muted);
  padding-bottom: 4px;
  position: relative;
}

.cal-week-item.today {
  color: #fff;
  font-weight: 700;
}

.cal-week-item.today::after {
  content: "";
  position: absolute;
  left: 20%;
  right: 20%;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: #fbbf77;
}

/* AI Translate Widget */
.glass-select {
  appearance: none;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 10px;
  outline: none;
  cursor: pointer;
}

.glass-select option {
  background: #1e293b;
  color: #fff;
}

.translate-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.translate-textarea {
  width: 100%;
  min-height: 76px;
  resize: none;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 10px 12px;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
  outline: none;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.translate-textarea:focus {
  border-color: rgba(74, 222, 128, 0.6);
  background: rgba(255, 255, 255, 0.12);
}

.translate-textarea::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.translate-result-box {
  min-height: 76px;
  max-height: 112px;
  overflow-y: auto;
  border-radius: 14px;
  border: 1px solid rgba(74, 222, 128, 0.4);
  background: rgba(15, 23, 20, 0.55);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

.translate-result-text {
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.translate-result-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.translate-provider {
  margin-right: auto;
  font-size: 11px;
  color: var(--text-muted);
}

.translate-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.translate-hint {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.translate-go-btn {
  border: none;
  border-radius: 12px;
  padding: 6px 14px;
  background: #ffffff;
  color: #111827;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.translate-go-btn:hover {
  transform: translateY(-1px);
}

.translate-go-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* Secondary Widgets (Notes & Countdown) */
.widgets-secondary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.notes-list, .countdown-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 150px;
  overflow-y: auto;
  margin-bottom: 10px;
}

.note-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 13px;
}

.note-row.done span {
  text-decoration: line-through;
  opacity: 0.55;
}

.note-row span {
  flex: 1;
  word-break: break-word;
}

.note-del, .cd-del {
  border: none;
  background: none;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  font-size: 15px;
}

.note-del:hover, .cd-del:hover {
  color: #f87171;
}

.cd-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
}

.cd-info strong {
  display: block;
  font-size: 13px;
}

.cd-info small {
  font-size: 11px;
  color: var(--text-muted);
}

.cd-days {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-variant-numeric: tabular-nums;
}

.cd-days b {
  font-size: 22px;
}

.inline-add-form {
  display: flex;
  gap: 8px;
}

.inline-add-form input {
  flex: 1;
  min-width: 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 7px 10px;
  font-size: 12px;
  outline: none;
}

.inline-add-form button {
  border: none;
  border-radius: 10px;
  padding: 7px 14px;
  background: #fff;
  color: #111827;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

/* ---------- Category Pill Bar ---------- */
.glass-bar {
  background: var(--card-bg);
  backdrop-filter: blur(var(--card-blur));
  -webkit-backdrop-filter: blur(var(--card-blur));
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 8px 10px;
  box-shadow: var(--shadow-soft);
}

.category-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: 22px;
}

.category-bar::-webkit-scrollbar {
  display: none;
}

.cat-tab {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease, transform 0.15s ease;
}

.cat-tab:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.cat-tab.active {
  background: #ffffff;
  color: #111827;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.cat-tab.is-draggable {
  cursor: grab;
  position: relative;
}

.cat-tab.dragging,
.site-card.dragging {
  opacity: 0.42;
  transform: scale(0.94);
  cursor: grabbing;
}

.cat-tab.drag-over-left {
  box-shadow: inset 3px 0 0 #4ade80;
}

.cat-tab.drag-over-right {
  box-shadow: inset -3px 0 0 #4ade80;
}

.cat-tab.drag-over-drop {
  background: rgba(74, 222, 128, 0.28);
  box-shadow: 0 0 0 1.5px #4ade80;
  color: #fff;
}

.site-card.is-draggable {
  cursor: grab;
}

.site-card.drag-over-left::before,
.site-card.drag-over-right::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 24px;
  width: 3px;
  border-radius: 3px;
  background: #4ade80;
  box-shadow: 0 0 10px #4ade80;
}

.site-card.drag-over-left::before {
  left: -4px;
}

.site-card.drag-over-right::before {
  right: -4px;
}

.sites-grid.grid-drag-over {
  border-radius: 18px;
  background: rgba(74, 222, 128, 0.08);
  outline: 1.5px dashed rgba(74, 222, 128, 0.45);
  outline-offset: 6px;
}

/* ---------- Sites Grid & G2 Squircle Icons ---------- */
.sites-container {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.site-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.group-badge-icon {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: #1f2937;
  display: grid;
  place-items: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.group-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.group-private-tag {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.22);
  color: #fde68a;
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 18px 14px;
}

.site-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: #fff;
  position: relative;
  padding: 6px 4px;
  border-radius: 18px;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.site-card:hover {
  transform: translateY(-4px);
}

.site-icon-box {
  position: relative;
  width: var(--icon-size);
  height: var(--icon-size);
  margin-bottom: 8px;
}

.site-icon-inner {
  width: 100%;
  height: 100%;
  border-radius: var(--icon-radius);
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  transition: box-shadow 0.22s ease, transform 0.22s ease;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}

.site-icon-inner.is-badge {
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.24) 0%, rgba(255, 255, 255, 0) 52%, rgba(0, 0, 0, 0.14) 100%),
    var(--badge-color, #2563eb);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 8px 20px rgba(0, 0, 0, 0.28);
  user-select: none;
}

.site-icon-inner .badge-text {
  font-weight: 800;
  letter-spacing: 0.4px;
  line-height: 1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.24);
}

.site-icon-inner .badge-text.single {
  font-size: calc(var(--icon-size) * 0.4);
}

.site-icon-inner .badge-text.double {
  font-size: calc(var(--icon-size) * 0.33);
}

.site-icon-inner.has-img {
  background: rgba(255, 255, 255, 0.94);
  padding: 6px;
}

.site-icon-inner.has-img img {
  object-fit: contain;
}

/* Horizontal Card Layout (Reference Style) */
.sites-grid.layout-card {
  grid-template-columns: repeat(auto-fill, minmax(236px, 1fr));
  gap: 12px 14px;
}

.site-card.layout-card-item {
  flex-direction: row;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--card-bg);
  backdrop-filter: blur(var(--card-blur));
  -webkit-backdrop-filter: blur(var(--card-blur));
  border: 1px solid var(--card-border);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
}

.site-card.layout-card-item:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.12);
}

.site-card.layout-card-item .site-icon-box {
  width: 44px;
  height: 44px;
  margin-bottom: 0;
  flex-shrink: 0;
}

.site-card.layout-card-item .site-icon-inner .badge-text.single {
  font-size: 19px;
}

.site-card.layout-card-item .site-icon-inner .badge-text.double {
  font-size: 15px;
}

.site-card-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  gap: 3px;
}

.site-card.layout-card-item .site-name {
  text-align: left;
  max-width: 100%;
  font-size: 14px;
  font-weight: 600;
  text-shadow: none;
}

.site-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.use-g2-squircle .site-icon-inner {
  clip-path: url(#g2-squircle);
  border-radius: 0;
}

body.use-g2-squircle .site-icon-box {
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.28));
}

.site-card:hover .site-icon-inner {
  transform: scale(1.04);
}

.site-icon-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.site-status-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid rgba(20, 28, 24, 0.85);
  z-index: 2;
}

.site-status-dot.online {
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
}

.site-status-dot.offline {
  background: #f87171;
  box-shadow: 0 0 8px #f87171;
}

.site-backup-badge {
  position: absolute;
  bottom: -2px;
  right: -3px;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 6px;
  background: #34d399;
  color: #064e3b;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.site-name {
  font-size: 12.5px;
  font-weight: 500;
  text-align: center;
  max-width: 96px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.page-footer {
  position: relative;
  margin-top: auto;
  padding-top: 22px;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.6px;
  color: rgba(255, 255, 255, 0.52);
}

.page-footer::before {
  content: "";
  display: block;
  width: 100%;
  max-width: 560px;
  height: 1px;
  margin: 0 auto 14px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.26) 50%, transparent 100%);
}

/* ---------- Native Dialogs ---------- */
.glass-dialog {
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  background: rgba(18, 26, 22, 0.9);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  color: #fff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
  max-width: 94vw;
  max-height: 90vh;
  overflow: hidden;
}

.glass-dialog::backdrop {
  background: rgba(0, 0, 0, 0.54);
  backdrop-filter: blur(6px);
}

.modal-sm { width: 420px; }
.modal-lg { width: 680px; }
.modal-xl { width: 980px; height: 78vh; }

.modal-inner {
  padding: 22px 24px;
  max-height: 88vh;
  overflow-y: auto;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}

.modal-desc {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.5;
}

.icon-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.icon-close:hover {
  background: rgba(255, 255, 255, 0.22);
}

.mini-btn {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.mini-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-primary {
  border: none;
  border-radius: 11px;
  padding: 9px 18px;
  background: #4ade80;
  color: #064e3b;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary:hover {
  filter: brightness(1.06);
}

.btn-secondary {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 11px;
  padding: 9px 16px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.16);
}

.btn-danger {
  border: 1px solid rgba(248, 113, 113, 0.4);
  border-radius: 10px;
  padding: 6px 12px;
  background: rgba(248, 113, 113, 0.16);
  color: #fecaca;
  font-size: 12px;
  cursor: pointer;
}

/* Weather Detail Modal */
.city-search-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.city-search-row input {
  flex: 1;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 9px 12px;
  font-size: 13px;
  outline: none;
}

.city-search-results {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.city-chip {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 12px;
  cursor: pointer;
}

.city-chip:hover {
  background: rgba(74, 222, 128, 0.24);
  border-color: #4ade80;
}

.hourly-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 12px 0;
}

.hourly-item {
  min-width: 64px;
  padding: 10px 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

/* Calendar Modal */
.cal-modal-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cal-modal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.cal-cell-head {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  padding: 6px 0;
}

.cal-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.cal-day-tag.is-off {
  color: #4ade80;
}

.cal-day-tag.is-work {
  color: #fbbf24;
}

.cal-day-tag.is-jp {
  color: #7dd3fc;
}

.cal-cell {
  border-radius: 12px;
  padding: 8px 4px;
  text-align: center;
  background: rgba(255, 255, 255, 0.05);
  min-height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  position: relative;
}

.cal-hol-corner {
  position: absolute;
  top: 4px;
  right: 5px;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
}

.cal-hol-corner.off {
  background: rgba(74, 222, 128, 0.22);
  color: #86efac;
}

.cal-hol-corner.work {
  background: rgba(251, 191, 36, 0.22);
  color: #fde68a;
}

.cal-cell.is-cn-off:not(.is-today) {
  background: rgba(74, 222, 128, 0.09);
}

.cal-cell.is-cn-work:not(.is-today) {
  background: rgba(251, 191, 36, 0.08);
}

.cal-jp-tag {
  font-size: 9.5px;
  line-height: 1.2;
  max-width: 92%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #7dd3fc;
}

.cal-modal-summary {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.45;
}

.cal-modal-summary strong {
  color: #fff;
}

.cal-cell.other-month {
  opacity: 0.35;
}

.cal-cell.is-today {
  background: rgba(74, 222, 128, 0.24);
  border: 1px solid #4ade80;
}

.cal-cell strong {
  font-size: 15px;
}

.cal-cell small {
  font-size: 10px;
  color: var(--text-sub);
}

.cal-cell.is-holiday small {
  color: #fbbf77;
}

/* Context Menu & Toast */
.context-menu {
  position: fixed;
  z-index: 999;
  min-width: 168px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(18, 26, 22, 0.94);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.context-menu button {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 9px;
  text-align: left;
  cursor: pointer;
}

.context-menu button:hover {
  background: rgba(255, 255, 255, 0.14);
}

.context-menu button.danger {
  color: #fca5a5;
}

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(17, 24, 39, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  animation: toastIn 0.2s ease;
}

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

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .widgets-grid {
    grid-template-columns: 1fr 1fr;
  }
  .widget-weather {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .page-shell {
    padding: 14px 14px 36px;
  }
  .widgets-grid {
    grid-template-columns: 1fr;
  }
  .weather-body {
    flex-direction: column;
    align-items: stretch;
  }
  .hide-sm {
    display: none;
  }
  .sites-grid {
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  }
  .modal-xl {
    height: 90vh;
  }
}
