/* ============================================
   流星雨的约定 - 全局样式
   iOS 浅色风格主屏幕
   ============================================ */

:root {
  --color-dark-text: #6B5340;
  --color-light-text: #A0896E;
  --color-accent: #5B9BD5;
  --color-red: #FF3B30;
  --color-divider: #E6E2D3;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  overflow: hidden;
  width: 100%;
  height: 100%;
}

body {
  font-family: "Zen Maru Gothic", -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'PingFang SC', sans-serif;
  background-color: #2C2C2E;
  color: var(--color-dark-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

/* 视口高度兼容 */
html, body { height: calc(var(--vh, 1vh) * 100); }
#phone-frame { height: calc(var(--vh, 1vh) * 100); }

::-webkit-scrollbar { display: none; }
* { scrollbar-width: none; }

/* ============================================
   #phone-frame
   ============================================ */
#phone-frame {
  width: 100%;
  max-width: 100vw;
  height: 100%;
  background: transparent;
  padding: 0;
  position: relative;
  overflow: hidden;
}

.notch { display: none; }

/* 桌面端：手机外壳 */
@media (min-width: 431px) {
  body {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #2C2C2E;
  }
  #phone-frame {
    width: 375px;
    height: 812px;
    background: #000;
    border-radius: 50px;
    padding: 12px;
    box-shadow: 0 0 0 2px #333, 0 0 0 4px #1a1a1a, 0 20px 60px rgba(0,0,0,0.5);
    flex-shrink: 0;
  }
  .notch {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: 126px;
    height: 34px;
    background: #000;
    border-radius: 20px;
    z-index: 999;
  }
  #app { border-radius: 40px; }
  #page-container { border-radius: 40px; }
}

/* 移动端：全屏 */
@media (max-width: 430px) {
  #phone-frame { width: 100%; background: transparent; padding: 0; }
  #app { border-radius: 0; }
  #page-container { border-radius: 0; }
}

/* ============================================
   #app
   ============================================ */
#app {
  width: 100%;
  max-width: 100vw;
  height: 100%;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: transparent;
}

/* ============================================
   壁纸背景
   ============================================ */
#wallpaper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('../assets/wallpaper.jpg') center center / cover no-repeat;
  z-index: 0;
}

/* ============================================
   状态栏 (44px)
   ============================================ */
#status-bar {
  height: 44px;
  padding-top: var(--safe-top);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 24px;
  padding-right: 24px;
  position: relative;
  z-index: 20;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.35);
}

.status-time {
  font-size: 15px;
  font-weight: 600;
  color: #6B5340;
  letter-spacing: 0.5px;
}

.status-icons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-signal, .status-wifi, .status-battery {
  display: block;
}

/* ============================================
   搜索栏
   ============================================ */
#search-bar {
  flex-shrink: 0;
  padding: 16px 16px 0;
  z-index: 20;
  position: relative;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

#search-input {
  width: 100%;
  height: 40px;
  background: rgba(255, 255, 255, 0.4);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-radius: 20px;
  border: none;
  padding: 0 16px 0 40px;
  font-size: 15px;
  outline: none;
  color: #6B5340;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}

#search-input::placeholder { color: #8E8E93; }
#search-input:focus { background: rgba(255, 255, 255, 0.85); }

/* ============================================
   主内容区
   ============================================ */
#main-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ============================================
   小组件区域
   ============================================ */
.widgets-area {
  padding: 16px 16px 0;
  position: relative;
  z-index: 1;
}

/* 通用小组件 */
.widget {
  background: rgba(255, 255, 255, 0.35);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-radius: 22px;
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.widget:active {
  opacity: 0.85;
  transform: scale(0.98);
}

/* ---------- 日历小组件（单周展示） ---------- */
.widget-calendar {
  margin-bottom: 12px;
  padding: 0;
}

.cal-card {
  background: #F5DEB3;
  border-radius: 22px;
  padding: 12px 10px 10px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  font-family: "Zen Maru Gothic", "PingFang SC", sans-serif;
}

/* 装饰星星 */
.cal-deco-star {
  position: absolute;
  color: #fff;
  pointer-events: none;
  line-height: 1;
}
.cal-star-1 { top: 6px; right: 12px; font-size: 14px; opacity: 0.4; }
.cal-star-2 { bottom: 8px; left: 10px; font-size: 11px; opacity: 0.3; }
.cal-star-3 { top: 50%; right: 6px; transform: translateY(-50%); font-size: 9px; opacity: 0.2; }
.cal-star-4 { bottom: 6px; right: 20px; font-size: 8px; opacity: 0.25; }
.cal-star-5 { top: 12px; left: 8px; font-size: 10px; opacity: 0.2; }

/* 头部 */
.cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  padding: 0 2px;
}

