/**
 * 广府非遗文化打卡成就系统样式
 * 右侧浮动侧边栏设计
 */

/* ==================== 浮动面板容器 ==================== */

.gami-floating-panel {
    position: fixed;
    top: 70px;
    right: 0;
    width: 416px;
    height: calc(100vh - 70px);
    /* 低于任务弹窗与测验层，避免遮挡模态内容 */
    z-index: 10040;
    font-family: "Noto Serif SC", "Noto Serif CJK SC", serif;
    pointer-events: none;
}

.gami-floating-panel .gami-floating-toggle,
.gami-floating-panel .gami-floating-content {
    pointer-events: auto;
}

/* 收起状态：抽屉隐藏，切换钮贴在屏幕右缘纵向居中（侧边栏语义，避免误落底部） */
.gami-floating-panel.collapsed .gami-floating-content {
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
}

.gami-floating-panel.collapsed .gami-floating-toggle {
    top: 50%;
    bottom: auto;
    right: calc(6px + env(safe-area-inset-right, 0px));
    transform: translateY(-50%);
    border-radius: 50%;
    width: 52px;
    height: 52px;
    box-shadow: -4px 0 18px rgba(196, 30, 58, 0.28);
}

/* 展开状态：切换钮贴在抽屉左缘 */
.gami-floating-panel.expanded .gami-floating-content {
    transform: translateX(0);
    opacity: 1;
}

.gami-floating-panel.expanded .gami-floating-toggle {
    top: 50%;
    bottom: auto;
    right: 360px;
    transform: translateY(-50%);
    border-radius: 20px 0 0 20px;
    width: 56px;
    height: 56px;
}

/* ==================== 切换按钮 ==================== */

.gami-floating-toggle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 360px;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #c41e3a, #d4af37);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: white;
    font-size: 1.1rem;
    box-shadow: -4px 0 16px rgba(196, 30, 58, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    z-index: 1;
}

.gami-floating-panel.expanded .gami-floating-toggle:hover {
    transform: translateY(-50%) scale(1.08);
    box-shadow: -6px 0 24px rgba(196, 30, 58, 0.4);
}

.gami-floating-panel.collapsed .gami-floating-toggle:hover {
    transform: translateY(-50%) scale(1.06);
    box-shadow: -4px 0 22px rgba(196, 30, 58, 0.35);
}

.gami-floating-toggle i {
    font-size: 1.15rem;
    line-height: 1;
}

.gami-toggle-text {
    font-size: 0.65rem;
    font-weight: 600;
    line-height: 1.1;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gami-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 28px;
    height: 28px;
    background: #d4af37;
    color: white;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    border: 2px solid white;
}

/* 脉冲动画（新任务提示） */
.gami-badge.pulse {
    animation: gamiPulse 1.5s ease infinite;
}

@keyframes gamiPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 6px rgba(212, 175, 55, 0.4);
    }
    50% {
        transform: scale(1.15);
        box-shadow: 0 4px 16px rgba(212, 175, 55, 0.6);
    }
}

/* ==================== 浮动内容面板 ==================== */

.gami-floating-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 360px;
    height: calc(100vh - 70px);
    background:
      linear-gradient(180deg, rgba(255,252,248,0.99) 0%, rgba(252,248,244,0.99) 60%, rgba(248,244,240,0.99) 100%),
      repeating-linear-gradient(
        45deg,
        rgba(212,175,55,0.02) 0px,
        transparent 1px,
        transparent 12px,
        rgba(212,175,55,0.01) 13px
      );
    border-left: 2px solid rgba(212,175,55,0.45);
    box-shadow:
        -8px 0 32px rgba(120,30,10,0.18),
        -2px 0 8px rgba(120,30,10,0.08),
        inset 3px 0 8px rgba(212,175,55,0.06);
    display: flex;
    flex-direction: column;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.gami-floating-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #c41e3a 0%, #a01830 60%, #8b1528 100%);
    border-bottom: 2px solid rgba(212,175,55,0.4);
    flex-shrink: 0;
    box-shadow: 0 3px 12px rgba(120,30,10,0.2), inset 0 1px 0 rgba(255,255,255,0.1);
    position: relative;
}

/* 头部两侧卷草纹装饰 */
.gami-floating-header::before,
.gami-floating-header::after {
    content: '◈';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: rgba(212,175,55,0.5);
    font-family: serif;
}

.gami-floating-header::before { left: 12px; }
.gami-floating-header::after  { right: 48px; }

.gami-floating-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: white;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: 0.06em;
    font-family: "Noto Serif SC", serif;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.gami-floating-header h3 i {
    color: #d4af37;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.gami-floating-close {
    width: 32px;
    height: 32px;
    border: 1.5px solid rgba(255,255,255,0.35);
    background: rgba(0,0,0,0.1);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.25s ease;
}

.gami-floating-close:hover {
    background: rgba(0,0,0,0.2);
    transform: rotate(90deg) scale(1.08);
}

/* ==================== 面板内容区 ==================== */

.gami-floating-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.9rem 1rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    background: transparent;
}

/* ========== 侧栏分区标签 ========== */
.gami-panel-tabs {
    display: flex;
    gap: 0.3rem;
    padding: 0.45rem 0.6rem;
    background: linear-gradient(180deg, rgba(255,252,248,0.98) 0%, rgba(250,248,244,0.98) 100%);
    border-radius: 14px;
    border: 1.5px solid rgba(212,175,55,0.3);
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(120,60,10,0.05);
}

.gami-tab {
    flex: 1;
    border: none;
    background: transparent;
    color: #78716c;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: "Noto Serif SC", serif;
    padding: 6px 8px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.3, 0.64, 1);
    letter-spacing: 0.02em;
}

.gami-tab:hover {
    background: rgba(196, 30, 58, 0.06);
    color: rgba(196,30,58,0.8);
}

.gami-tab.active {
    background: linear-gradient(135deg, #c41e3a 0%, #a01830 100%);
    color: white;
    box-shadow: 0 3px 10px rgba(196,30,58,0.25), inset 0 1px 0 rgba(255,255,255,0.15);
    font-weight: 700;
}

.gami-tab-panels {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.gami-tab-panel {
    display: none;
    flex-direction: column;
    gap: 0.65rem;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.gami-tab-panel.active {
    display: flex;
}

.gami-tab-hint {
    font-size: 0.78rem;
    color: #a0522d;
    margin: -0.35rem 0 0.6rem;
    line-height: 1.5;
}

.gami-dev-details {
    flex-shrink: 0;
    border-radius: 10px;
    border: 1px dashed rgba(108, 117, 125, 0.25);
    background: rgba(108, 117, 125, 0.04);
    padding: 0 0.5rem 0.5rem;
}

.gami-dev-summary {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: #5c4033;
    cursor: pointer;
    padding: 0.55rem 0.35rem 0.5rem;
    list-style: none;
    line-height: 1.35;
}

.gami-dev-summary::-webkit-details-marker {
    display: none;
}

.gami-dev-details[open] .gami-dev-summary {
    margin-bottom: 0.35rem;
}

.gami-dev-details .gami-debug-card {
    margin: 0;
}

/* 滚动条样式 */
.gami-floating-body::-webkit-scrollbar {
    width: 6px;
}

.gami-floating-body::-webkit-scrollbar-track {
    background: transparent;
}

.gami-floating-body::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.3);
    border-radius: 3px;
}

/* ==================== 进度卡片 ==================== */

.gami-progress-card {
    background: linear-gradient(
        135deg,
        rgba(196, 30, 58, 0.06) 0%,
        rgba(212, 175, 55, 0.08) 50%,
        rgba(196, 30, 58, 0.04) 100%
    );
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 14px;
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

.gami-progress-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #c41e3a, #d4af37, #c41e3a);
}

.gami-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.875rem;
}

