/* --- THEME VARIABLES --- */
:root {
  /* Common Dimensions */
  --radius-lg: 28px;
  --radius-md: 16px;
  --radius-sm: 13px;
  
  /* Default (Day) Theme - Liquid Crystal Style */
  --bg-primary: #f0f4f8;
  --bg-secondary: #e2e8f0;
  /* High transparency for "Ice/Crystal" look */
  --card-bg: rgba(255, 255, 255, 0.25); 
  --card-border: rgba(255, 255, 255, 0.6);
  --text-main: #1e293b;
  --text-sub: #64748b;
  --text-light: #94a3b8;
  --shadow-color: rgba(148, 163, 184, 0.15);
  
  /* Accents */
  --rise-red: #ef4444;
  --fall-green: #10b981;
  --tag-ts-bg: #dbeafe; --tag-ts-text: #1e40af;
  --tag-react-bg: #bae6fd; --tag-react-text: #0369a1;
  --tag-photo-bg: #bbf7d0; --tag-photo-text: #15803d;
  --tag-coffee-bg: #fed7aa; --tag-coffee-text: #c2410c;
}

/* Night Theme Override - Deep Liquid Glass */
[data-theme="night"] {
  --bg-primary: #020617;
  --bg-secondary: #0f172a;
  --card-bg: rgba(15, 23, 42, 0.45); 
  --card-border: rgba(255, 255, 255, 0.08);
  --text-main: #f8fafc;
  --text-sub: #94a3b8;
  --text-light: #64748b;
  --shadow-color: rgba(0, 0, 0, 0.5);
  
  --tag-ts-bg: #1e3a8a; --tag-ts-text: #bfdbfe;
  --tag-react-bg: #0c4a6e; --tag-react-text: #bae6fd;
  --tag-photo-bg: #14532d; --tag-photo-text: #bbf7d0;
  --tag-coffee-bg: #7c2d12; --tag-coffee-text: #fed7aa;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  min-height: 100vh;
  background: var(--bg-primary);
  transition: background 0.8s ease, color 0.5s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-main);
  position: relative;
  overflow-x: hidden;
}

/* Dynamic Background Gradients */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: -1;
  transition: opacity 0.8s ease;
}

