/* ===== 品牌色变量 ===== */
:root {
    --color-primary: #E6E6FA;        /* 淡紫色 - 导航栏/主色 */
    --color-primary-btn: #9880D0;    /* 按钮紫（深色可读） */
    --color-primary-btn-dark: #7D66B8;
    --color-pink: #FFD1DC;           /* 柔和粉 - 用户气泡 */
    --color-blue: #B0E0E6;           /* 清新蓝 - AI气泡 */
    --color-green: #E8F5E9;          /* 淡绿色 - 成功状态 */
    --color-bg: #F5F5F5;             /* 米白色 - 页面底色 */
    --color-text: #333333;
    --color-text-secondary: #666666;
    --color-text-hint: #999999;
    --color-divider: #EEEEEE;
    --color-warning-bg: #FFF8E1;
    --color-warning-text: #FFA000;
    --color-success-bg: #C8E6C9;
    --color-success-text: #2E7D32;
}

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--color-bg);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-text);
}

#app {
    height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
    background: var(--color-bg);
    overflow: hidden;
}

.chat-page {
    height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    background: var(--color-bg);
}

.hidden {
    display: none !important;
}

/* ===== 原型首页结构：与 prototype/mvp-v1.html 保持一致 ===== */
.home-figma {
    min-height: 764px;
    height: 100vh;
    padding: 0 16px 112px;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at -5% 4%, rgba(245,183,178,.78) 0, rgba(245,183,178,.42) 24%, transparent 48%),
        radial-gradient(circle at 92% 0%, rgba(248,216,181,.9) 0, rgba(248,216,181,.45) 29%, transparent 54%),
        linear-gradient(180deg, #fdf7f2 0%, #fffaf5 58%, #fffdfb 100%);
}

.home-figma:before {
    content: "XIYA";
    position: absolute;
    left: 24px;
    top: 142px;
    color: rgba(255,255,255,.33);
    font-size: 124px;
    font-weight: 900;
    letter-spacing: -5px;
    pointer-events: none;
}

.figma-brand {
    position: relative;
    z-index: 1;
    padding-top: 25px;
    font-size: 18px;
    font-weight: 900;
    color: #2e2e2e;
}

.figma-hero-copy {
    position: relative;
    z-index: 1;
    margin-top: 34px;
    width: 250px;
}

.figma-hero-copy h2 {
    margin: 0;
    font-size: 24px;
    line-height: 1.32;
    font-weight: 900;
    color: #2e2e2e;
}

.figma-hero-copy p {
    margin: 5px 0 0;
    color: #876860;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0;
}

.figma-advisor {
    position: absolute;
    right: 25px;
    top: 70px;
    width: 113px;
    height: 120px;
    object-fit: contain;
    z-index: 1;
}

.figma-memory-card {
    position: relative;
    z-index: 2;
    margin-top: 24px;
    min-height: 156px;
    border-radius: 15px;
    border: .5px solid #fff;
    background: rgba(255,255,255,.6);
    box-shadow: 0 4px 20px rgba(245,210,176,.35);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    padding: 14px;
}

.figma-memory-title {
    margin: 0 0 14px;
    color: #3a231f;
    font-size: 18px;
    font-weight: 900;
}

.figma-memory-text {
    font-size: 14px;
    line-height: 1.45;
    color: #7f635d;
    margin: 0 0 16px;
    font-weight: 700;
}

.figma-memory-cta {
    width: 100%;
    height: 43px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(95deg, #ff6973 0%, #ff9577 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 900;
    box-shadow: 0 10px 24px rgba(255,111,113,.18);
}

.figma-feature-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    margin-top: 10px;
}

.figma-feature {
    position: relative;
    overflow: hidden;
    height: 73px;
    border: .5px solid #f2d8d1;
    border-radius: 15px;
    background: rgba(255,255,255,.62);
    box-shadow: 0 4px 20px rgba(245,210,176,.35);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    text-align: left;
    padding: 14px 12px;
    color: #2e2e2e;
    font-size: 15px;
    font-weight: 700;
}

.figma-feature.active {
    border-color: #ff6973;
    background: rgba(255,246,244,.78);
}