.gami-card-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: white;
    flex-shrink: 0;
    overflow: hidden;
}

.gami-card-title {
    flex: 1;
    min-width: 0;
}

.gami-card-title h3 {
    font-size: 1.02rem;
    font-weight: 700;
    color: #2d1810;
    margin: 0 0 0.2rem 0;
}

.gami-card-title p {
    font-size: 0.85rem;
    color: #8b4513;
    margin: 0;
}

.gami-points-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(135deg, #c41e3a, #d4af37);
    color: white;
    padding: 0.4rem 0.6rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(196, 30, 58, 0.2);
}

.points-value {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
}

.points-label {
    font-size: 0.7rem;
    opacity: 0.9;
}

.gami-progress-bar {
    height: 8px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.4rem;
}

.gami-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #c41e3a, #d4af37);
    border-radius: 4px;
    transition: width 0.5s ease;
    position: relative;
}

.gami-progress-fill::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.gami-progress-text {
    font-size: 0.82rem;
    color: #8b4513;
    text-align: center;
}

.gami-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: auto;
    max-width: 100%;
    padding: 0.7rem 1.2rem;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: "Noto Serif SC", serif;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    box-sizing: border-box;
}

/* 侧栏主操作、弹窗底栏等需要通栏按钮 */
.gami-progress-card > .gami-btn,
.gami-btn-block {
    display: flex;
    width: 100%;
}

.gami-quest-item .gami-btn {
    margin-top: 0;
    flex-shrink: 0;
    white-space: nowrap;
}

.gami-btn-primary {
    background: linear-gradient(135deg, #c41e3a 0%, #a01830 50%, #8b1528 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(196,30,58,0.3), inset 0 1px 0 rgba(255,255,255,0.15);
    border: 1px solid rgba(212,175,55,0.3);
}

.gami-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(196,30,58,0.4), inset 0 1px 0 rgba(255,255,255,0.2);
    filter: brightness(1.06);
}

/* ==================== 章节列表 ==================== */

.gami-chapters-card {
    background: white;
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 14px;
    padding: 0.875rem;
}

.gami-card-title-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: #c41e3a;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed rgba(212, 175, 55, 0.2);
}

.gami-chapters-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.gami-chapter-item {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.7rem;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gami-chapter-item:hover {
    background: rgba(196, 30, 58, 0.04);
    border-color: rgba(196, 30, 58, 0.2);
    transform: translateX(3px);
}

.gami-chapter-item.locked {
    opacity: 0.45;
    cursor: not-allowed;
}

.gami-chapter-item.locked:hover {
    transform: none;
}

.gami-chapter-item.current {
    background: rgba(196, 30, 58, 0.06);
    border-color: rgba(196, 30, 58, 0.25);
}

.gami-chapter-item.completed {
    opacity: 0.6;
}

.gami-chapter-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    flex-shrink: 0;
    overflow: hidden;
}

.gami-chapter-info {
    flex: 1;
    min-width: 0;
}

.gami-chapter-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2d1810;
    margin-bottom: 0.25rem;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.35;
    word-break: break-word;
}

.gami-chapter-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gami-chapter-bar {
    flex: 1;
    height: 3px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 2px;
    overflow: hidden;
}

.gami-chapter-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease;
}

.gami-chapter-percent {
    font-size: 0.72rem;
    color: #a0522d;
}

.gami-chapter-locked {
    font-size: 0.75rem;
    color: #999;
}

.gami-chapter-badge {
    font-size: 0.55rem;
    padding: 0.2rem 0.5rem;
    background: #c41e3a;
    color: white;
    border-radius: 6px;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 0.1rem;
}

/* ==================== 碎片收集 ==================== */

.gami-fragments-card {
    background: white;
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 14px;
    padding: 0.875rem;
}

.gami-fragment-count {
    margin-left: auto;
    font-size: 0.65rem;
    color: #a0522d;
    background: rgba(196, 30, 58, 0.08);
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
}

.gami-fragments-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.gami-fragment-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    cursor: pointer;
    font: inherit;
    color: inherit;
    -webkit-appearance: none;
    appearance: none;
}

.gami-fragment-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.gami-fragment-item.collected {
    border-color: var(--fragment-color, #c41e3a);
    box-shadow:
        0 2px 8px color-mix(in srgb, var(--fragment-color, #c41e3a) 28%, transparent),
        0 1px 0 rgba(255, 255, 255, 0.85) inset;
}

.gami-fragment-icon {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #999;
    margin-bottom: 0.2rem;
    overflow: hidden;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

/* 收集状态下图标背景：按每类 --fragment-color 生成渐变，与边框主色一致 */
.gami-fragment-item.collected .gami-fragment-icon {
    --fc: var(--fragment-color, #c41e3a);
    background: var(--fc);
    background: linear-gradient(
        155deg,
        color-mix(in srgb, var(--fc) 72%, white) 0%,
        var(--fc) 52%,
        color-mix(in srgb, var(--fc) 55%, black) 100%
    );
    color: #fffef5;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.4) inset,
        0 4px 0 rgba(0, 0, 0, 0.38),
        0 6px 14px color-mix(in srgb, var(--fc) 42%, transparent);
}

/* SVG 图标在收集格子里居中、尺寸合适 */
.gami-fragment-item.collected .gami-fragment-icon svg,
.gami-fragment-item.collected .gami-fragment-icon span {
    width: 1.65em;
    height: 1.65em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.gami-fragment-item.collected:hover .gami-fragment-icon {
    transform: translateY(-1px);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.45) inset,
        0 5px 0 rgba(0, 0, 0, 0.35),
        0 8px 18px color-mix(in srgb, var(--fc, var(--fragment-color, #c41e3a)) 48%, transparent);
}

.gami-fragment-name {
    font-size: 0.72rem;
    color: #8b4513;
    width: 100%;
    line-height: 1.3;
}

.gami-fragment-done-label {
    font-size: 0.58rem;
    font-weight: 700;
    color: #2e7d32;
    letter-spacing: 0.02em;
    margin-top: 0.12rem;
    line-height: 1.2;
}

.gami-fragment-item:focus-visible {
    outline: 2px solid rgba(196, 30, 58, 0.45);
    outline-offset: 2px;
}

.gami-fragment-count-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 22px;
    height: 22px;
    background: var(--fragment-color, #c41e3a);
    color: white;
    font-size: 0.55rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid white;
    box-shadow: 0 2px 6px rgba(196, 30, 58, 0.35);
}

.gami-fragment-complete-badge {
    font-size: 0.62rem;
    border-radius: 50%;
    min-width: 22px;
    width: 22px;
    padding: 0;
    background: linear-gradient(145deg, #43a047, #2e7d32);
    border-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.45);
}

/* ==================== 成就展示 ==================== */

.gami-achievements-card {
    background: white;
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 14px;
    padding: 0.875rem;
}

.gami-achievement-count {
    margin-left: auto;
    font-size: 0.65rem;
    color: #a0522d;
    background: rgba(212, 175, 55, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
}

.gami-achievements-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

/* 无成就时占位块在 flex 内默认贴左，需占满整行并居中 */
.gami-achievements-grid .gami-empty-state {
    grid-column: 1 / -1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.gami-achievement-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.6rem;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.12), rgba(212, 175, 55, 0.06));
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.gami-achievement-item:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 10px rgba(212, 175, 55, 0.2);
}

.gami-achievement-badge {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d4af37, #c4941f);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* 修复：SVG 用 flex 居中，color 由内联 span 控制 */
    color: #2d1810;
}

.gami-achievement-name {
    font-size: 0.75rem;
    color: #2d1810;
    font-weight: 600;
}

.gami-empty-state {
    text-align: center;
    padding: 1rem;
    color: #a0522d;
}

.gami-empty-state i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    opacity: 0.4;
}

.gami-empty-state p {
    font-size: 0.75rem;
}

.gami-debug-card {
    background: rgba(108,117,125,0.08);
    border: 1px dashed rgba(108,117,125,0.3);
    border-radius: 14px;
    padding: 0.875rem;
}

.gami-debug-card .gami-card-title-bar {
    color: #6c757d;
    border-bottom-color: rgba(108,117,125,0.15);
}

/* ==================== 文化日历卡片 ==================== */

.gami-calendar-card-wrapper {
    /* wrapper just for structure */
}

.gami-calendar-card {
    background: linear-gradient(135deg, rgba(196,30,58,0.06), rgba(212,175,55,0.08));
    border: 1px solid rgba(212,175,55,0.25);
    border-radius: 14px;
    padding: 0.875rem;
    position: relative;
    overflow: hidden;
}

.gami-calendar-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #c41e3a, #d4af37);
}

.gami-calendar-header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.65rem 1rem;
    align-items: start;
    margin-bottom: 0.75rem;
}

.gami-calendar-lunar {
    font-size: 0.95rem;
    font-weight: 700;
    color: #c41e3a;
    font-family: "Noto Serif SC", serif;
}

.gami-calendar-solar-term {
    font-size: 0.8rem;
    color: #a0522d;
    margin-top: 0.15rem;
}

/* 紧凑视图节气图标（带颜色图标） */
.gami-calendar-solar-term-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    margin-top: 0.15rem;
    font-weight: 600;
    animation: solarTermShine 3s ease-in-out infinite;
}

.gami-calendar-solar-term-item i {
    font-size: 0.75rem;
    animation: solarTermSpin 8s linear infinite;
}

@keyframes solarTermShine {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

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

.gami-calendar-month {
    font-size: 0.88rem;
    color: #8b4513;
    font-weight: 600;
}

.gami-calendar-festivals {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.6rem;
}

.gami-calendar-festival-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1 1 calc(50% - 0.35rem);
    min-width: 180px;
    padding: 0.5rem 0.6rem;
    background: rgba(255, 255, 255, 0.55);
    border-radius: 10px;
    border: 1px solid rgba(212, 175, 55, 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gami-calendar-festival-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.08);
}

.gami-calendar-festival-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    overflow: hidden;
}

.gami-calendar-festival-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: #2d1810;
    line-height: 1.2;
}

.gami-calendar-festival-date {
    font-size: 0.78rem;
    color: #a0522d;
}

.gami-calendar-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    width: 100%;
    font-size: 0.85rem;
    color: #c41e3a;
    background: transparent;
    border: none;
    border-top: 1px dashed rgba(212,175,55,0.2);
    padding: 0.5rem 0.3rem;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.2s, background 0.2s;
    border-radius: 0 0 6px 6px;
}