/* Day Gradient (Soft Pastels) */
body:not([data-theme="night"])::before {
  background: 
    radial-gradient(circle at 15% 8%, #ffecd2 0%, transparent 46%),
    radial-gradient(circle at 85% 12%, #fcb69f 0%, transparent 46%),
    radial-gradient(circle at 30% 90%, #a1c4fd 0%, transparent 47%),
    radial-gradient(circle at 75% 95%, #c2e9fb 0%, transparent 44%),
    linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
  animation: gradientFlow 18s ease infinite;
}

/* Night Gradient (Deep Space) */
body[data-theme="night"]::before {
  background: 
    radial-gradient(circle at 20% 30%, #1e1b4b 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, #312e81 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, #020617 0%, #000000 100%);
}

/* PARTICLE CANVAS LAYER */
#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0; 
  pointer-events: none;
}

.main-container {
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  z-index: 1; 
}
.left-col, .right-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@keyframes gradientFlow {
  0% { background-position: 0% 0%; }
  50% { background-position: 100% 100%; }
  100% { background-position: 0% 0%; }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes heartBeat {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* --- GLASS CARD BASE --- */
.glass-card {
  width: 100%;
  background: var(--card-bg); 
  backdrop-filter: blur(24px); /* Stronger blur for liquid feel */
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px var(--shadow-color);
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), background 0.5s ease, border-color 0.5s ease;
  animation: fadeInUp 0.8s ease backwards;
  position: relative;
  overflow: hidden; 
}

/* --- DAY MODE LIQUID EFFECT (Crystal/Ice) --- */
body:not([data-theme="night"]) .glass-card {
  /* Inner white glow for thickness */
  box-shadow: 
    inset 0 0 0 1px rgba(255, 255, 255, 0.5),
    inset 0 2px 4px rgba(255, 255, 255, 0.8),
    0 8px 32px rgba(148, 163, 184, 0.1);
  border-top: 1px solid rgba(255, 255, 255, 0.8);
  border-left: 1px solid rgba(255, 255, 255, 0.8);
}

/* The "Sheen" layer for Day Mode */
body:not([data-theme="night"]) .glass-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    90deg, 
    transparent, 
    rgba(255, 255, 255, 0.4), 
    transparent
  );
  transform: skewX(-25deg);
  transition: 0.6s;
  pointer-events: none;
}

/* Day Mode Hover Interaction */
body:not([data-theme="night"]) .glass-card:hover {
  transform: translateY(-8px) scale(1.01);
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow: 
    inset 0 0 0 1px rgba(255, 255, 255, 0.6),
    0 20px 40px rgba(148, 163, 184, 0.2),
    0 0 15px rgba(255, 255, 255, 0.5); /* Bright glow */
}

body:not([data-theme="night"]) .glass-card:hover::after {
  left: 150%;
  transition: 0.8s;
}

/* --- NIGHT MODE LIQUID EFFECT (Deep Glass) --- */
[data-theme="night"] .glass-card {
  box-shadow: 
    inset 0 0 20px rgba(255, 255, 255, 0.03),
    0 8px 32px rgba(0, 0, 0, 0.6);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  border-left: 1px solid rgba(255, 255, 255, 0.15);
}

[data-theme="night"] .glass-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    90deg, 
    transparent, 
    rgba(255, 255, 255, 0.08), 
    transparent
  );
  transform: skewX(-25deg);
  transition: 0.5s;
  pointer-events: none;
}

[data-theme="night"] .glass-card:hover {
  transform: translateY(-8px) scale(1.01);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 
    inset 0 0 30px rgba(255, 255, 255, 0.05),
    0 15px 45px rgba(0, 0, 0, 0.7),
    0 0 20px rgba(100, 100, 255, 0.1);
}

[data-theme="night"] .glass-card:hover::after {
  left: 150%;
  transition: 0.7s;
}

.profile-card { animation-delay: 0.1s; position: relative; padding: 24px; }
.menu-card {
  animation-delay: 0.2s;
  padding: 12px;
  background: rgb(255 255 255 / 0%);
  border: 1px solid var(--radius-lg);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 10%), 0 8px 32px var(--shadow-color);
}
.social-bar { animation-delay: 0.3s; padding: 16px 32px; display: flex; justify-content: space-around; align-items: center; }
.quote-card { animation-delay: 0.4s; padding: 28px 24px; text-align: center; transition: all 0.3s ease; }

/* Controls Container */
.controls-group {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
  z-index: 10;
}

.control-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
  box-shadow: 0 4px 12px var(--shadow-color);
}

.control-btn:hover {
  background: rgba(255,255,255,0.4);
  color: var(--text-main);
  transform: scale(1.05);
}

.profile-header { display: flex; gap: 16px; align-items: flex-start; }
.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #e8f4ff;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid rgba(255, 165, 0, 0.5);
  display: grid;
  place-items: center;
  font-size: 32px;
  transition: transform 0.3s ease;
}
.profile-card:hover .avatar { transform: scale(1.05) rotate(-3deg); }
.profile-info h1 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}
.profile-desc { font-size: 13px; color: var(--text-sub); margin-bottom: 6px; }
.time-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 12px;
}
.time-main {
  font-size: 22px;
  font-weight: 500;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}
.time-second { font-size: 12px; color: var(--text-light); }
.tags {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
}
.tag {
  padding: 2px 6px;       /* 减小左右内边距，节省横向空间 */
  border-radius: 4px;     /* 把8px改成4px，空间再小也能显示圆角 */
  font-size: 11px;
  font-weight: 500;
  transition: transform 0.3s ease;
  cursor: default;
  flex-shrink: 1;         /* 允许压缩 */
  white-space: nowrap;    /* 文字不换行 */
}
.tag:hover { transform: translateY(-2px); }
.tag-ts { background: var(--tag-ts-bg); color: var(--tag-ts-text); }
.tag-react { background: var(--tag-react-bg); color: var(--tag-react-text); }
.tag-photo { background: var(--tag-photo-bg); color: var(--tag-photo-text); }
.tag-coffee { background: var(--tag-coffee-bg); color: var(--tag-coffee-text); }