.feature-arrow {
    position: absolute;
    right: 17px;
    bottom: 14px;
    color: #3a231f;
    font-size: 23px;
    font-weight: 900;
}

.figma-feature img {
    position: absolute;
    right: 16px;
    bottom: 9px;
    width: 44px;
    height: 44px;
    object-fit: contain;
    pointer-events: none;
}

.figma-pref {
    position: relative;
    z-index: 2;
    margin-top: 24px;
    min-height: 48px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    color: #7f635d;
    font-size: 14px;
    line-height: 1.55;
    font-weight: 700;
}

.figma-pref img {
    width: 33px;
    height: 33px;
    object-fit: cover;
    border-radius: 9px;
}

.figma-pref:after {
    content: none;
}

.figma-quick-row {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 8px;
    margin-top: 14px;
    overflow-x: auto;
}

.figma-mini-chip {
    height: 30px;
    border: .5px solid #f2d8d1;
    background: #fff;
    color: #2e2e2e;
    font-size: 12px;
    border-radius: 100px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    box-shadow: 0 4px 8px rgba(245,210,176,.28);
}

.figma-mini-chip svg {
    width: 18px;
    height: 18px;
    color: #4f5658;
    stroke-width: 1.9;
    flex: 0 0 auto;
}

.figma-consultant-card {
    position: relative;
    z-index: 2;
    margin-top: 18px;
    min-height: 52px;
    border-radius: 15px;
    border: .5px solid #f2d8d1;
    background: rgba(255,255,255,.58);
    box-shadow: 0 4px 20px rgba(245,210,176,.2);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: #3a231f;
}

.consultant-icon {
    width: 31px;
    height: 31px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.figma-consultant-card strong {
    display: block;
    font-size: 15px;
    font-weight: 900;
}

.figma-consultant-card p {
    margin: 2px 0 0;
    color: #9b7972;
    font-size: 12px;
    font-weight: 700;
}

.figma-consultant-card b {
    margin-left: auto;
    color: #f25661;
    font-size: 25px;
    line-height: 1;
}

.figma-home-nav {
    position: fixed;
    left: 50%;
    right: auto;
    bottom: 0;
    z-index: 1200;
    width: min(500px, 100vw);
    max-width: 500px;
    height: 72px;
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 7px 10px max(7px, env(safe-area-inset-bottom));
    border-top: 1px solid #efdcd6;
    border-radius: 0;
    background: #fff;
    box-shadow: 0 -8px 24px rgba(119,72,60,.05);
}

.nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    border: 0;
    background: transparent;
    color: #9b7c74;
    font-size: 11px;
    line-height: 1;
    font-weight: 800;
    text-align: center;
    white-space: nowrap;
}

.nav b {
    display: block;
    font-size: 21px;
    line-height: 1;
    font-weight: 400;
    margin-bottom: 0;
}

.figma-home-nav .nav b {
    font-size: 21px;
    margin-bottom: 0;
}

.nav.active {
    color: #f15363;
}

.figma-home-indicator {
    display: none;
}