.cal-month {
  font-size: 17px;
  font-weight: 700;
  color: #8B7355;
  letter-spacing: 1px;
}

.cal-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cal-year-text {
  font-size: 11px;
  color: #A0896E;
  font-weight: 500;
}

.cal-weather-text {
  font-size: 11px;
  color: #A0896E;
}

/* 星期栏 */
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  margin-bottom: 2px;
  padding: 0;
}

.cal-weekdays span {
  font-size: 14px;
  color: #8B7355;
  font-weight: 700;
  padding: 0;
  line-height: 1;
}

/* 日期网格 */
.cal-dates {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  padding: 0;
}

.cal-d {
  position: relative;
  font-size: 14px;
  color: #fff;
  padding: 0;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  font-weight: 700;
  line-height: 1;
}

/* 当天：白色圆圈 + 棕色数字 */
.cal-today {
  background: #fff;
  color: #8B7355;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* 五角星标记 */
.cal-star-wrap {
  position: relative;
}

.cal-star-dot {
  position: absolute;
  top: -2px;
  right: -4px;
  font-size: 8px;
  color: #8B7355;
  line-height: 1;
  pointer-events: none;
}

/* ---------- 小组件并排行 ---------- */
.widget-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  align-items: stretch;
}

.widget-row .widget {
  flex: 1;
  margin-bottom: 0;
  padding: 14px;
}

.widget-row .widget-memo {
  padding: 0;
}

/* ---------- 倒计时（唱片形式） ---------- */
.widget-vinyl {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 6px 8px;
  position: relative;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
  overflow: visible;
}

.vinyl-disc {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: #1a1a1a;
  position: relative;
  flex-shrink: 0;
  animation: vinylSpin 8s linear infinite;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

@keyframes vinylSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.vinyl-grooves {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: repeating-radial-gradient(
    circle at center,
    transparent 0px,
    transparent 1px,
    rgba(255, 255, 255, 0.04) 1px,
    rgba(255, 255, 255, 0.04) 2px
  );
}

/* 进度圈（内环） */
.vinyl-progress {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 74px;
  height: 74px;
  animation: vinylSpinReverse 8s linear infinite;
  z-index: 1;
}

.vinyl-progress svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

/* 发光层（底层粗半透明圆圈） */
.progress-ring-glow {
  fill: none;
  stroke: rgba(212, 168, 67, 0.15);
  stroke-width: 6;
}
.progress-ring-fill-glow {
  fill: none;
  stroke: rgba(212, 168, 67, 0.25);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 295.31;
  stroke-dashoffset: 100.41;
  transition: stroke-dashoffset 0.5s ease;
}

.progress-ring-bg {
  fill: none;
  stroke: rgba(212, 168, 67, 0.3);
  stroke-width: 4;
}

.progress-ring-fill {
  fill: none;
  stroke: #D4A843;
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s ease;
}

.vinyl-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, #F5DEB3, #E8CFA0);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: vinylSpinReverse 8s linear infinite;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

@keyframes vinylSpinReverse {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(-360deg); }
}

.vinyl-days {
  font-size: 22px;
  font-weight: 700;
  color: #8B7355;
  line-height: 1;
}

.vinyl-unit {
  font-size: 11px;
  font-weight: 400;
  color: #8B7355;
  margin-top: 1px;
}

.vinyl-sub {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 2px;
}

.vinyl-tonearm {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 24px;
  background: linear-gradient(to bottom, #bbb, #999);
  border-radius: 1px;
  z-index: 2;
  transform-origin: top center;
  transform: translateX(-50%) rotate(0deg);
}

.vinyl-tonearm::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #aaa;
}

.vinyl-tonearm::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 0;
  height: 0;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-top: 6px solid #888;
}

.vinyl-bottom {
  font-size: 11px;
  color: #8E8E93;
  margin-top: 8px;
  text-align: center;
}

.progress-bar {
  height: 5px;
  background: #E6E2D3;
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #D4A843;
  border-radius: 3px;
}

/* ---------- 备忘录（Q版龙头） ---------- */
.widget-memo {
  padding: 0;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
  overflow: visible;
  margin-top: 8px;
}