.gami-calendar-more:hover {
    background: rgba(196, 30, 58, 0.06);
    opacity: 1;
}

/* ==================== 节日弹窗 ==================== */

.gami-festival-modal {
    background: linear-gradient(145deg, rgba(255,255,255,0.99) 0%, rgba(252,248,242,0.98) 55%, rgba(255,250,245,0.99) 100%);
    border-radius: 22px;
    width: 100%;
    max-width: min(98vw, 1120px);
    max-height: 88vh;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0,0,0,0.22), 0 0 0 1px rgba(212,175,55,0.15) inset;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(212, 175, 55, 0.22);
}

.gami-festival-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.35rem;
    background: linear-gradient(120deg, #9f1428 0%, #c41e3a 45%, #a61f2d 100%);
    color: white;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.gami-festival-modal-header .gami-panel-close {
    position: relative;
    top: auto;
    right: auto;
    flex-shrink: 0;
    z-index: 2;
}

.gami-festival-modal-header::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 120% at 100% 0%, rgba(255,255,255,0.12), transparent 55%);
    pointer-events: none;
}

.gami-festival-modal-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.65rem;
    font-size: 1.45rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
    line-height: 1.35;
}

.gami-festival-lunar-hint {
    font-size: 1.05rem;
    font-weight: 500;
    opacity: 0.95;
    background: rgba(255,255,255,0.22);
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.25);
    backdrop-filter: blur(6px);
}

.gami-festival-modal-layout {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.gami-festival-modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    min-width: 0;
}

.gami-festival-ai-aside {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 280px;
    max-height: 42vh;
    border-top: 1px solid rgba(212, 175, 55, 0.22);
    background: linear-gradient(180deg, rgba(196,30,58,0.04), rgba(212,175,55,0.06));
    padding: 0;
}

/* ==================== 明信片容器 ==================== */
.gami-postcard-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

/* 印章缎带：左侧称谓与姓名，右侧人物头像 */
.postcard-stamp-ribbon {
    position: absolute;
    top: 10px;
    left: 12px;
    right: 12px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    z-index: 10;
    animation: stampEntrance 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.ribbon-identity {
    flex: 1;
    min-width: 0;
    text-align: left;
    line-height: 1.25;
}

.ribbon-role {
    font-size: 0.82rem;
    color: #c41e3a;
    font-weight: 800;
    font-family: 'Noto Serif SC', serif;
    letter-spacing: 0.04em;
    text-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.ribbon-name {
    font-size: 1.15rem;
    color: #8b6914;
    font-weight: 700;
    font-family: 'Noto Serif SC', serif;
    margin-top: 2px;
    letter-spacing: 0.06em;
}

.stamp-circle {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c41e3a, #a01729);
    border: 2.5px solid #f7d774;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(196,30,58,0.4), inset 0 1px 0 rgba(255,255,255,0.2);
    animation: stampPulse 3s ease-in-out infinite;
}

.stamp-circle .stamp-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

.stamp-circle.stamp-circle--fallback {
    font-size: 1.25rem;
    color: #f7d774;
    font-weight: 800;
    font-family: 'Noto Serif SC', serif;
}

.stamp-circle.stamp-circle--fallback::after {
    content: '礼';
}

@keyframes stampEntrance {
    from { opacity: 0; transform: scale(0.3) rotate(-20deg); }
    to { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes stampPulse {
    0%, 100% { box-shadow: 0 3px 10px rgba(196,30,58,0.4), inset 0 1px 0 rgba(255,255,255,0.2); }
    50% { box-shadow: 0 5px 16px rgba(196,30,58,0.6), inset 0 1px 0 rgba(255,255,255,0.3), 0 0 0 3px rgba(247,215,116,0.3); }
}

/* 明信片主体（顶部留白给人物条） */
.postcard-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin: 64px 12px 0 12px;
    background: linear-gradient(145deg, #fffdf8 0%, #fffef5 50%, #fdf8ee 100%);
    border-radius: 16px;
    border: 1.5px solid rgba(212,175,55,0.35);
    box-shadow:
        0 4px 16px rgba(196,30,58,0.08),
        0 1px 4px rgba(0,0,0,0.06),
        inset 0 0 0 1px rgba(255,255,255,0.8);
    overflow: hidden;
    position: relative;
    animation: postcardSlideIn 0.5s ease-out;
}

.postcard-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, #c41e3a, #d4af37, #c41e3a);
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
}

@keyframes postcardSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 明信片头部 */
.postcard-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1rem 0.75rem;
    border-bottom: 1px dashed rgba(212,175,55,0.3);
}

.postcard-icon-wrapper {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, #c41e3a, #a01729);
    border: 1.5px solid rgba(247,215,116,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(196,30,58,0.3);
}

.postcard-icon-wrapper i {
    font-size: 1.1rem;
    color: #f7d774;
}

.postcard-icon-active {
    background: linear-gradient(135deg, #d4af37, #8b6914);
    border-color: rgba(196,30,58,0.3);
    animation: iconGlow 2s ease-in-out infinite;
}

@keyframes iconGlow {
    0%, 100% { box-shadow: 0 2px 8px rgba(212,175,55,0.3); }
    50% { box-shadow: 0 4px 14px rgba(212,175,55,0.6), 0 0 0 3px rgba(212,175,55,0.15); }
}

.postcard-title-area {
    flex: 1;
    min-width: 0;
}

.postcard-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #c41e3a;
    font-family: 'Noto Serif SC', serif;
    margin: 0 0 2px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.postcard-subtitle {
    font-size: 0.8rem;
    color: #8b6914;
    font-weight: 500;
    margin: 0;
    line-height: 1.2;
}

/* 分割线 */
.postcard-divider {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    gap: 0.5rem;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212,175,55,0.4), transparent);
}

.divider-ornament {
    color: #d4af37;
    font-size: 0.7rem;
    animation: ornamentSpin 4s linear infinite;
}

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

/* 明信片正文 */
.postcard-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 1rem 0.75rem;
    scroll-behavior: smooth;
}

.postcard-body::-webkit-scrollbar { width: 4px; }
.postcard-body::-webkit-scrollbar-track { background: rgba(212,175,55,0.1); border-radius: 2px; }
.postcard-body::-webkit-scrollbar-thumb { background: rgba(196,30,58,0.3); border-radius: 2px; }

/* 提示内容 */
.postcard-hint-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem 1rem;
    gap: 0.75rem;
    animation: hintFloat 3s ease-in-out infinite;
}