/* ===== Figma 首页入口 ===== */
.source-home {
    position: relative;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
    padding: 0 20px 178px;
    background:
        radial-gradient(circle at -5% 4%, rgba(245,183,178,.78) 0, rgba(245,183,178,.42) 24%, transparent 48%),
        radial-gradient(circle at 92% 0%, rgba(248,216,181,.9) 0, rgba(248,216,181,.45) 29%, transparent 54%),
        linear-gradient(180deg, #fdf7f2 0%, #fffaf5 58%, #fffdfb 100%);
    color: #2e2e2e;
}

.source-home::before {
    content: "XIYA";
    position: absolute;
    left: 24px;
    top: 146px;
    pointer-events: none;
    color: rgba(255,255,255,.33);
    font-size: 124px;
    font-weight: 900;
    letter-spacing: -5px;
    line-height: 1;
}

.source-home > * {
    position: relative;
    z-index: 1;
}

.source-mini-pill {
    position: absolute;
    top: 23px;
    right: 7px;
    z-index: 2;
    width: 83px;
    height: 30px;
    padding: 0;
    border: .5px solid #dedede;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.72);
    box-shadow: none;
    font-size: 16px;
    font-weight: 700;
    color: #191919;
}

.source-mini-pill i {
    width: 1px;
    height: 17px;
    background: #dedede;
}

.source-hero {
    min-height: 190px;
}

.source-brand {
    padding-top: 25px;
    margin-bottom: 35px;
    font-size: 18px;
    line-height: 1;
    font-weight: 900;
    color: #2e2e2e;
    letter-spacing: 0;
}

.source-hero h1 {
    margin: 0;
    width: 286px;
    max-width: 286px;
    font-size: 24px;
    line-height: 1.32;
    font-weight: 900;
    color: #2e2e2e;
    letter-spacing: 0;
    white-space: nowrap;
}

.source-hero p {
    margin: 3px 0 0;
    color: #222;
    font-size: 14px;
    letter-spacing: 4px;
}

.source-advisor-img {
    position: absolute;
    right: 25px;
    top: 70px;
    width: 113px;
    height: 120px;
    object-fit: contain;
    z-index: 1;
}

.source-memory-card,
.source-feature-grid,
.source-preference-card,
.source-shortcuts,
.source-ask-bar {
    max-width: 343px;
    margin-left: auto;
    margin-right: auto;
}

.source-memory-card {
    position: relative;
    z-index: 2;
    margin-top: 26px;
    min-height: 100px;
    padding: 12px;
    border: .5px solid #fff;
    border-radius: 15px;
    background: rgba(255,255,255,.6);
    box-shadow: 0 4px 20px rgba(245,210,176,.35);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.source-card-title {
    display: none;
}

.source-memory-card p {
    margin: 0 0 12px;
    font-size: 14px;
    line-height: 1.45;
    font-weight: 500;
    color: #2e2e2e;
}

.source-primary-btn {
    width: 100%;
    height: 44px;
    border: 0;
    border-radius: 22px;
    background: linear-gradient(90deg, #f3aca8 0%, #f8cba6 100%);
    color: #2f211d;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(244, 155, 139, 0.18);
}

.source-memory-tags {
    display: flex;
    gap: 6px;
    margin-top: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.source-memory-tags::-webkit-scrollbar {
    display: none;
}

.source-memory-tags button {
    flex: 0 0 auto;
    border: 0;
    white-space: nowrap;
    border-radius: 100px;
    padding: 5px 10px;
    background: rgba(245,210,176,.5);
    color: #2e2e2e;
    font-size: 12px;
    font-weight: 400;
}

.source-memory-tags button::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 4px;
    margin-right: 5px;
    border-radius: 50%;
    vertical-align: 2px;
    background: #f2b59f;
}

.source-feature-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    margin-top: 7px;
}

.source-feature-card {
    position: relative;
    height: 90px;
    border: .5px solid #fff;
    border-radius: 15px;
    background: rgba(255,255,255,.62);
    box-shadow: 0 4px 20px rgba(245,210,176,.35);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    cursor: pointer;
    overflow: hidden;
    text-align: left;
    padding: 12px;
}

.source-feature-card span {
    position: relative;
    z-index: 2;
    display: block;
    max-width: 82px;
    color: #2e2e2e;
    font-size: 14px;
    line-height: 1.28;
    font-weight: 700;
}

.source-feature-card img {
    position: absolute;
    right: 9px;
    bottom: 10px;
    width: 54px;
    height: 54px;
    object-fit: contain;
    pointer-events: none;
    z-index: 1;
}

.source-preference-card {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 48px;
    min-height: 48px;
    margin-top: 67px;
    padding: 8px 34px 8px 10px;
    border: .5px solid #fff;
    border-radius: 15px;
    background: rgba(255,255,255,.62);
    box-shadow: 0 4px 20px rgba(245,210,176,.35);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    color: #2e2e2e;
    font-size: 14px;
    font-weight: 700;
    text-align: left;
}

.source-preference-card img {
    width: 33px;
    height: 33px;
    object-fit: cover;
    border-radius: 9px;
    flex: 0 0 auto;
}

.source-preference-card span {
    flex: 1;
}

.source-preference-card b {
    position: absolute;
    right: 12px;
    top: 10px;
    color: #2e2e2e;
    font-size: 20px;
    font-weight: 400;
    line-height: 1;
}

.source-shortcuts {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: flex-start;
    gap: 15px;
    margin-top: 12px;
    overflow-x: auto;
}

.source-shortcuts button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 30px;
    min-width: 0;
    padding: 6px 10px;
    border: 0;
    border-radius: 999px;
    background: #fff;
    color: #2e2e2e;
    box-shadow: 0 4px 8px rgba(245,210,176,.28);
    font-size: 12px;
    font-weight: 400;
    white-space: nowrap;
}

.source-shortcuts svg {
    width: 18px;
    height: 18px;
    color: #4f5658;
    flex: 0 0 auto;
}

.source-ask-bar {
    position: fixed;
    left: 50%;
    bottom: 103px;
    z-index: 8;
    width: calc(100% - 40px);
    max-width: 343px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    height: 50px;
    margin-top: 0;
    padding: 7px 7px 7px 15px;
    border: .5px solid rgba(245,210,176,.5);
    border-radius: 400px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 4px 20px rgba(245,210,176,.25);
}

.source-ask-bar span {
    flex: 1;
    color: #808080;
    font-size: 14px;
    font-weight: 400;
}

.source-ask-bar button {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: #fff3ee;
    box-shadow: 0 5px 14px rgba(245,183,178,.35);
    display: flex;
    align-items: center;
    justify-content: center;
}

.source-ask-bar img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.source-tabbar {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px;
    height: 83px;
    padding: 5px 0 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    background: #fff;
    box-shadow: 0 -4px 14px rgba(245,210,176,.22);
    border-radius: 12px 12px 0 0;
    z-index: 7;
}

.source-tabbar button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 0;
    background: transparent;
    color: #8e8988;
    font-size: 13px;
    font-weight: 650;
}