.dragon-card {
  background: #A0896E;
  border-radius: 20px 20px 16px 16px;
  padding: 10px 14px 10px;
  position: relative;
  min-height: 110px;
  overflow: visible;
  min-width: 0;
}

/* 龙角 */
.dragon-horn {
  position: absolute;
  top: -12px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 14px solid #8B7355;
}
.dragon-horn-l {
  left: 18px;
  transform: rotate(-15deg);
}
.dragon-horn-r {
  right: 18px;
  transform: rotate(15deg);
}

/* 龙脸 */
.dragon-face {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 28px;
  padding: 6px 0 4px;
  position: relative;
}

/* 龙眼 */
.dragon-eye {
  width: 6px;
  height: 6px;
  background: #3A2A1A;
  border-radius: 50%;
}

/* 龙嘴 */
.dragon-mouth {
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 9px;
  background: #3A2A1A;
  border-radius: 0 0 9px 9px;
}

/* 龙身（备忘录内容） */
.dragon-body {
  padding: 6px 4px 8px;
}

.dragon-memo-title {
  font-size: 10px;
  color: rgba(255,255,255,0.6);
  margin-bottom: 6px;
  font-weight: 500;
}

.dragon-memo-item {
  font-size: 14px;
  color: #fff;
  padding: 3px 0;
  font-weight: 500;
  white-space: nowrap;
}

.dragon-memo-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
}

/* 龙尾 */
.dragon-tail {
  position: absolute;
  bottom: -6px;
  right: 8px;
  width: 20px;
  height: 8px;
  background: #8B7355;
  border-radius: 0 0 10px 4px;
  transform: rotate(-10deg);
}
.dragon-tail::after {
  content: '';
  position: absolute;
  right: -4px;
  top: 0;
  width: 10px;
  height: 6px;
  background: #7A6548;
  border-radius: 0 0 8px 4px;
  transform: rotate(15deg);
}

/* ---------- 竖排文字 ---------- */
.vertical-text-area {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 1px 0 2px;
}

.vertical-text {
  writing-mode: horizontal-tb;
  font-size: 26px;
  color: #8B7355;
  font-family: "Zen Maru Gothic", "PingFang SC", sans-serif;
  letter-spacing: 2px;
  pointer-events: none;
  user-select: none;
  line-height: 1.2;
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.8);
}

/* ============================================
   App 图标区域
   ============================================ */
.app-icons-area {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  padding: 8px 0 4px;
  flex-shrink: 0;
}