@keyframes hintFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.hint-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(196,30,58,0.1), rgba(212,175,55,0.1));
    border: 1.5px solid rgba(212,175,55,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: hintPulse 2s ease-in-out infinite;
}

@keyframes hintPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.hint-icon i {
    font-size: 1.3rem;
    color: #c41e3a;
}

.postcard-hint-content p {
    font-size: 0.9rem;
    color: #8b6914;
    line-height: 1.8;
    margin: 0;
    font-family: 'Noto Serif SC', serif;
}

.hint-highlight {
    color: #c41e3a;
    font-weight: 700;
}

/* Markdown渲染正文（不做首字下沉，避免与昵称/称呼混淆；流式更新时不做淡入动画以免遮挡逐字效果） */
.postcard-prose {
    font-size: 1rem;
    line-height: 1.9;
    color: #3d2a22;
    font-family: 'Noto Serif SC', 'Noto Serif CJK SC', serif;
}

/* Markdown 标题：覆盖浏览器默认 h1–h6，避免与正文字号差过大 */
.postcard-prose h1,
.postcard-prose h2,
.postcard-prose h3,
.postcard-prose h4,
.postcard-prose h5,
.postcard-prose h6 {
    font-size: 1.12em;
    font-weight: 700;
    line-height: 1.45;
    color: #2d1810;
    margin: 0.65em 0 0.35em;
    text-indent: 0;
    font-family: inherit;
}

.postcard-prose h1:first-child,
.postcard-prose h2:first-child,
.postcard-prose h3:first-child,
.postcard-prose h4:first-child,
.postcard-prose h5:first-child,
.postcard-prose h6:first-child {
    margin-top: 0;
}

.postcard-prose p {
    margin: 0 0 0.8rem;
    text-indent: 2em;
    position: relative;
}

/* 用户昵称在正文中的统一强调（由 JS 包裹 span） */
.postcard-prose .postcard-nickname-highlight {
    color: #c41e3a;
    font-weight: 700;
}

.postcard-prose p:last-child {
    margin-bottom: 0;
}

/* 错误状态 */
.postcard-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 1rem;
    text-align: center;
}

.postcard-error i {
    font-size: 2rem;
    color: #c41e3a;
    opacity: 0.6;
}

.postcard-error p {
    font-size: 0.88rem;
    color: #8b6914;
    margin: 0;
    line-height: 1.6;
}

.postcard-error a {
    color: #c41e3a;
    text-decoration: underline;
    font-weight: 600;
}

/* 明信片底部 */
.postcard-footer {
    padding: 0.6rem 1rem 0.75rem;
    border-top: 1px dashed rgba(212,175,55,0.25);
}

.postcard-footer-decor {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.footer-tag {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.72rem;
    color: #8b6914;
    font-family: 'Noto Serif SC', serif;
}

.footer-tag i {
    font-size: 0.65rem;
    color: #c41e3a;
}

.footer-line {
    flex: 1;
    max-width: 40px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212,175,55,0.4), transparent);
}

/* 加载动画 */
.postcard-loading {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(145deg, rgba(255,253,248,0.95), rgba(255,250,238,0.95));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    z-index: 5;
    border-radius: 0 0 16px 16px;
}

.loading-quill {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c41e3a, #a01729);
    border: 2px solid #f7d774;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(196,30,58,0.3);
    animation: quillBounce 1.2s ease-in-out infinite;
}

.loading-quill i {
    font-size: 1.2rem;
    color: #f7d774;
    animation: quillWrite 1.2s ease-in-out infinite;
}

@keyframes quillBounce {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50% { transform: translateY(-6px) rotate(5deg); }
}

@keyframes quillWrite {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading-dots {
    display: flex;
    gap: 5px;
}

.loading-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #c41e3a;
    animation: dotBounce 1.2s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
    0%, 100% { transform: translateY(0); opacity: 0.4; }
    50% { transform: translateY(-5px); opacity: 1; }
}

.loading-text {
    font-size: 0.85rem;
    color: #8b6914;
    font-family: 'Noto Serif SC', serif;
    font-weight: 500;
    margin: 0;
}

.gami-festival-chat-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin: 0.5rem 1rem 0.75rem;
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
    color: #c41e3a;
    text-decoration: none;
    font-weight: 700;
    font-family: 'Noto Serif SC', serif;
    background: linear-gradient(135deg, rgba(196,30,58,0.08), rgba(212,175,55,0.08));
    border: 1.5px solid rgba(196,30,58,0.25);
    border-radius: 999px;
    transition: all 0.25s ease;
    text-align: center;
}

.gami-festival-chat-link:hover {
    background: linear-gradient(135deg, rgba(196,30,58,0.15), rgba(212,175,55,0.15));
    border-color: rgba(196,30,58,0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(196,30,58,0.15);
    text-decoration: none;
}

.gami-festival-chat-link i {
    font-size: 0.85rem;
}

@media (min-width: 769px) {
    .gami-festival-modal-layout {
        flex-direction: row;
        align-items: stretch;
        max-height: min(82vh, 720px);
    }

    .gami-festival-modal-body {
        flex: 1 1 56%;
        max-height: none;
    }

    .gami-festival-ai-aside {
        flex: 1 1 44%;
        max-width: 560px;
        max-height: none;
        border-top: none;
        border-left: 1px solid rgba(212, 175, 55, 0.22);
        min-height: 400px;
    }

    .gami-postcard-wrapper {
        flex: 1;
        min-height: 0;
    }

    .postcard-card {
        flex: 1;
        min-height: 0;
    }
}

.gami-festival-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 0.95rem;
    background: linear-gradient(135deg, #fff 0%, #fffdf9 100%);
    border: 1px solid rgba(212,175,55,0.22);
    border-radius: 14px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
    text-align: left;
    width: 100%;
    font: inherit;
    color: inherit;
    appearance: none;
    -webkit-appearance: none;
}

.gami-festival-row:hover {
    transform: translateX(3px);
    box-shadow: 0 6px 20px rgba(196, 30, 58, 0.08);
}

.gami-festival-row:focus-visible {
    outline: 2px solid #c41e3a;
    outline-offset: 2px;
}

.gami-festival-row.ai-selected {
    border-color: rgba(196, 30, 58, 0.45);
    box-shadow: 0 0 0 1px rgba(196, 30, 58, 0.12);
}

.gami-festival-row.highlight {
    border-color: #c41e3a;
    background: rgba(196, 30, 58, 0.04);
}

.gami-festival-row.past {
    opacity: 0.45;
}

.gami-festival-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
    flex-shrink: 0;
    overflow: hidden;
}