.source-tabbar svg {
    width: 27px;
    height: 27px;
}

.source-tabbar button.active {
    color: #eda39f;
}

/* ===== 个性化问候区 ===== */
.welcome-section {
    padding: 28px 24px 0;
    flex-shrink: 0;
}

.greeting-heading {
    font-size: 30px;
    font-weight: 700;
    color: #333333;
    letter-spacing: -0.75px;
    line-height: 1.25;
    margin: 0;
}

.greeting-name {
    color: #D81B60;
}

.greeting-punct {
    color: #333333;
}

.greeting-subtitle {
    font-size: 14px;
    color: #666666;
    margin: 6px 0 0;
    line-height: 1.5;
}

.budget-chat-header {
    display: none;
}

/* ===== 对话容器 ===== */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    padding-bottom: 148px; /* 为底部浮动区留空间 */
    background: var(--color-bg);
}

.chat-page.budget-chat-mode {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    background: #fffaf7;
    box-shadow: none;
}

.chat-page.budget-chat-mode .welcome-section {
    display: none;
}

.chat-page.budget-chat-mode .budget-chat-header {
    height: 58px;
    padding: 13px 17px 10px;
    display: grid;
    grid-template-columns: 36px 1fr 36px;
    align-items: center;
    flex-shrink: 0;
    background: #fffaf7;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.budget-back {
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: #3b251f;
    font-size: 30px;
    line-height: 1;
    padding: 0;
}

.budget-chat-title {
    text-align: center;
    font-size: 17px;
    font-weight: 800;
    color: #3b251f;
}

.chat-page.budget-chat-mode .chat-container {
    padding: 13px 16px 190px;
    background: transparent;
}

.chat-page.budget-chat-mode .message.ai,
.chat-page.budget-chat-mode .message.user {
    margin-bottom: 14px;
}

.chat-page.budget-chat-mode .message-avatar {
    display: none;
}

.chat-page.budget-chat-mode .message.ai .message-bubble {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #f6ddd5;
    border-radius: 17px;
    color: #3b251f;
    box-shadow: 0 8px 22px rgba(145, 83, 68, 0.08);
    padding: 14px 16px;
    line-height: 1.75;
}

.chat-page.budget-chat-mode .message.ai .message-content {
    max-width: 88%;
}