.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  background: rgba(255,255,255,0);
  box-shadow:
    inset 0 0 0 1px rgb(254 164 0 / 83%),
    inset 0 2px 10px rgba(255, 255, 255, 30%),
    inset 0 -2px 10px rgba(0, 0, 0, 38%);
  margin-bottom: 0;
}
.menu-item:hover {
  background: #ffa500;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.22),
    inset 0 2px 14px rgba(255, 255, 255, 0.6),
    inset 0 -2px 12px rgba(0, 0, 0, 0.02),
    0 0 18px rgba(56, 189, 248, 0);
  transform: translateX(6px);
}
.menu-left { display: flex; align-items: center; gap: 14px; }
.menu-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 16px;
  transition: transform 0.3s ease;
}
.menu-item:hover .menu-icon { transform: scale(1.15); }
.icon-home { background: #dbeafe; color: #3b82f6; }
.icon-cloud-download { background: #f3e8ff; color: #a855f7; }
.icon-skyatlas { background: #ffe4e6; color: #f43f5e; }
.icon-skyatlas { background: #dcfce7; color: #22c55e; }
.icon-cloud-download { background: #ffedd5; color: #f97316; }
.menu-text h3 {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 2px;
}
.menu-text p { font-size: 12px; color: var(--text-light); }
.menu-arrow {
  font-size: 12px;
  color: #d1d5db;
  transition: transform 0.3s ease, color 0.3s ease;
}
.menu-item:hover .menu-arrow { color: var(--text-sub); transform: translateX(3px); }

.social-icon {
  font-size : 20px;
  color     : var(--text-sub);
  cursor    : pointer;
  transition: all 0.3s ease;
}
.social-icon:hover { color: var(--text-main); transform: scale(1.2) translateY(-2px); }
.social-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.social-name {
  font-size: 10px;
  color: var(--text-light);
  white-space: nowrap;
}
.announcement-bar {
  margin-top: 16px;
  padding: 18px 22px;
  text-align: center;
  border-top: 1px solid #ffa500;
  border-radius: var(--radius-md);
  background: linear-gradient(120deg, rgba(56,189,248,0.08), rgba(168,85,247,0.08));
  transition: all 0.3s ease;
}
.announcement-bar:hover {
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.15);
  transform: translateY(-3px);
}
.announcement-text {
  font-size: 14px;
  color: #515151;
  line-height: 1.65;
  font-weight: 450;
  letter-spacing: 0.3px;
}

.rate-title { font-size: 14px; color: var(--text-sub); margin-bottom: 12px; }
.rate-price {
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: 1px;
}
.rate-change { font-size: 14px; margin-bottom: 0; }
.rate-up { color: var(--rise-red); }
.rate-down { color: var(--fall-green); }
.rate-flat { color: var(--text-main); }
footer {
  margin-top: 20px;
  font-size: 11px;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 4px;
  animation: fadeInUp 0.8s ease 0.5s backwards;
}
.heart {
  color: #f87171;
  font-size: 10px;
  animation: heartBeat 1.5s ease-in-out infinite;
}

@media (max-width: 767px) {
  body { padding: 24px 14px; justify-content: flex-start; }
  .main-container { display: flex; flex-direction: column; }
  .left-col, .right-col { display: contents; }
  .profile-card { order: 1; padding: 20px; }
  .menu-card { order: 2; padding: 16px; }
  .menu-item { padding: 6px 16px; margin-bottom: 8px; }
  .social-bar { order: 3; }
  .quote-card { order: 4; }
  .controls-group { top: 16px; right: 16px; }
}
@media (min-width: 768px) {
  body { padding: 40px 20px; }
  .main-container {
    max-width: 960px;
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 24px;
    align-items: stretch;
  }
  .right-col { height: 100%; }
  .menu-card { height: 100%; padding: 12px; display: flex; flex-direction: column; justify-content: space-evenly; }
}

#customAlert {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: max-content;
  min-width: 300px;
  max-width: 85vw;
  background: var(--card-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: 0 8px 32px var(--shadow-color);
  z-index: 9999;
  display: none;
  text-align: center;
  transition: all 0.3s ease;
}
#customAlert p {
  font-size: 14px;
  color: var(--text-main);
  line-height: 1.6;
  margin-bottom: 18px;
  letter-spacing: 0.3px;
}
#customAlert button {
  background: linear-gradient(120deg, rgba(56,189,248,0.12), rgba(168,85,247,0.12));
  border: 1px solid rgba(255,255,255,0.4);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  padding: 6px 22px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s ease;
}
#customAlert button:hover {
  background: linear-gradient(120deg, rgba(56,189,248,0.2), rgba(168,85,247,0.2));
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.1);
}