.gami-festival-icon .fas,
.gami-festival-icon .fa-solid {
    line-height: 1;
}

.gami-festival-body {
    flex: 1;
    min-width: 0;
}

.gami-festival-name {
    font-size: 1.12rem;
    font-weight: 700;
    color: #2d1810;
    margin-bottom: 0.15rem;
}

.gami-festival-meta {
    font-size: 0.95rem;
    color: #a0522d;
    margin-bottom: 0.15rem;
}

.gami-festival-desc {
    font-size: 0.95rem;
    color: #8b4513;
    line-height: 1.55;
}

.gami-festival-countdown-cell {
    flex-shrink: 0;
    text-align: right;
    min-width: 100px;
}

.gami-festival-today {
    font-size: 1rem;
    font-weight: 700;
    color: #c41e3a;
}

.gami-festival-tomorrow {
    font-size: 0.95rem;
    color: #d4af37;
}

.gami-festival-countdown {
    font-size: 0.95rem;
    color: #8b4513;
    white-space: nowrap;
}

.gami-festival-past {
    font-size: 0.9rem;
    color: #aaa;
}

@media (max-width: 768px) {
    .gami-festival-modal {
        max-height: 92vh;
    }

    .gami-festival-ai-aside {
        max-height: 45vh;
        min-height: 250px;
    }

    .postcard-stamp-ribbon {
        top: 6px;
        left: 8px;
        right: 8px;
    }

    .ribbon-role {
        font-size: 0.72rem;
    }

    .ribbon-name {
        font-size: 1rem;
    }

    .stamp-circle {
        width: 44px;
        height: 44px;
    }

    .postcard-header {
        padding: 0.75rem 0.75rem 0.5rem;
        gap: 0.5rem;
    }

    .postcard-icon-wrapper {
        width: 36px;
        height: 36px;
    }

    .postcard-title {
        font-size: 0.95rem;
    }

    .postcard-body {
        padding: 0.5rem 0.75rem 0.5rem;
    }

    .postcard-prose {
        font-size: 0.88rem;
    }
}

/* ==================== 任务面板弹窗 ==================== */

.gami-quest-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10050;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.gami-quest-panel {
    background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(250,248,244,0.98));
    border-radius: 20px;
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    writing-mode: horizontal-tb;
}

.gami-quest-panel-header {
    padding: 1.25rem;
    color: white;
    position: relative;
}

.gami-quest-panel-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 0.3rem 0;
}

.gami-quest-panel-header p {
    font-size: 0.8rem;
    opacity: 0.9;
    margin: 0;
}

.gami-panel-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 30px;
    height: 30px;
    border: none;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.gami-panel-close:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.gami-quest-panel-body {
    padding: 1rem;
    max-height: 55vh;
    overflow-y: auto;
}

.gami-quest-divider {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.75rem 0;
    font-size: 0.75rem;
    color: #8b4513;
}

.gami-quest-divider::before,
.gami-quest-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212,175,55,0.3), transparent);
}

.gami-quest-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.7rem;
    padding: 0.9rem;
    background: rgba(255,255,255,0.8);
    border: 1px solid rgba(212,175,55,0.2);
    border-radius: 10px;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    writing-mode: horizontal-tb;
}

.gami-quest-item:hover {
    background: rgba(255,255,255,1);
    border-color: rgba(196,30,58,0.2);
}

.gami-quest-item.completed {
    opacity: 0.5;
}

.gami-quest-checkbox {
    font-size: 1.1rem;
    color: rgba(196,30,58,0.4);
    flex-shrink: 0;
    line-height: 1;
}

.gami-quest-item.completed .gami-quest-checkbox {
    color: #10b981;
}

.gami-quest-info {
    flex: 1 1 auto;
    min-width: 0;
    writing-mode: horizontal-tb;
}

.gami-quest-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #2d1810;
    margin-bottom: 0.15rem;
    line-height: 1.45;
    word-break: normal;
    overflow-wrap: break-word;
}

.gami-quest-dest {
    font-size: 0.62rem;
    color: #6d5c4a;
    line-height: 1.4;
    margin-bottom: 0.2rem;
}

.gami-quest-reward {
    font-size: 0.65rem;
    color: #a0522d;
}

.gami-quest-complete {
    font-size: 0.65rem;
    color: #10b981;
    flex-shrink: 0;
    white-space: nowrap;
}

.gami-quest-item.gami-quest-boss {
    background: linear-gradient(135deg, rgba(212,175,55,0.08), rgba(196,30,58,0.04));
    border-color: rgba(212,175,55,0.3);
}

.gami-btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

.gami-btn-warning {
    background: linear-gradient(135deg, #d4af37, #c4941f);
    color: white;
}

/* ==================== 消息通知 Toast ==================== */

/* 使用 ID 提高优先级；勿参与正文 flex 排版，避免岭南说书等页挤压主区域 */
#gami-toast-container {
    position: fixed !important;
    left: 50% !important;
    right: auto !important;
    top: calc(72px + env(safe-area-inset-top, 0px)) !important;
    bottom: auto !important;
    transform: translateX(-50%) !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 2147483000 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 0.45rem !important;
    pointer-events: none !important;
    max-width: min(440px, calc(100vw - 1.5rem)) !important;
    width: auto !important;
    box-sizing: border-box !important;
    contain: layout paint;
}

.gami-toast {
    background: white;
    border-radius: 14px;
    padding: 1rem 1.2rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 0.9rem;
    width: 100%;
    min-width: 0;
    max-width: 440px;
    box-sizing: border-box;
    pointer-events: auto;
    animation: gamiToastIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    border-left: 4px solid;
}

.gami-toast.task-complete {
    border-left-color: #10b981;
    background: #ecfdf5;
}

.gami-toast.achievement-unlock {
    border-left-color: #d4af37;
    background: #fffbeb;
}

.gami-toast.chapter-unlock {
    border-left-color: #c41e3a;
    background: #fff1f2;
}

.gami-toast.exit {
    animation: gamiToastOut 0.3s ease forwards;
}

@keyframes gamiToastIn {
    from {
        opacity: 0;
        transform: translateY(-14px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes gamiToastOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-10px) scale(0.96);
    }
}

.gami-toast-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    overflow: hidden;
}

.gami-toast.task-complete .gami-toast-icon {
    background: #a7f3d0;
    color: #047857;
}

.gami-toast.achievement-unlock .gami-toast-icon {
    background: #fde68a;
    color: #b45309;
}

.gami-toast.chapter-unlock .gami-toast-icon {
    background: #fecdd3;
    color: #be123c;
}

.gami-toast-content {
    flex: 1;
    min-width: 0;
}

.gami-toast-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #2d1810;
    margin-bottom: 0.2rem;
}

.gami-toast-message {
    font-size: 0.75rem;
    color: #8b4513;
    line-height: 1.4;
}

.gami-toast-points {
    font-size: 0.9rem;
    font-weight: 700;
    color: #d4af37;
    white-space: nowrap;
}

/* ==================== 题目弹窗 ==================== */

.gami-question-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10060;
    padding: 1rem;
    backdrop-filter: blur(6px);
}

.gami-question-modal {
    background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(250,248,244,0.98));
    border-radius: 20px;
    width: 100%;
    max-width: 380px;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0,0,0,0.3);
}