.chat-page.budget-chat-mode .message.user .message-bubble {
    background: #ffe4df;
    color: #3b251f;
    border-radius: 15px;
    padding: 10px 14px;
    box-shadow: none;
}

.chat-page.budget-chat-mode .message.user .message-content {
    max-width: 78%;
}

.chat-page.budget-chat-mode .message-user-avatar {
    display: none;
}

.chat-page.budget-chat-mode .bottom-floating {
    left: 50%;
    right: auto;
    bottom: 72px;
    width: min(500px, 100vw);
    max-width: 500px;
    transform: translateX(-50%);
    padding: 10px 16px 16px;
    background: linear-gradient(to top, #fffaf7 68%, rgba(255,250,247,0.94) 84%, rgba(255,250,247,0) 100%);
}

.chat-page.budget-chat-mode .chat-bottom-nav {
    position: fixed;
    left: 50%;
    right: auto;
    bottom: 0;
    width: min(500px, 100vw);
    max-width: 500px;
    height: 72px;
    padding: 7px 10px max(7px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    border-top: 1px solid #efdcd6;
    border-radius: 0;
    background: #fff;
    box-shadow: 0 -8px 24px rgba(119, 72, 60, .05);
    z-index: 110;
}

.chat-page.budget-chat-mode .chat-bottom-nav .figma-home-indicator {
    display: none;
}

.chat-page.budget-chat-mode .chat-bottom-nav .nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    color: #9b7c74;
    font-size: 11px;
    line-height: 1;
    font-weight: 800;
    white-space: nowrap;
}

.chat-page.budget-chat-mode .chat-bottom-nav .nav b {
    font-size: 21px;
    line-height: 1;
    margin-bottom: 0;
    font-weight: 400;
}

.chat-page.budget-chat-mode .chat-bottom-nav .nav.active {
    color: #f15363;
}

.chat-page.budget-chat-mode .quick-pills-row {
    display: none;
}

.chat-page.budget-chat-mode .input-bar {
    min-height: 48px;
    padding: 6px 7px;
    border: 1px solid #f3ded7;
    border-radius: 24px;
    box-shadow: 0 10px 28px rgba(145, 83, 68, .1);
    background: rgba(255,255,255,.96);
}

.chat-page.budget-chat-mode .input-bar-field {
    height: 38px;
    padding: 0 10px;
    font-size: 13px;
}

.chat-page.budget-chat-mode .input-bar-field::placeholder {
    color: #9b8179;
}

.chat-page.budget-chat-mode .input-btn-attach {
    display: none;
}

.chat-page.budget-chat-mode .input-right-btns {
    display: contents;
}

.chat-page.budget-chat-mode .input-btn-mic {
    order: -1;
    width: 36px;
    height: 36px;
    color: #3b251f;
}

.chat-page.budget-chat-mode .input-btn-send {
    order: 2;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #ff6f73, #ff9c7f);
    color: #fff;
}

.chat-page.budget-chat-mode .input-btn-send svg path {
    stroke: #fff;
}

.chat-container::-webkit-scrollbar {
    width: 4px;
}

.chat-container::-webkit-scrollbar-thumb {
    background: #D4C5F9;
    border-radius: 2px;
}

/* 时间戳 */
.timestamp {
    text-align: center;
    color: var(--color-text-hint);
    font-size: 12px;
    margin: 16px 0 12px;
    background: rgba(0,0,0,0.04);
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    width: auto;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}

/* 消息组 */
.message-group {
    margin-bottom: 12px;
}

/* ===== AI消息（卡片风格） ===== */
.message.ai {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 16px;
}

/* AI 头像圆圈 */
.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(176, 224, 230, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.message.ai .message-content {
    flex: 1;
    min-width: 0;
}

.message.ai .message-bubble {
    background: var(--color-blue);
    padding: 20px;
    border-radius: 4px 20px 20px 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.06);
    font-size: 14px;
    line-height: 1.7;
    color: #2a3a3d;
    word-wrap: break-word;
    box-sizing: border-box;
}

/* ===== 月嫂预算方案卡（首页“帮我算预算”闭环） ===== */
.nanny-budget-card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #ffd2cb;
    border-radius: 17px;
    padding: 13px;
    box-shadow: 0 8px 22px rgba(145, 83, 68, 0.08);
    color: #3b251f;
}

