/* ============================================================
   css/weather.css — 主界面天气小件 + 未来 7 天全屏天气页
   设计系统：韩系法式唯美风；线条图标（无 emoji）；主题令牌取色
   全屏页挂在 #app 内（position:absolute; inset:0），不是 fixed 挂 body
   ============================================================ */

/* ===== 对话列表头部：右侧一行（天气小件 + 会客厅）===== */
.cl-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* 天气小件：图标 + 当前温度（独立组件，不是胶囊按钮）
   ★ 2028 配色跟随主题色：原来底/边框/阴影是写死的暖金+暖灰（甲方观感「有点红橙」），
     改成用主题强调色（--accent）淡调混合，换主题时底色、描边、光晕一起变。 */
.wx-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 11px 6px 9px;
    border-radius: 14px;
    background: linear-gradient(140deg,
        color-mix(in srgb, var(--accent, #C9A8A8) 9%, #FFFFFF),
        color-mix(in srgb, var(--accent, #C9A8A8) 16%, #FDFAF6));
    border: 1px solid color-mix(in srgb, var(--accent, #C9A8A8) 40%, transparent);
    box-shadow: 0 2px 10px color-mix(in srgb, var(--accent, #C9A8A8) 18%, transparent);
    color: var(--accent, #C9A8A8);
    cursor: pointer;
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.24s ease, border-color 0.24s ease;
    -webkit-tap-highlight-color: transparent;
}
.wx-chip:hover {
    border-color: color-mix(in srgb, var(--accent, #C9A8A8) 62%, transparent);
    box-shadow: 0 4px 14px color-mix(in srgb, var(--accent, #C9A8A8) 26%, transparent);
}
.wx-chip:active { transform: scale(0.94); }
.wx-chip .wx-icon { flex-shrink: 0; }
.wx-chip-temp {
    font-family: var(--font-display, 'Playfair Display', Georgia, serif);
    font-size: 15px;
    line-height: 1;
    color: var(--text-primary, #1E1C1A);
    letter-spacing: 0.2px;
}
.wx-chip-deg { font-size: 11px; margin-left: 0.5px; opacity: 0.75; }
/* 还没定位/取不到天气：只把图标调淡一点（颜色仍跟主题，不要整块发灰） */
.wx-chip-empty .wx-icon { opacity: 0.62; }
.wx-chip-empty .wx-chip-temp { color: var(--text-muted, #BFB8AE); }
.wx-chip-busy .wx-icon { opacity: 0.8; }
.wx-chip-busy .wx-chip-temp {
    font-family: var(--font-body, 'Noto Serif SC', serif);
    font-size: 12px;
    color: var(--text-muted, #BFB8AE);
}

/* ===== 全屏天气页 ===== */
.wx-page {
    position: absolute;
    inset: 0;
    z-index: 1800;
    background: var(--bg-primary, #F8F4EF);
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.26s ease, transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.wx-page.open { opacity: 1; transform: translateY(0); }
.wx-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

/* 顶部栏 */
.wx-topbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: calc(12px + var(--safe-top, 0px)) 14px 10px;
    flex-shrink: 0;
    background: var(--surface, rgba(255, 252, 249, 0.92));
    border-bottom: 1px solid var(--border, rgba(196, 168, 140, 0.18));
}
.wx-back, .wx-refresh {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    border-radius: 10px;
    color: var(--text-secondary, #8A8278);
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease, color 0.18s ease;
    -webkit-tap-highlight-color: transparent;
}
.wx-back:hover, .wx-refresh:hover { background: var(--accent-light, rgba(201, 168, 168, 0.14)); color: var(--text-primary, #1E1C1A); }
.wx-back:active, .wx-refresh:active { transform: scale(0.92); }
.wx-topbar-title {
    flex: 1;
    text-align: center;
    font-family: var(--font-body, 'Noto Serif SC', serif);
    font-size: 15px;
    letter-spacing: 2px;
    color: var(--text-primary, #1E1C1A);
}
.wx-topbar-en {
    display: block;
    font-family: var(--font-display, 'Playfair Display', Georgia, serif);
    font-style: italic;
    font-size: 10px;
    letter-spacing: 1.4px;
    color: var(--accent, #C9A8A8);
    margin-top: 1px;
}

/* 内容区（唯一滚动容器，底部留安全区） */
.wx-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 18px 16px calc(28px + var(--safe-bottom, 0px));
}

/* ---- 顶部主视觉 ---- */
.wx-hero { text-align: center; padding: 4px 0 20px; }
.wx-hero-place {
    font-family: var(--font-body, 'Noto Serif SC', serif);
    font-size: 15px;
    line-height: 1.5;
    letter-spacing: 0.4px;
    color: var(--text-primary, #1E1C1A);
    word-break: break-word;
}
.wx-hero-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 14px 0 8px;
    color: var(--accent, #C9A8A8);
}
.wx-hero-temp {
    font-family: var(--font-display, 'Playfair Display', Georgia, serif);
    font-size: 54px;
    line-height: 1;
    color: var(--text-primary, #1E1C1A);
    letter-spacing: -1px;
}
.wx-hero-deg { font-size: 26px; vertical-align: super; opacity: 0.7; margin-left: 2px; }
.wx-hero-label {
    font-size: 12px;
    letter-spacing: 0.6px;
    color: var(--text-muted, #BFB8AE);
}
/* 位置是「按网络推测的城市级大致位置」时的如实说明（2026-09 加，绝不冒充精确定位） */
.wx-hero-approx {
    margin-top: 6px;
    font-size: 11.5px;
    line-height: 1.55;
    letter-spacing: 0.3px;
    color: #8A7E76;
    opacity: 0.95;
}

/* ---- 纸卡 ---- */
.wx-card {
    background: rgba(255, 252, 249, 0.92);
    border: 1px solid rgba(196, 168, 140, 0.22);
    border-radius: 16px;
    padding: 14px 12px 12px;
    margin-bottom: 14px;
    box-shadow: 0 2px 14px rgba(160, 145, 130, 0.07), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
}
.wx-card-title {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 12px;
    letter-spacing: 1.6px;
    color: var(--text-secondary, #8A8278);
    margin: 0 4px 14px;
}
.wx-card-en {
    font-family: var(--font-display, 'Playfair Display', Georgia, serif);
    font-style: italic;
    font-size: 10px;
    letter-spacing: 1px;
    color: var(--accent, #C9A8A8);
}

/* ---- 7 天温度柱状图 ---- */
.wx-chart { display: flex; align-items: flex-end; gap: 4px; }
.wx-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.wx-col-day {
    font-size: 11px;
    color: var(--text-secondary, #8A8278);
    letter-spacing: 0.4px;
    white-space: nowrap;
}
.wx-col-icon { color: var(--accent, #C9A8A8); display: flex; }
.wx-col-track {
    position: relative;
    width: 100%;
    height: 116px;
}
.wx-col-track::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    transform: translateX(-50%);
    background: linear-gradient(to bottom, rgba(196, 168, 140, 0), rgba(196, 168, 140, 0.28), rgba(196, 168, 140, 0));
}
.wx-bar {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    border-radius: 6px;
    background: linear-gradient(to top, var(--rose, #C9A8A8), var(--gold, #C4A86A));
    box-shadow: 0 1px 6px rgba(180, 150, 130, 0.22);
    transition: height 0.55s cubic-bezier(0.22, 0.61, 0.36, 1), bottom 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.wx-col-hi {
    font-family: var(--font-display, 'Playfair Display', Georgia, serif);
    font-size: 13px;
    color: var(--text-primary, #1E1C1A);
    line-height: 1;
}
.wx-col-lo { font-size: 11px; color: var(--text-muted, #BFB8AE); line-height: 1; }
.wx-col-date { font-size: 9px; color: var(--text-muted, #BFB8AE); letter-spacing: 0.2px; }

/* ---- 每天列表 ---- */
.wx-rows { display: flex; flex-direction: column; }
.wx-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 4px;
    border-bottom: 1px solid rgba(196, 168, 140, 0.14);
}
.wx-row:last-child { border-bottom: none; }
.wx-row-day { display: flex; flex-direction: column; gap: 2px; width: 52px; flex-shrink: 0; }
.wx-row-dayname { font-size: 12px; color: var(--text-primary, #1E1C1A); letter-spacing: 0.4px; }
.wx-row-date { font-size: 9px; color: var(--text-muted, #BFB8AE); }
.wx-row-icon { color: var(--accent, #C9A8A8); display: flex; flex-shrink: 0; }
.wx-row-label { font-size: 12px; color: var(--text-secondary, #8A8278); letter-spacing: 0.4px; flex: 1; min-width: 0; }
.wx-row-meta { font-size: 10px; color: var(--text-muted, #BFB8AE); text-align: right; white-space: nowrap; }

/* ---- 底部来源/时间 ---- */
.wx-foot { text-align: center; padding: 4px 6px 8px; }
.wx-foot-line { font-size: 10px; color: var(--text-muted, #BFB8AE); line-height: 1.9; letter-spacing: 0.3px; }
.wx-foot-src { font-size: 9px; color: var(--text-muted, #BFB8AE); opacity: 0.75; margin-top: 4px; letter-spacing: 0.2px; }
/* 位置不准时的自检入口（只在「位置旧 / 只有城市级推测」时出现）：一行素净小字按钮，不抢天气内容的视觉重心。
   真按钮元素（键盘可达 + focus 描边）、触碰有反馈、尊重「减少动态效果」。 */
.wx-foot-check {
    display: inline-block; margin: 6px 0 2px; padding: 6px 12px;
    font-family: inherit; font-size: 11px; letter-spacing: 0.2px;
    color: var(--rose, #C9A8A8); background: transparent;
    border: 1px solid var(--rose, #C9A8A8); border-radius: var(--radius-full, 999px);
    cursor: pointer; transition: transform 0.18s ease, background 0.18s ease;
    -webkit-tap-highlight-color: transparent;
}
.wx-foot-check:hover { background: var(--rose-light, rgba(201,168,168,0.12)); transform: translateY(-1px); }
.wx-foot-check:active { transform: scale(0.96); }
.wx-foot-check:focus-visible { outline: 2px solid var(--rose, #C9A8A8); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
    .wx-foot-check, .wx-foot-check:hover, .wx-foot-check:active { transition: none; }
    .wx-foot-check:hover { transform: none; }
    .wx-foot-check:active { transform: none; }
}

/* ---- 空态 ---- */
.wx-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 80px 20px;
    color: var(--accent, #C9A8A8);
    text-align: center;
}
.wx-empty-text { font-size: 13px; color: var(--text-secondary, #8A8278); line-height: 1.8; }
.wx-empty-btn {
    border: 1px solid rgba(201, 168, 168, 0.55);
    background: rgba(255, 252, 249, 0.9);
    color: var(--accent, #C9A8A8);
    font-family: var(--font-body, 'Noto Serif SC', serif);
    font-size: 13px;
    letter-spacing: 1px;
    padding: 9px 20px;
    border-radius: 18px;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.24s ease;
    box-shadow: 0 2px 10px rgba(160, 145, 130, 0.1);
}
.wx-empty-btn:active { transform: scale(0.95); }

/* ===== 窄屏 <370px ===== */
@media (max-width: 370px) {
    .cl-header-right { gap: 6px; }
    .cl-guest-btn { padding: 7px 10px; }
    .cl-guest-txt { display: none; }        /* 会客厅收成图标，给天气小件让位 */
    .wx-chip { padding: 5px 9px 5px 7px; gap: 4px; }
    .wx-chip-temp { font-size: 14px; }
    .wx-body { padding: 14px 12px calc(24px + var(--safe-bottom, 0px)); }
    .wx-hero-temp { font-size: 46px; }
    .wx-col-track { height: 96px; }
    .wx-bar { width: 8px; }
    .wx-col-day { font-size: 10px; }
    .wx-col-hi { font-size: 12px; }
    .wx-row-day { width: 46px; }
    .wx-row { gap: 8px; }
}

/* ===== 暗色模式（用 app 的主题开关属性；原来只写 prefers-color-scheme，
       app 内切暗色时天气小件/卡片不跟着变，2028 一并修正）===== */
[data-theme-mode="dark"] .wx-chip {
    background: linear-gradient(140deg,
        color-mix(in srgb, var(--accent, #D4B8B8) 14%, #2A2420),
        color-mix(in srgb, var(--accent, #D4B8B8) 22%, #221D1A));
    border-color: color-mix(in srgb, var(--accent, #D4B8B8) 34%, transparent);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
}
[data-theme-mode="dark"] .wx-chip:hover {
    border-color: color-mix(in srgb, var(--accent, #D4B8B8) 56%, transparent);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.34);
}
[data-theme-mode="dark"] .wx-card { background: rgba(46, 40, 37, 0.82); border-color: rgba(196, 168, 140, 0.18); }
[data-theme-mode="dark"] .wx-topbar { background: var(--surface, rgba(36, 31, 29, 0.92)); }
[data-theme-mode="dark"] .wx-empty-btn { background: rgba(46, 40, 37, 0.9); }