.gami-question-header {
    padding: 0.875rem 1rem;
    background: linear-gradient(135deg, #c41e3a, #d4af37);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gami-question-header.boss {
    background: linear-gradient(135deg, #d4af37, #8b4513);
}

.gami-question-progress {
    font-size: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.boss-badge {
    background: rgba(255,255,255,0.2);
    padding: 0.15rem 0.4rem;
    border-radius: 8px;
    font-size: 0.325rem;
}

.gami-question-body {
    padding: 1.25rem;
}

.gami-question-text {
    font-size: 0.5rem;
    font-weight: 600;
    color: #2d1810;
    margin-bottom: 1rem;
    text-align: center;
    line-height: 1.5;
}

.gami-question-options {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.gami-option-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem;
    background: rgba(255,255,255,0.8);
    border: 2px solid rgba(212,175,55,0.25);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gami-option-item:hover {
    background: rgba(196,30,58,0.05);
    border-color: rgba(196,30,58,0.3);
    transform: translateX(3px);
}

.gami-option-item.correct {
    background: rgba(16,185,129,0.1);
    border-color: #10b981;
}

.gami-option-item.wrong {
    background: rgba(239,68,68,0.1);
    border-color: #ef4444;
}

.gami-option-letter {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(196,30,58,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.375rem;
    font-weight: 700;
    color: #c41e3a;
    flex-shrink: 0;
}

.gami-option-text {
    font-size: 0.425rem;
    color: #2d1810;
}

.gami-result-header {
    padding: 1.5rem;
    text-align: center;
    color: white;
}

.gami-result-header.success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.gami-result-header.partial {
    background: linear-gradient(135deg, #d4af37, #c4941f);
}

.gami-result-header.fail {
    background: linear-gradient(135deg, #c41e3a, #9b1b2e);
}

.gami-result-icon {
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
}

.gami-result-header h2 {
    font-size: 0.55rem;
    font-weight: 700;
    margin: 0 0 0.4rem 0;
}

.gami-result-points {
    font-size: 0.65rem;
    font-weight: 700;
}

/* ==================== 任务横幅样式（体验模式） ==================== */

/* 侧栏「收集」底部槽位 */
.gami-task-banner-slot {
    margin-top: 0.65rem;
    flex-shrink: 0;
    width: 100%;
}

#gami-task-banner:not(.gami-task-banner-embedded) {
    position: fixed;
    top: 75px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10045;
    width: 90%;
    max-width: 700px;
    animation: bannerSlideDown 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

#gami-task-banner.gami-task-banner-embedded {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    width: 100%;
    max-width: none;
    z-index: 1;
    animation: gamiTaskBannerInSidebar 0.35s ease forwards;
}

@keyframes gamiTaskBannerInSidebar {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bannerSlideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.gami-task-banner-inner {
    background: linear-gradient(135deg, rgba(196, 30, 58, 0.95), rgba(212, 175, 55, 0.95));
    border-radius: 18px;
    padding: 1rem 1.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    box-shadow: 0 8px 32px rgba(196, 30, 58, 0.35);
    color: white;
    text-align: center;
}

#gami-task-banner.gami-task-banner-embedded .gami-task-banner-inner {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-start;
    text-align: left;
    padding: 0.75rem 0.85rem;
    gap: 0.55rem;
    border-radius: 14px;
    box-shadow: 0 4px 18px rgba(196, 30, 58, 0.22);
}

#gami-task-banner.gami-task-banner-embedded .gami-task-banner-content {
    text-align: left;
    flex: 1 1 140px;
    min-width: 0;
}

#gami-task-banner.gami-task-banner-embedded .gami-task-banner-icon {
    width: 42px;
    height: 42px;
    font-size: 1.05rem;
}

#gami-task-banner.gami-task-banner-embedded .gami-task-banner-actions {
    justify-content: flex-end;
    width: 100%;
    margin-left: 0;
}

.gami-task-banner-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    overflow: hidden;
}

.gami-task-banner-content {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    text-align: center;
}

.gami-task-banner-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
}

.gami-task-banner-title {
    font-size: 0.7rem;
    opacity: 0.9;
    margin-bottom: 0.15rem;
}

.gami-task-banner-task {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.gami-task-banner-hint {
    font-size: 0.65rem;
    opacity: 0.85;
}

.gami-task-banner-complete {
    padding: 0.6rem 1.2rem;
    background: white;
    color: #c41e3a;
    border: none;
    border-radius: 22px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: "Noto Serif SC", serif;
    white-space: nowrap;
    flex-shrink: 0;
}

.gami-task-banner-complete:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.gami-task-banner-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.gami-task-banner-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* ==================== 聊天页面任务提示样式 ==================== */

#chat-quest-prompt {
    margin: 1rem auto;
    max-width: 600px;
    animation: promptSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes promptSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.quest-prompt-content {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(212, 175, 55, 0.1));
    border: 2px solid rgba(16, 185, 129, 0.3);
    border-radius: 14px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.quest-prompt-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.quest-prompt-text {
    flex: 1;
    min-width: 0;
}

.quest-prompt-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #10b981;
    margin-bottom: 0.2rem;
}

.quest-prompt-desc {
    font-size: 0.75rem;
    color: #2d1810;
    line-height: 1.45;
}

.quest-prompt-btn {
    padding: 0.6rem 1.2rem;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    border-radius: 22px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: "Noto Serif SC", serif;
    white-space: nowrap;
    flex-shrink: 0;
}

.quest-prompt-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* ==================== 任务进行中状态样式 ==================== */

.gami-quest-item.active {
    background: rgba(212, 175, 55, 0.1);
    border-color: rgba(212, 175, 55, 0.4);
}

.gami-quest-item.active .gami-quest-checkbox {
    color: #b8860b;
}

.gami-quest-hint {
    font-size: 0.65rem;
    color: #d4af37;
    margin-top: 0.25rem;
}

/* ==================== 碎片 · 中央文化体验层（智能体 + 轻量 3D） ==================== */

.gami-fragment-xp-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    background: rgba(18, 10, 6, 0.52);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: gamiFragmentXpIn 0.35s ease;
}

@keyframes gamiFragmentXpIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.gami-fragment-xp-modal {
    position: relative;
    width: 100%;
    max-width: min(440px, 96vw);
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.99) 0%, rgba(252, 248, 242, 0.98) 100%);
    border-radius: 22px;
    padding: 1.45rem 1.25rem 1.5rem;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(212, 175, 55, 0.2) inset;
    border: 1px solid rgba(212, 175, 55, 0.28);
    text-align: center;
}

.gami-fragment-xp-close {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
}

.gami-fragment-xp-stage {
    perspective: 960px;
    margin: 0.35rem auto 1rem;
    max-width: 240px;
}

.gami-fragment-xp-orb {
    position: relative;
    transform-style: preserve-3d;
    animation: gamiFragmentXpOrb 5.2s ease-in-out infinite;
}

@keyframes gamiFragmentXpOrb {
    0%, 100% { transform: translateY(0) rotateY(-10deg) rotateX(5deg); }
    50% { transform: translateY(-12px) rotateY(12deg) rotateX(-4deg); }
}

.gami-fragment-xp-icon {
    width: 118px;
    height: 118px;
    margin: 0 auto;
    border-radius: 22px;
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.98), rgba(255, 250, 245, 0.92));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.35rem;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.14);
    overflow: hidden;
}

.gami-fragment-xp-title {
    font-size: 1.12rem;
    color: #2d1810;
    margin: 0 0 0.45rem;
    font-weight: 700;
    font-family: "Noto Serif SC", "Noto Serif CJK SC", serif;
}

.gami-fragment-xp-meta {
    font-size: 0.84rem;
    color: #8b4513;
    margin: 0 0 0.65rem;
}

.gami-fragment-xp-blurb {
    font-size: 0.88rem;
    color: #4a3428;
    line-height: 1.65;
    margin: 0 0 1.15rem;
    text-align: left;
}