.nanny-budget-card h3 {
    margin: 0 0 9px;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 800;
}

.budget-tag {
    display: inline-flex;
    align-items: center;
    margin-left: 5px;
    padding: 3px 7px;
    border-radius: 9px;
    background: #ffe5e5;
    color: #ff6f73;
    font-size: 11px;
    font-weight: 800;
}

.nanny-budget-price {
    color: #f25661;
    font-weight: 900;
    font-size: 24px;
    letter-spacing: .2px;
    margin-bottom: 8px;
}

.nanny-budget-card p {
    color: #9b8179;
    font-size: 12px;
    line-height: 1.65;
    margin: 8px 0 11px;
}

.budget-compare-row {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 10px;
    margin-top: 7px;
    border: 1px solid #f2ddd6;
    border-radius: 13px;
    background: #fff;
}

.budget-compare-row.selected {
    border-color: #ff8c9a;
    background: #fff7f7;
}

.budget-compare-row.unavailable {
    opacity: .58;
}

.budget-compare-row.unavailable b {
    color: #9b8179;
    font-size: 12px;
    white-space: nowrap;
}

.budget-badge {
    flex: 0 0 auto;
    border-radius: 9px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 800;
}

.budget-badge.pink {
    color: #f25661;
    background: #ffe5e5;
}

.budget-badge.orange {
    color: #d88432;
    background: #fff5e7;
}

.budget-badge.green {
    color: #3c9d66;
    background: #eaf8ef;
}

.budget-badge.blue {
    color: #3677bf;
    background: #e9f3ff;
}

.budget-badge.teal {
    color: #1e9b88;
    background: #e8f8f5;
}

.budget-row-main {
    flex: 1;
    min-width: 0;
}

.budget-row-title {
    font-size: 12px;
    color: #3b251f;
    font-weight: 800;
}

.budget-row-sub {
    margin-top: 2px;
    font-size: 11px;
    color: #9b8179;
}

.budget-compare-row b {
    color: #f25661;
}

.nanny-budget-primary {
    width: 100%;
    border: 0;
    margin-top: 12px;
    color: #fff;
    border-radius: 22px;
    padding: 12px 14px;
    font-weight: 800;
    background: linear-gradient(135deg, #ff6f73, #ff9c7f);
    box-shadow: 0 8px 16px rgba(242, 86, 97, .2);
}

.budget-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    overflow: visible;
    margin-top: 12px;
    width: 100%;
}

.budget-pill-row button {
    white-space: nowrap;
    border: 1px solid #f2ddd6;
    background: #fff;
    border-radius: 20px;
    padding: 7px 11px;
    font-size: 11px;
    color: #805f59;
}

.chat-page.budget-chat-mode .nanny-budget-card {
    width: 100%;
    border-radius: 17px;
    padding: 14px;
    border-color: #f4cfc7;
    box-shadow: none;
}

.chat-page.budget-chat-mode .budget-plan-message .message-content {
    max-width: 100%;
}

.chat-page.budget-chat-mode .nanny-budget-card h3 {
    font-size: 14px;
    margin-bottom: 8px;
}

.chat-page.budget-chat-mode .nanny-budget-price {
    font-size: 24px;
    line-height: 1.2;
    margin: 6px 0 10px;
}

.chat-page.budget-chat-mode .nanny-budget-card p {
    font-size: 12px;
    line-height: 1.65;
    margin: 0 0 12px;
}

.chat-page.budget-chat-mode .budget-compare-row {
    border: 0;
    border-top: 1px solid #f3e3de;
    border-radius: 0;
    margin-top: 0;
    padding: 10px 0;
    background: transparent;
    cursor: pointer;
    transition: background .16s ease, padding-left .16s ease;
}

.chat-page.budget-chat-mode .budget-compare-row.selected {
    border-color: #f3e3de;
    background: transparent;
}

.chat-page.budget-chat-mode .budget-compare-row:active,
.chat-page.budget-chat-mode .budget-compare-row:focus-visible {
    background: #fff7f5;
    outline: none;
    padding-left: 6px;
}

