* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", "Noto Sans SC", "Microsoft YaHei", sans-serif; color: #eee; background: #000; }
:root { --card-w: clamp(160px, 20vw, 260px); --card-h: clamp(200px, 26vw, 320px); --digit-size: clamp(120px, 16vw, 180px); --colon-size: clamp(100px, 14vw, 160px); }

.header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: #000; border-bottom: 1px solid #1a1a1a; position: sticky; top: 0; z-index: 100; }
.brand { font-weight: 700; font-size: 18px; }
.brand a { color: #fff; text-decoration: none; }
.nav-menu { display: flex; gap: 20px; align-items: center; }
.nav-menu a { color: #fff; text-decoration: none; font-size: 14px; padding: 6px 12px; border-radius: 6px; transition: background-color 0.2s; }
.nav-menu a:hover { background: #1a1a1a; }
.controls { display: flex; gap: 12px; align-items: center; }
.control { display: flex; gap: 6px; align-items: center; font-size: 14px; color: #bbb; }
.btn { padding: 8px 12px; border-radius: 8px; border: 1px solid #333; background: #111; color: #eee; cursor: pointer; }
.btn:hover { background: #181818; }
select { background: #111; color: #eee; border: 1px solid #333; border-radius: 8px; padding: 6px 8px; }

.main { max-width: 1400px; margin: 0 auto; padding: 20px 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 80vh; }
.clock-section { display: flex; justify-content: center; align-items: center; min-height: 50vh; width: 100%; }
.flip-clock { display: flex; align-items: center; gap: min(2vw, 20px); justify-content: center; width: 100%; }
.colon { font-size: var(--colon-size); line-height: 1; margin: 0 min(2vw, 12px); color: #aaa; font-weight: 400; }

.flip-card { position: relative; width: var(--card-w); height: var(--card-h); perspective: 1200px; border-radius: 12px; box-shadow: 0 25px 60px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.15), inset 0 1px 0 rgba(255,255,255,0.1); background: #0a0a0a; overflow: hidden; }
.flip-card .top,
.flip-card .bottom { position: absolute; left: 0; width: 100%; height: 50%; overflow: hidden; display: flex; justify-content: center; align-items: center; color: #fff; font-weight: 900; letter-spacing: 2px; backface-visibility: hidden; font-family: 'Arial', 'Helvetica', sans-serif; text-shadow: 0 3px 15px rgba(255,255,255,0.4); }
.flip-card .top { top: 0; transform-origin: bottom center; background: linear-gradient(180deg, #0f0f0f 0%, #151515 100%); border-bottom: 1px solid rgba(255,255,255,0.2); border-radius: 12px 12px 0 0; font-size: var(--digit-size); }
.flip-card .bottom { bottom: 0; transform-origin: top center; background: linear-gradient(180deg, #151515 0%, #1a1a1a 100%); border-top: 1px solid rgba(0,0,0,0.7); border-radius: 0 0 12px 12px; font-size: var(--digit-size); }

.flip-card .top-flip,
.flip-card .bottom-flip { position: absolute; left: 0; width: 100%; height: 50%; overflow: hidden; display: flex; justify-content: center; align-items: center; color: #fff; font-weight: 900; letter-spacing: 2px; backface-visibility: hidden; font-family: 'Arial', 'Helvetica', sans-serif; text-shadow: 0 3px 15px rgba(255,255,255,0.4); z-index: 2; }
.flip-card .top-flip { top: 0; transform-origin: bottom center; background: linear-gradient(180deg, #0f0f0f 0%, #151515 100%); border-bottom: 1px solid rgba(255,255,255,0.2); border-radius: 12px 12px 0 0; animation: flip-top 600ms cubic-bezier(0.4, 0, 0.2, 1) forwards; font-size: var(--digit-size); }
.flip-card .bottom-flip { bottom: 0; transform-origin: top center; background: linear-gradient(180deg, #151515 0%, #1a1a1a 100%); border-top: 1px solid rgba(0,0,0,0.7); border-radius: 0 0 12px 12px; animation: flip-bottom 600ms cubic-bezier(0.4, 0, 0.2, 1) forwards; font-size: var(--digit-size); }

@keyframes flip-top { 
  0% { transform: rotateX(0deg); opacity: 1; filter: brightness(1.2); }
  50% { transform: rotateX(-90deg); opacity: 0.7; filter: brightness(0.8); }
  100% { transform: rotateX(-180deg); opacity: 0; filter: brightness(0.6); }
}
@keyframes flip-bottom { 
  0% { transform: rotateX(90deg); opacity: 0; filter: brightness(0.6); }
  50% { transform: rotateX(0deg); opacity: 0.7; filter: brightness(0.8); }
  100% { transform: rotateX(0deg); opacity: 1; filter: brightness(1.2); }
}

.footer { color: #777; font-size: 12px; padding: 40px 24px 24px; background: #0a0a0a; border-top: 1px solid #1a1a1a; margin-top: 60px; }
.footer-content { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 40px; }
.footer-section h3 { color: #fff; font-size: 16px; margin-bottom: 16px; font-weight: 600; }
.footer-section p { line-height: 1.6; margin-bottom: 12px; }
.footer-section a { color: #ccc; text-decoration: none; display: block; margin-bottom: 8px; font-size: 13px; }
.footer-section a:hover { color: #7aa2ff; }
.footer-bottom { text-align: center; margin-top: 40px; padding-top: 20px; border-top: 1px solid #1a1a1a; color: #666; }

.main-content { min-height: calc(100vh - 200px); padding: 20px 0; }

.app-promo { margin-top: 12px; font-size: 12px; color: #999; }
.app-promo a { color: #7aa2ff; text-decoration: none; }

.shichen-line { text-align: center; font-size: 16px; color: #bbb; margin-top: 10px; }
.lunar-line { text-align: center; font-size: 13px; color: #999; }
.calendar-line { text-align: center; font-size: 13px; color: #8d8d8d; }

@media (max-width: 680px) {
  :root {
    --card-w: clamp(120px, 32vw, 160px);
    --card-h: clamp(160px, 40vw, 200px);
    --digit-size: clamp(80px, 20vw, 120px);
    --colon-size: clamp(70px, 18vw, 100px);
  }
  
  .main { padding: 16px 12px; min-height: 70vh; }
  .clock-section { min-height: 40vh; }
  .flip-clock { gap: min(3vw, 14px); flex-wrap: wrap; }
  .colon { margin: 0 min(3vw, 10px); }
  
  /* 手机导航栏适配 */
  .header { flex-direction: column; gap: 12px; padding: 12px; }
  .nav-menu { flex-wrap: wrap; justify-content: center; gap: 10px; }
  .nav-menu a { font-size: 13px; padding: 4px 8px; }
  .controls { flex-wrap: wrap; justify-content: center; }
  
  /* 页脚适配 */
  .footer-content {
    grid-template-columns: 1fr;
    gap: 30px;
    text-align: center;
  }
  
  .footer-section {
    margin-bottom: 20px;
  }
  
  .footer-section a {
    display: inline-block;
    margin: 0 8px 8px 0;
  }
  
  /* 内容区域适配 */
  .main-content { padding: 16px 0; }
}