.gami-fragment-xp-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.gami-fragment-xp-actions .gami-fragment-xp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    box-sizing: border-box;
    text-decoration: none;
}

.gami-fragment-xp-btn-secondary {
    background: rgba(196, 30, 58, 0.07) !important;
    color: #9f1428 !important;
    border: 1px solid rgba(196, 30, 58, 0.28) !important;
    box-shadow: none !important;
}

/* ==================== 响应式 ==================== */

@media (max-width: 768px) {
    #gami-task-banner:not(.gami-task-banner-embedded) {
        top: 70px;
        width: 95%;
    }

    #gami-task-banner:not(.gami-task-banner-embedded) .gami-task-banner-inner {
        padding: 0.85rem 1rem;
    }

    #gami-task-banner.gami-task-banner-embedded .gami-task-banner-inner {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    #gami-task-banner.gami-task-banner-embedded .gami-task-banner-content {
        text-align: center;
    }

    #gami-task-banner.gami-task-banner-embedded .gami-task-banner-actions {
        justify-content: center;
    }

    .gami-task-banner-complete {
        min-width: 140px;
    }

    #chat-quest-prompt {
        margin: 0.75rem;
        max-width: none;
    }
}

/* ==================== 非遗卡包（與知識碎片 / 成就區淺色一致） ==================== */

.gami-heritage-card {
    background: #fff;
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 14px;
    padding: 0.875rem;
    margin-bottom: 0.75rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.gami-heritage-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 100% 70% at 50% 0%, rgba(253, 245, 230, 0.9) 0%, transparent 58%);
    pointer-events: none;
}

.gami-heritage-card > * {
    position: relative;
    z-index: 1;
}

.gami-heritage-count {
    margin-left: auto;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #a0522d;
    background: rgba(196, 30, 58, 0.08);
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
}

.gami-heritage-count.gami-heritage-count--complete {
    color: #92400e;
    background: rgba(212, 175, 55, 0.2);
}

.gami-heritage-points-bar {
    margin-top: 0.5rem;
}

.gami-heritage-pts-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.68rem;
    color: #6b5344;
    margin-bottom: 4px;
    letter-spacing: 0.04em;
}

.gami-heritage-pts-value {
    color: #b45309;
    font-weight: 700;
}

.gami-heritage-pts-bar {
    height: 5px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid rgba(212, 175, 55, 0.12);
}

.gami-heritage-pts-fill {
    height: 100%;
    background: linear-gradient(90deg, #c41e3a, #ca8a04, #eab308);
    border-radius: 999px;
    transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.35);
}

.gami-heritage-complete-hint {
    margin-top: 6px;
    font-size: 0.68rem;
    color: #9f1428;
    text-align: center;
    letter-spacing: 0.04em;
    animation: gami-hint-pulse 2s ease-in-out infinite;
}
@keyframes gami-hint-pulse {
    0%, 100% { opacity: 0.7; }
    50%       { opacity: 1; }
}

/* 卡牌网格 */
.gami-heritage-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-top: 0.75rem;
}

/* 单张卡 */
.hcard-item {
    border-radius: 10px;
    padding: 10px 6px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    cursor: default;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
}

/* 已收录 */
.hcard-item.owned {
    background: linear-gradient(165deg, rgba(255, 253, 248, 0.98) 0%, rgba(254, 243, 230, 0.95) 100%);
    border: 1px solid rgba(212, 175, 55, 0.35);
    box-shadow:
        0 2px 8px rgba(196, 30, 58, 0.06),
        0 1px 0 rgba(255, 255, 255, 0.95) inset;
}
.hcard-item.owned:hover {
    transform: translateY(-2px);
    box-shadow:
        0 4px 14px rgba(212, 175, 55, 0.18),
        0 1px 0 rgba(255, 255, 255, 1) inset;
    border-color: rgba(196, 30, 58, 0.22);
}

/* 未收录 */
.hcard-item.locked {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(212, 175, 55, 0.12);
    filter: grayscale(0.55);
    opacity: 0.72;
}

.hcard-icon {
    font-size: 1.8rem;
    line-height: 1;
}

.hcard-name {
    font-size: 0.68rem;
    font-weight: 700;
    color: #3d2a1f;
    letter-spacing: 0.06em;
}

.hcard-item.locked .hcard-name {
    color: #78716c;
}

.hcard-tags {
    display: flex;
    flex-direction: column;
    gap: 1px;
    align-items: center;
}

.hcard-tags span {
    font-size: 0.55rem;
    color: #8b7355;
    letter-spacing: 0.03em;
    line-height: 1.3;
}

.hcard-item.locked .hcard-tags span {
    color: #a8a29e;
}

.hcard-badge-owned {
    font-size: 0.55rem;
    font-weight: 800;
    color: #92400e;
    letter-spacing: 0.06em;
    background: rgba(212, 175, 55, 0.22);
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 999px;
    padding: 1px 6px;
    margin-top: 2px;
}

.hcard-badge-lock {
    font-size: 0.55rem;
    font-weight: 700;
    color: #a8a29e;
    letter-spacing: 0.04em;
    margin-top: 2px;
}

/* ==================== 智能导览（概览 Tab 内对话） ==================== */

.gami-guide-card {
    margin-top: 0.85rem;
    padding: 0.85rem 0.8rem 0.8rem;
    border-radius: 16px;
    background:
      linear-gradient(160deg, rgba(255,252,248,0.99) 0%, rgba(252,246,240,0.98) 60%, rgba(250,243,235,0.99) 100%);
    border: 1.5px solid rgba(212,175,55,0.5);
    box-shadow:
        0 4px 20px rgba(196,30,58,0.1),
        0 2px 8px rgba(120,60,10,0.06),
        inset 0 1px 0 rgba(255,255,255,0.95),
        inset 0 -1px 0 rgba(212,175,55,0.1);
    position: relative;
    overflow: hidden;
}

/* 卡片顶部朱红金线装饰 */
.gami-guide-card::before {
    content: '';
    position: absolute;
    top: 0; left: 6%; right: 6%;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(196,30,58,0.5) 20%, rgba(212,175,55,0.9) 50%, rgba(196,30,58,0.5) 80%, transparent);
    border-radius: 0 0 3px 3px;
}

.gami-guide-head {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}

.gami-guide-head-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #c41e3a 0%, #8b1528 100%);
    box-shadow: 0 4px 12px rgba(196,30,58,0.35), inset 0 1px 0 rgba(255,255,255,0.2);
    border: 2px solid rgba(212,175,55,0.6);
}

.gami-guide-head-text h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    color: #9f1428;
    letter-spacing: 0.06em;
    font-family: "Noto Serif SC", serif;
    text-shadow: 0 1px 2px rgba(200,50,50,0.1);
}

.gami-guide-head-text p {
    margin: 3px 0 0;
    font-size: 0.72rem;
    color: #78716c;
    letter-spacing: 0.04em;
    line-height: 1.35;
}

.gami-guide-interests {
    margin-bottom: 0.55rem;
}

.gami-guide-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    color: #92400e;
    letter-spacing: 0.08em;
    margin-bottom: 5px;
    font-family: "Noto Serif SC", serif;
}