.chat-page.budget-chat-mode .budget-badge {
    min-width: 44px;
    text-align: center;
    padding: 4px 7px;
    font-size: 10px;
}

.chat-page.budget-chat-mode .budget-row-title {
    font-size: 14px;
}

.chat-page.budget-chat-mode .budget-row-sub {
    font-size: 11px;
}

.chat-page.budget-chat-mode .budget-compare-row b {
    color: #3b251f;
    font-size: 18px;
}

.chat-page.budget-chat-mode .nanny-budget-primary {
    height: 46px;
    border-radius: 23px;
    margin-top: 12px;
    font-size: 14px;
}

.chat-page.budget-chat-mode .budget-pill-row {
    margin-top: 12px;
    padding: 0;
}

.chat-page.budget-chat-mode .budget-pill-row button {
    background: rgba(255,255,255,.8);
    font-size: 12px;
}

.caregiver-recommend-card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #f2ddd6;
    border-radius: 17px;
    padding: 13px;
    box-shadow: 0 8px 22px rgba(145, 83, 68, 0.08);
    color: #3b251f;
}

.caregiver-recommend-title {
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 4px;
}

.caregiver-recommend-sub {
    color: #9b8179;
    font-size: 11px;
    line-height: 1.5;
    margin-bottom: 10px;
}

.caregiver-mini-row {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-top: 1px solid #f7e8e3;
}

.caregiver-mini-avatar {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: linear-gradient(135deg, #ffe5e5, #fff5e7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex: 0 0 auto;
}

.caregiver-mini-main {
    flex: 1;
    min-width: 0;
}

.caregiver-mini-name {
    font-size: 13px;
    font-weight: 800;
    color: #3b251f;
}

.caregiver-mini-meta {
    margin-top: 2px;
    color: #9b8179;
    font-size: 11px;
}

.caregiver-mini-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 6px;
}

.caregiver-mini-tags span {
    border-radius: 9px;
    padding: 3px 6px;
    background: #fff3ee;
    color: #b06a60;
    font-size: 10px;
}

.caregiver-mini-reason {
    margin-top: 5px;
    color: #805f59;
    font-size: 11px;
    line-height: 1.5;
}

.caregiver-contact-btn {
    width: 100%;
    border: 0;
    margin-top: 10px;
    color: #fff;
    border-radius: 20px;
    padding: 10px 12px;
    font-weight: 800;
    background: linear-gradient(135deg, #ff6f73, #ff9c7f);
}

/* AI 卡片图标（欢迎消息） */
.ai-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-bottom: 14px;
}

.ai-card-body {
    margin-bottom: 18px;
}

.ai-card-body p {
    margin: 0 0 2px;
    line-height: 22.75px;
}

.ai-card-question {
    margin: 0;
    line-height: 22.75px;
    color: #1a3a42;
    font-weight: 500;
}

/* AI 回复富文本排版 */
.msg-paragraph {
    margin: 0 0 10px;
    line-height: 1.7;
}
.msg-paragraph:last-child { margin-bottom: 0; }

.msg-list-item {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin: 4px 0;
    line-height: 1.6;
}
.msg-list-item .msg-bullet { flex-shrink: 0; }

.msg-divider {
    height: 1px;
    background: rgba(255,255,255,0.4);
    margin: 12px 0;
}

/* ===== 用户消息 ===== */
.message.user {
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 16px;
}

.message.user .message-content {
    max-width: 72%;
}

.message.user .message-bubble {
    background: var(--color-pink);
    color: #5a1a2e;
    border-radius: 20px 4px 20px 20px;
    box-shadow: 0 4px 16px -2px rgba(255, 209, 220, 0.5);
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.6;
}

/* 用户头像 */
.message-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #F8A8BE, #E91E8C);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    color: white;
    font-weight: 600;
}

/* ===== 卡片 ===== */
.card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 8px;
    box-shadow: 0 2px 8px rgba(152, 128, 208, 0.12);
    max-width: 280px;
    border: 1px solid var(--color-divider);
}