.app-icon-row {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.app-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.app-icon:active .icon-box { transform: scale(0.9); }

.icon-box {
  width: 52px;
  height: 52px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
  transition: transform 0.15s ease;
}

.icon-label {
  font-size: 10px;
  color: #6B5340;
  text-align: center;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

/* 图标颜色 */
.icon-wechat { background: #69a742; }
.icon-qq { background: #5c67b0; }
.icon-weibo { background: #be84f3; }
.icon-footprint { background: #69a742; }

/* ============================================
   Dock 栏
   ============================================ */
#dock {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: rgba(255, 255, 255, 0.45);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-radius: 28px;
  margin: 0 12px 20px;
  padding-bottom: var(--safe-bottom);
  height: 82px;
  flex-shrink: 0;
  z-index: 10;
}

.dock-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.dock-icon:active .dock-icon-box { transform: scale(0.9); }

.dock-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.15s ease;
}

.dock-icon-label {
  font-size: 10px;
  color: #6B5340;
  margin-top: 3px;
  text-align: center;
}

/* Dock 图标颜色 */
.icon-phone { background: #c5da5b; }
.icon-sms { background: #8ccfd8; }
.icon-album { background: #e8e55a; }
.icon-deepseek { background: #5c67b0; }

/* ============================================
   Home 横条
   ============================================ */
#home-indicator {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 134px;
  height: 5px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 3px;
  z-index: 50;
  pointer-events: none;
}

/* ============================================
   搜索历史下拉
   ============================================ */
#search-history {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 6px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 8px 16px;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

#search-history:empty { display: none; }

/* ============================================
   兼容旧变量名（页面渲染可能用到）
   ============================================ */
:root {
  --color-bg: #F8F5E9;
  --color-card: #E6E2D3;
  --color-white: #FFFFFF;
  --color-dock: rgba(255, 255, 255, 0.6);
  --color-date-bg: #bb7616;
  --color-date-text: #f3edd1;
  --ios-bg: var(--color-white);
  --divider: var(--color-divider);
  --cream: var(--color-bg);
  --widget-bg: var(--color-card);
  --text-dark: var(--color-dark-text);
  --text-light: var(--color-light-text);
}

/* ============================================
   #page-container 页面容器
   ============================================ */
#page-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background-color: var(--ios-bg);
  z-index: 30;
}

#page-container.active {
  display: flex;
  flex-direction: column;
}

/* ============================================
   全局页面导航栏（iOS 风格）
   ============================================ */
.page-header {
  height: 44px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 0.5px solid var(--color-divider);
  position: sticky;
  top: 0;
  background: rgba(250, 240, 225, 0.85);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  z-index: 10;
  flex-shrink: 0;
}

/* 桌面端导航栏留出刘海空间 */
@media (min-width: 431px) {
  .page-header {
    padding-top: 50px;
  }
}

/* 移动端导航栏适配安全区域 */
@media (max-width: 430px) {
  .page-header {
    padding-top: var(--safe-top);
  }
}

.page-header .back-btn {
  font-size: 17px;
  color: var(--color-accent);
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  min-width: 60px;
  display: flex;
  align-items: center;
  gap: 2px;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.page-header .back-btn:active { opacity: 0.5; }

.page-header .title {
  font-size: 17px;
  font-weight: 600;
  flex: 1;
  text-align: center;
  color: #6B5340;
}

.page-content {
  padding: 16px;
  flex: 1;
  overflow-y: auto;
}

.page-enter {
  animation: fadeIn 0.25s ease;
}

/* ============================================
   备忘录手风琴样式
   ============================================ */
.memo-accordion-item {
  margin-bottom: 8px;
  border-radius: 12px;
  background: #FFFFFF;
  overflow: hidden;
}

.memo-accordion-header {
  padding: 14px 16px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1C1C1E;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease;
}

.memo-accordion-header:active {
  background-color: #F2F2F7;
}

.memo-accordion-header::after {
  content: '';
  width: 8px;
  height: 8px;
  border-right: 2px solid #C7C7CC;
  border-bottom: 2px solid #C7C7CC;
  transform: rotate(-45deg);
  transition: transform 0.25s ease;
  flex-shrink: 0;
  margin-left: 12px;
}

.memo-accordion-header.open::after {
  transform: rotate(45deg);
}

.memo-accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.memo-accordion-text {
  padding: 0 16px 14px;
  font-size: 0.9375rem;
  color: #6B5340;
  line-height: 1.7;
  white-space: pre-wrap;
}

/* ============================================
   通用组件样式
   ============================================ */

/* 列表 */
.list-item {
  padding: 14px 16px;
  border-bottom: 0.5px solid var(--divider);
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.list-item:active { background-color: #D1D1D6; }

/* 聊天 */
.chat-container { display: flex; flex-direction: column; padding: 16px; }
.chat-bubble {
  max-width: 75%; padding: 10px 14px; border-radius: 18px;
  font-size: 0.9375rem; line-height: 1.5; margin-bottom: 8px; word-break: break-word;
}
.chat-bubble.sent { background-color: #C7B8A8; color: #3A2A1A; align-self: flex-end; border-bottom-right-radius: 4px; }
.chat-bubble.received { background-color: #E9E9EB; color: #1C1C1E; align-self: flex-start; border-bottom-left-radius: 4px; }

/* 登录表单 */
.login-form { padding: 40px 24px; }
.form-input {
  width: 100%; height: 44px; border: 0.5px solid #E5E5EA; border-radius: 10px;
  padding: 0 12px; font-size: 1rem; outline: none; background-color: #F2F2F7;
  color: #1C1C1E; font-family: inherit; -webkit-appearance: none; appearance: none;
}
.form-input:focus { border-color: #5B9BD5; }
.form-input::placeholder { color: #C7C7CC; }
.form-btn {
  width: 100%; height: 50px; background-color: var(--color-accent); color: #FFFFFF;
  border: none; border-radius: 14px; font-size: 1.0625rem; font-weight: 600;
  cursor: pointer; font-family: inherit; -webkit-appearance: none; appearance: none;
  transition: background-color 0.15s ease;
}
.form-btn:active { opacity: 0.8; }

/* Toast */
#toast {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.8); color: #FFFFFF; padding: 16px 24px;
  border-radius: 12px; font-size: 0.9375rem; text-align: center; z-index: 200;
  display: none; pointer-events: none; max-width: 260px; word-break: break-word;
}
#toast.show { display: block; animation: fadeInOut 2s ease forwards; }

/* Modal */
#modal { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 150; display: none; }
#modal.show { display: block; }
#modal .modal-content {
  position: absolute; bottom: 0; width: 100%; background-color: #FFFFFF;
  border-radius: 12px 12px 0 0; padding: 20px; animation: slideUp 0.3s ease;
}
#modal .modal-title { font-size: 1.0625rem; font-weight: 600; text-align: center; margin-bottom: 16px; color: #1C1C1E; }

/* 页面编号 */
#page-number { position: fixed; bottom: 34px; right: 24px; font-size: 0.6875rem; color: rgba(255,255,255,0.4); z-index: 50; pointer-events: none; }

/* 标签页 */
.tabs { display: flex; border-bottom: 0.5px solid var(--divider); background-color: #FFFFFF; }
.tab {
  flex: 1; text-align: center; padding: 10px 0; font-size: 0.875rem; color: #8E8E93;
  cursor: pointer; border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-bottom-color 0.2s ease;
  background: none; border-top: none; border-left: none; border-right: none; font-family: inherit;
}
.tab.active { color: var(--color-accent); border-bottom-color: var(--color-accent); }

/* 表格 */
.info-table { width: 100%; border-collapse: collapse; }
.info-table td, .info-table th { padding: 10px 12px; border-bottom: 0.5px solid var(--divider); font-size: 0.875rem; text-align: left; color: #1C1C1E; }
.info-table th { font-weight: 600; color: #1C1C1E; background-color: #F9F9FB; }

/* 日历网格 */
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.calendar-cell { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 0.875rem; border-radius: 8px; color: #1C1C1E; position: relative; cursor: pointer; }
.calendar-cell.today { background-color: #5B9BD5; color: #FFFFFF; font-weight: 600; }
.calendar-cell.marked::after { content: ''; position: absolute; top: 2px; right: 2px; width: 6px; height: 6px; border-radius: 50%; background-color: #FF3B30; }

/* 图片网格 */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.photo-grid .photo { aspect-ratio: 1; object-fit: cover; background-color: #E5E5EA; width: 100%; display: block; }

/* ============================================
   动画
   ============================================ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes fadeInOut { 0% { opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; } }
@keyframes shake { 0%,100% { transform: translateX(0); } 20%,60% { transform: translateX(-6px); } 40%,80% { transform: translateX(6px); } }
@keyframes scaleIn { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ============================================
   辅助工具类
   ============================================ */
.text-primary { color: #5B9BD5; }
.text-secondary { color: #8E8E93; }
.text-danger { color: #FF3B30; }
.text-success { color: #34C759; }
.text-center { text-align: center; }
.font-bold { font-weight: 600; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.hidden { display: none !important; }

/* ============================================
   响应式 - 移动端全屏
   ============================================ */

/* 小屏手机（< 360px） */
@media (max-width: 360px) {
  html { font-size: 14px; }
  .app-icon-row { gap: 6vw; }
  #dock { gap: 4vw; }
}

/* 大屏手机/平板（431px - 768px） */
@media (min-width: 431px) and (max-width: 768px) {
  html { font-size: 17px; }
}

/* 超大屏（> 768px）字体上限 */
@media (min-width: 769px) {
  html { font-size: 18px; }
}

/* 横屏锁定 - 仅竖屏生效 */
@media (orientation: landscape) and (min-width: 431px) {
  body {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #2C2C2E;
  }
  #phone-frame {
    width: 375px;
    height: 812px;
    transform: rotate(0deg);
    transform-origin: center center;
  }
}

/* 极短屏幕适配 */
@media (max-height: 600px) {
  #status-bar { height: 32px; }
  #search-bar { padding: 4px 4.27vw; }
  .widget-weather { padding: 8px 5.33vw; margin-bottom: 6px; }
  .widget-row { gap: 6px; margin-bottom: 6px; }

  .widgets-area { padding: 0 4.27vw; }
  .app-icons-area { flex: 0; padding: 6px 0; }
  #dock { height: clamp(50px, 8vh, 65px); }
}

/* ========== 搜索历史下拉 ========== */
#search-history {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 6px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 8px 16px;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

#search-history:empty {
  display: none;
}