/* ========== 兴趣标签芯片（金色系 — 温和引导） ========== */
.gami-guide-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.gami-guide-chip {
    border: 1.5px solid rgba(212,175,55,0.5);
    background: linear-gradient(160deg, #fffdf8 0%, #fdf8e8 100%);
    color: #7a5c10;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 999px;
    cursor: pointer;
    letter-spacing: 0.04em;
    transition: all 0.25s cubic-bezier(0.34, 1.3, 0.64, 1);
    box-shadow: 0 2px 6px rgba(160,120,20,0.08), inset 0 1px 0 rgba(255,255,255,0.9);
    font-family: "Noto Serif SC", serif;
}

.gami-guide-chip:hover {
    border-color: rgba(212,175,55,0.9);
    background: linear-gradient(160deg, #fff9e0 0%, #ffe8a0 100%);
    color: #92400e;
    transform: translateY(-1px) scale(1.04);
    box-shadow: 0 4px 12px rgba(212,175,55,0.25), 0 1px 3px rgba(160,120,20,0.1);
}

.gami-guide-chip.selected {
    background: linear-gradient(135deg, rgba(212,175,55,0.25) 0%, rgba(200,150,40,0.35) 100%);
    border-color: rgba(180,130,30,0.7);
    color: #92400e;
    font-weight: 800;
    box-shadow: 0 3px 10px rgba(212,175,55,0.3), inset 0 1px 0 rgba(255,255,255,0.8);
}

.gami-guide-msgs {
    max-height: 200px;
    overflow-y: auto;
    padding: 8px 6px;
    margin-bottom: 8px;
    border-radius: 12px;
    background:
      linear-gradient(160deg, rgba(255,252,248,0.92) 0%, rgba(252,250,246,0.92) 100%);
    border: 1.5px solid rgba(212,175,55,0.3);
    box-shadow: inset 0 1px 3px rgba(120,60,10,0.04);
}

/* 滚动条 */
.gami-guide-msgs::-webkit-scrollbar { width: 4px; }
.gami-guide-msgs::-webkit-scrollbar-track { background: transparent; }
.gami-guide-msgs::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(212,175,55,0.5), rgba(196,30,58,0.4));
    border-radius: 2px;
}

.gami-guide-msg {
    font-size: 0.82rem;
    line-height: 1.6;
    margin-bottom: 8px;
    padding: 9px 12px;
    border-radius: 12px;
    word-break: break-word;
    font-family: "Noto Serif SC", serif;
    animation: gamiMsgIn 0.3s cubic-bezier(0.34, 1.3, 0.64, 1);
}

@keyframes gamiMsgIn {
    from { opacity: 0; transform: translateY(8px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.gami-guide-msg-user {
    margin-left: 1.2rem;
    background: linear-gradient(135deg, #c41e3a 0%, #a01830 100%);
    color: white;
    border: 1.5px solid rgba(212,175,55,0.35);
    box-shadow: 0 3px 10px rgba(196,30,58,0.2), inset 0 1px 0 rgba(255,255,255,0.15);
    position: relative;
}

/* 用户气泡右上角高光 */
.gami-guide-msg-user::before {
    content: '';
    position: absolute;
    top: 8px; right: 10px;
    width: 30px; height: 8px;
    background: radial-gradient(ellipse, rgba(255,255,255,0.3) 0%, transparent 70%);
    border-radius: 50%;
}

.gami-guide-msg-assistant {
    margin-right: 0.5rem;
    background: linear-gradient(160deg, rgba(255,255,255,0.98) 0%, rgba(252,250,246,0.98) 100%);
    border: 1.5px solid rgba(212,175,55,0.4);
    color: #3d2a1f;
    box-shadow: 0 3px 10px rgba(120,60,10,0.08), inset 0 1px 0 rgba(255,255,255,0.9);
    position: relative;
}

/* AI气泡左上角金色三角装饰 */
.gami-guide-msg-assistant::before {
    content: '';
    position: absolute;
    top: -1px; left: -1px;
    width: 16px; height: 16px;
    background: radial-gradient(circle at 0% 0%, rgba(212,175,55,0.6) 0%, transparent 70%);
    border-radius: 2px 0 0 0;
}

.gami-guide-typing {
    color: #a8a29e;
    font-style: italic;
    font-size: 0.8rem;
}

.gami-guide-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
    min-height: 0;
}

/* ========== 跳转链接按钮（朱红系 — 行动引导） ========== */
.gami-guide-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 15px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: white;
    text-decoration: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #c41e3a 0%, #a01830 50%, #8b1528 100%);
    border: 1.5px solid rgba(212,175,55,0.4);
    box-shadow: 0 3px 10px rgba(196,30,58,0.3), inset 0 1px 0 rgba(255,255,255,0.2);
    transition: all 0.25s cubic-bezier(0.34, 1.3, 0.64, 1);
    font-family: "Noto Serif SC", serif;
}

.gami-guide-link-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 8px 20px rgba(196,30,58,0.4), inset 0 1px 0 rgba(255,255,255,0.25);
    background: linear-gradient(135deg, #d4223e 0%, #b01a35 50%, #9a182e 100%);
}

.gami-guide-input-row {
    display: flex;
    gap: 6px;
    align-items: stretch;
}

.gami-guide-input-row input {
    flex: 1;
    min-width: 0;
    border: 1.5px solid rgba(212,175,55,0.4);
    border-radius: 999px;
    padding: 9px 14px;
    font-size: 0.82rem;
    font-family: "Noto Serif SC", serif;
    background: linear-gradient(160deg, rgba(255,255,255,0.98) 0%, rgba(252,250,246,0.98) 100%);
    color: #292524;
    box-shadow: 0 2px 8px rgba(120,60,10,0.06), inset 0 1px 3px rgba(120,60,10,0.04), 0 1px 0 rgba(255,255,255,0.9);
    transition: all 0.25s ease;
}

.gami-guide-input-row input::placeholder {
    color: #a8a29e;
    font-style: italic;
}

.gami-guide-input-row input:focus {
    outline: none;
    border-color: rgba(196,30,58,0.5);
    box-shadow: 0 2px 8px rgba(120,60,10,0.06), 0 0 0 3px rgba(196,30,58,0.08), inset 0 1px 0 rgba(255,255,255,0.9);
}

/* ========== 发送按钮（橙色系 — 明确发送动作） ========== */
.gami-guide-send {
    flex-shrink: 0;
    padding: 9px 15px !important;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem !important;
    border-radius: 999px !important;
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%) !important;
    border: 1.5px solid rgba(255,200,100,0.5) !important;
    box-shadow: 0 3px 10px rgba(211,84,0,0.35), inset 0 1px 0 rgba(255,255,255,0.25) !important;
    transition: all 0.25s cubic-bezier(0.34, 1.3, 0.64, 1);
    font-family: "Noto Serif SC", serif !important;
    color: white !important;
    letter-spacing: 0.04em;
    font-weight: 700;
}

.gami-guide-send:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 16px rgba(211,84,0,0.45), inset 0 1px 0 rgba(255,255,255,0.3) !important;
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%) !important;
    filter: brightness(1.08);
}

.gami-guide-send:active {
    transform: translateY(0) scale(0.97);
}

/* ========== 快捷按钮（蓝绿系 — 建议引导，与主按钮区分） ========== */
.gami-guide-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.gami-guide-quick-btn {
    border: 1.5px solid rgba(30,120,100,0.35);
    background: linear-gradient(160deg, rgba(240,253,250,0.95) 0%, rgba(220,245,238,0.95) 100%);
    color: #1a6b4a;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 5px 11px;
    border-radius: 999px;
    cursor: pointer;
    letter-spacing: 0.03em;
    transition: all 0.25s cubic-bezier(0.34, 1.3, 0.64, 1);
    font-family: "Noto Serif SC", serif;
    box-shadow: 0 2px 6px rgba(30,120,100,0.08), inset 0 1px 0 rgba(255,255,255,0.9);
}

.gami-guide-quick-btn:hover {
    background: linear-gradient(135deg, #1a6b4a 0%, #145c3a 100%);
    color: white;
    border-color: rgba(45,158,107,0.5);
    transform: translateY(-1px) scale(1.04);
    box-shadow: 0 4px 12px rgba(30,120,100,0.3), inset 0 1px 0 rgba(255,255,255,0.15);
}