.card-header {
    padding: 12px 14px;
    border-bottom: 1px solid var(--color-divider);
    font-weight: 600;
    color: #3D2D7A;
    font-size: 15px;
    background: linear-gradient(135deg, #F8F5FF 0%, #ffffff 100%);
}

.card-body {
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-text);
}

.card-footer {
    padding: 10px 14px;
    border-top: 1px solid var(--color-divider);
    text-align: center;
    background: #FAFAFA;
}

.card-link {
    color: var(--color-primary-btn);
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    font-weight: 500;
}

/* ===== 底部浮动区 ===== */
.bottom-floating {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background: linear-gradient(to top, #F5F5F5 50%, rgba(245,245,245,0.95) 75%, transparent 100%);
    z-index: 100;
}

/* 快捷功能胶囊行 */
.quick-pills-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
}

.quick-pills-row::-webkit-scrollbar {
    display: none;
}

.quick-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 13px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(238, 238, 238, 0.5);
    box-shadow: 0 8px 32px -4px rgba(0, 0, 0, 0.04);
    white-space: nowrap;
    cursor: pointer;
    font-size: 11px;
    color: #333333;
    flex-shrink: 0;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    transition: all 0.2s;
}

.quick-pill:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 1);
}

.pill-icon-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

/* 胶囊输入栏 */
.input-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 9999px;
    border: 1px solid #EEEEEE;
    padding: 7px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.input-bar-field {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    font-size: 14px;
    color: var(--color-text);
    padding: 0 12px;
    height: 44px;
    min-width: 0;
}

.input-bar-field::placeholder {
    color: rgba(102, 102, 102, 0.5);
}

.input-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    transition: all 0.2s;
}

.input-btn:active {
    transform: scale(0.9);
}

.input-btn-attach {
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-btn-mic {
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-btn-send {
    background: var(--color-primary);
    color: #5C4A9A;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.input-right-btns {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* 兼容旧选择器（动态消息用） */
.input-container { display: none; }
.quick-actions-container { display: none; }

/* ===== 打字指示器 ===== */
.typing-indicator {
    display: inline-flex;
    gap: 4px;
    padding: 10px 14px;
    background: var(--color-blue);
    border-radius: 0 10px 10px 10px;
}

.typing-dot {
    width: 7px;
    height: 7px;
    background: #5BA3AE;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.6;
    }
    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

/* ===== 知识库项目 ===== */
.knowledge-item {
    background: #F8F5FF;
    padding: 10px 12px;
    border-radius: 8px;
    margin: 6px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #E8E0F8;
}

.knowledge-item:hover {
    background: var(--color-primary);
    border-color: #C8B8F0;
}

.knowledge-icon {
    font-size: 20px;
}

.knowledge-info {
    flex: 1;
}

.knowledge-title {
    font-size: 14px;
    font-weight: 600;
    color: #3D2D7A;
    margin-bottom: 2px;
}

.knowledge-meta {
    font-size: 12px;
    color: var(--color-text-hint);
}

/* ===== 提醒项目 ===== */
.reminder-item {
    background: var(--color-warning-bg);
    padding: 10px 12px;
    border-radius: 8px;
    margin: 6px 0;
    border-left: 3px solid var(--color-warning-text);
}

.reminder-time {
    font-size: 12px;
    color: #F57C00;
    font-weight: 600;
    margin-bottom: 4px;
}

.reminder-content {
    font-size: 13px;
    color: var(--color-text);
    line-height: 1.5;
}

/* ===== 响应式 ===== */
@media (max-width: 767px) {
    #app {
        width: 100%;
    }

    .chat-container {
        padding: 20px 16px 148px;
    }

    .welcome-section {
        padding: 24px 16px 0;
    }

    .greeting-heading {
        font-size: 26px;
    }
}

@media (min-width: 1024px) {
    body {
        display: flex;
        justify-content: center;
        background: #EDE8F8;
    }

    #app {
        max-width: 500px;
        margin: 0 auto;
        box-shadow: 0 0 24px rgba(152, 128, 208, 0.18);
        position: relative;
    }

    .bottom-floating {
        max-width: 500px;
        left: 50%;
        transform: translateX(-50%);
    }

}
