/* === 全局样式 === */
:root {
    --color-primary: #1a6fe8;
    --color-primary-dark: #0d4fc4;
    --color-primary-light: #e8f0fd;
    --color-secondary: #10b981;
    --color-tertiary: #f59e0b;
    --color-bg: #f5f7fa;
    --color-card: #ffffff;
    --color-text: #1a1a2e;
    --color-text-light: #6b7280;
    --color-border: #e4e8ef;
    --color-accent: #ef4444;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
    --shadow-hover: 0 6px 24px rgba(26, 111, 232, 0.13);
    --radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    height: 100vh;
    height: 100dvh;
    height: -webkit-fill-available;
    overflow: hidden;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

html {
    height: 100vh;
    height: -webkit-fill-available;
    overflow: hidden;
}

/* === 应用容器 === */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 860px;
    margin: 0 auto;
    background: var(--color-card);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.08);
}

/* === 顶部标题栏 — 科技边框背景图 === */
.app-header {
    flex-shrink: 0;
    z-index: 100;
    background: #0a0a12;
    color: white;
    padding: 0.8rem 1.5rem;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border-style: solid;
    border-width: 45px 70px 45px 70px;
    border-image-source: url('../img/header-border.png');
    border-image-slice: 90 130 90 130 fill;
    border-image-repeat: stretch;
}

.app-title {
    position: relative;
    margin-bottom: 0.3rem;
    transform: skewX(-8deg);
    animation: glitchTitle 4s infinite;
    overflow: visible;
}

.title-img {
    height: 50px;
    width: auto;
    display: block;
    filter: drop-shadow(0 0 8px rgba(255, 100, 220, 0.8)) drop-shadow(0 0 20px rgba(100, 180, 255, 0.6));
}

.app-title::before {
    content: '';
    position: absolute;
    top: 45%;
    left: -10%;
    right: -10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #00e5ff 20%, #ff44aa 50%, #00e5ff 80%, transparent);
    opacity: 0.7;
}

.app-title::after {
    content: '';
    position: absolute;
    top: 60%;
    left: -15%;
    right: -5%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #ff44aa 30%, #44ddff 70%, transparent);
    opacity: 0.5;
}

@keyframes glitchTitle {
    0%, 82%, 100% { transform: skewX(-8deg); }
    83% { transform: skewX(-8deg) translate(2px, -1px); }
    84% { transform: skewX(-8deg) translate(-2px, 1px); }
    85% { transform: skewX(-8deg) translate(1px, 0); }
    86% { transform: skewX(-8deg) translate(-1px, -1px); }
    87% { transform: skewX(-8deg) translate(1px, 0); }
    88% { transform: skewX(-8deg) translate(0); }
}

.app-subtitle {
    font-size: 0.85rem;
    color: #22ccff;
    letter-spacing: 3px;
    font-family: 'Courier New', monospace;
    font-style: italic;
    position: relative;
    background: linear-gradient(90deg, #00d4ff, #aa55ff, #8866ff, #00d4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 0 5px rgba(0, 200, 255, 0.5)) drop-shadow(0 0 10px rgba(170, 80, 255, 0.4));
    transform: skewX(-3deg);
    border-left: 2px solid #00b4ff;
    border-right: 2px solid #aa55ff;
    padding: 0 8px;
}

.app-disclaimer {
    font-size: 0.65rem;
    margin-top: 0.3rem;
    font-style: normal;
    color: transparent;
    position: relative;
    letter-spacing: 1px;
    font-family: 'Courier New', monospace;
    -webkit-text-stroke: 0.5px rgba(255, 255, 255, 0.85);
    text-shadow: none;
}

/* === 内联排盘（对话气泡中） === */
.inline-paipan {
    margin: 0.3rem 0;
}

.inline-paipan .paipan-header {
    margin-bottom: 0.5rem;
}

.inline-paipan .paipan-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-primary-dark);
    margin-bottom: 0.2rem;
}

.inline-paipan .paipan-time {
    font-size: 0.82rem;
    color: #555;
}

.inline-paipan .paipan-info {
    font-size: 0.78rem;
    color: #777;
    margin-top: 1px;
}

/* === 九宫格 === */
.jiugong-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    width: 100%;
    background: var(--color-primary);
    padding: 2px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--color-primary-dark);
}

.gong {
    background: var(--color-card);
    padding: 0.5rem 0.6rem;
    min-height: 110px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.gong-header {
    text-align: center;
    font-weight: bold;
    font-size: 0.72rem;
    margin-bottom: 0.3rem;
    padding-bottom: 0.2rem;
    border-bottom: 1px solid var(--color-border);
}

/* 宫位名称颜色 - 按五行属性 */
.gong[data-gong="1"] .gong-header { color: #1565c0; }
.gong[data-gong="2"] .gong-header { color: #a07000; }
.gong[data-gong="3"] .gong-header { color: #2e7d32; }
.gong[data-gong="4"] .gong-header { color: #2e7d32; }
.gong[data-gong="5"] .gong-header { color: #a07000; }
.gong[data-gong="6"] .gong-header { color: #e6b422; }
.gong[data-gong="7"] .gong-header { color: #e6b422; }
.gong[data-gong="8"] .gong-header { color: #a07000; }
.gong[data-gong="9"] .gong-header { color: #c41e3a; }

.gong-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 0.8rem;
}

.gong-row {
    display: flex;
    align-items: center;
}

.gong-shen-row {
    justify-content: space-between;
    margin-bottom: 0.2rem;
}

.yingan-val {
    font-size: 0.82rem;
    font-weight: 600;
    color: #999;
    min-width: 1em;
}

.shen-name {
    font-size: 0.76rem;
    color: #333;
}

.zhifu-mark {
    color: var(--color-primary);
    font-size: 0.78rem;
    font-weight: bold;
}

.ma-mark {
    font-size: 0.65rem;
    color: #999;
}

.gong-tianpan-row {
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.15rem;
}

.xing-name {
    font-size: 0.82rem;
    color: #333;
}

.tiangan-val {
    font-size: 1.15rem;
    font-weight: bold;
}

.gong-dipan-row {
    justify-content: space-between;
    align-items: baseline;
    margin-top: auto;
}

.men-name {
    font-size: 0.82rem;
    color: #333;
}

.dipan-val {
    font-size: 1.15rem;
    font-weight: bold;
}

.gong-center-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 0.3rem;
}

.gong-center-gan {
    font-size: 1.3rem;
    font-weight: bold;
}

/* 用神高亮 */
.yongshen-highlight {
    outline: 2px solid var(--color-accent);
    outline-offset: -2px;
    background: #fff5f5 !important;
}

/* === 对话区域 === */
.chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    scroll-behavior: smooth;
}

/* 消息气泡 */
.chat-msg {
    display: flex;
    gap: 0.6rem;
    max-width: 88%;
    animation: msgFadeIn 0.3s ease;
}

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

.chat-msg.system {
    align-self: flex-start;
}

/* 排盘消息占满宽度 */
.chat-msg.system:has(.inline-paipan) {
    max-width: 96%;
}

.chat-msg.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.chat-msg.system .msg-avatar {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.chat-msg.user .msg-avatar {
    background: var(--color-primary);
    color: white;
}

.msg-bubble {
    padding: 0.7rem 1rem;
    border-radius: 12px;
    line-height: 1.6;
    font-size: 0.9rem;
    word-break: break-word;
}

/* 包含九宫格的气泡放宽 */
.msg-bubble:has(.inline-paipan) {
    max-width: 100%;
    padding: 0.8rem;
}

.chat-msg.system .msg-bubble {
    background: #f0f2f5;
    color: var(--color-text);
    border-bottom-left-radius: 4px;
}

.chat-msg.user .msg-bubble {
    background: var(--color-primary);
    color: white;
    border-bottom-right-radius: 4px;
}

/* 系统消息中的结构化内容 */
.msg-bubble .result-summary {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(0,0,0,0.08);
}

.msg-bubble .score-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
}

.score-badge.good { background: #dcfce7; color: #166534; }
.score-badge.neutral { background: #fef3c7; color: #92400e; }
.score-badge.bad { background: #fce4ec; color: #c62828; }

.msg-bubble .factor-line {
    font-size: 0.82rem;
    padding: 0.2rem 0;
    color: #555;
}

.msg-bubble .factor-line.ji { color: #2e7d32; }
.msg-bubble .factor-line.xiong { color: #c62828; }

.msg-bubble .advice-line {
    font-size: 0.82rem;
    color: #555;
    margin-top: 0.3rem;
    padding-top: 0.3rem;
    border-top: 1px dashed rgba(0,0,0,0.08);
}

/* 打字动画 */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 0.5rem 0;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #999;
    animation: typingBounce 1.2s infinite;
}

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

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-4px); }
}

/* === 输入区域 === */
.chat-input-area {
    flex-shrink: 0;
    border-top: 1px solid var(--color-border);
    background: var(--color-card);
    padding: 0.6rem 1rem 0.8rem;
}

.quick-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
    min-height: 0;
}

.quick-actions:empty {
    display: none;
    margin-bottom: 0;
}

/* === 滚动跑马灯模式 === */
.quick-actions.marquee-mode {
    flex-wrap: nowrap;
    overflow: hidden;
    mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
}

.marquee-track {
    display: flex;
    gap: 10px;
    animation: marqueeScroll 20s linear infinite;
    width: max-content;
}

.marquee-item {
    flex-shrink: 0;
    white-space: nowrap;
    animation: marqueePulse 1.6s ease-in-out infinite;
}

.marquee-item:nth-child(2n) {
    animation-delay: 0.3s;
}

.marquee-item:nth-child(3n) {
    animation-delay: 0.6s;
}

@keyframes marqueePulse {
    0%, 100% {
        box-shadow: 0 1px 5px rgba(26, 111, 232, 0.1);
    }
    50% {
        box-shadow: 0 3px 15px rgba(26, 111, 232, 0.38), 0 0 0 2.5px rgba(26, 111, 232, 0.09);
    }
}

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

.quick-btn {
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    background: white;
    color: var(--color-text);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.quick-btn:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.quick-btn.primary {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
    color: var(--color-primary);
}

/* 强引导模式：按钮更大更醒目 */
.quick-actions.highlight-mode {
    padding: 0.4rem 0;
    gap: 8px;
}

.quick-btn.highlight {
    padding: 0.5rem 1rem;
    font-size: 0.88rem;
    font-weight: 500;
    border: 1.5px solid var(--color-primary);
    color: var(--color-primary);
    background: var(--color-primary-light);
    box-shadow: 0 2px 8px rgba(26, 111, 232, 0.1);
}

.quick-btn.highlight:hover {
    background: var(--color-primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 111, 232, 0.2);
}

.quick-btn.highlight:active {
    transform: translateY(0);
}

.input-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 1.5px solid var(--color-border);
    border-radius: 20px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
    background: var(--color-bg);
}

.chat-input:focus {
    border-color: var(--color-primary);
    background: white;
}

.btn-send {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 20px;
    background: var(--color-primary);
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-send:hover {
    background: var(--color-primary-dark);
    transform: scale(1.02);
}

.btn-send:active {
    transform: scale(0.98);
}

/* === 响应式 === */
@media (max-width: 768px) {
    .app-container {
        max-width: 100%;
        box-shadow: none;
    }

    .gong {
        min-height: 90px;
        padding: 0.35rem;
    }

    .gong-content {
        font-size: 0.72rem;
    }

    .tiangan-val, .dipan-val {
        font-size: 0.95rem;
    }

    .gong-header {
        font-size: 0.65rem;
    }

    .chat-msg {
        max-width: 92%;
    }

    .msg-bubble {
        font-size: 0.85rem;
        padding: 0.6rem 0.8rem;
    }
}

@media (max-width: 400px) {
    .gong {
        min-height: 78px;
        padding: 0.25rem;
    }

    .xing-name, .men-name, .shen-name {
        font-size: 0.7rem;
    }

    .tiangan-val, .dipan-val {
        font-size: 0.85rem;
    }
}

/* === 分享按钮 === */
.share-btn-wrap {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.3rem 0.7rem;
    font-size: 0.78rem;
    color: #92600a;
    background: rgba(245, 208, 120, 0.35);
    border: 1px solid rgba(218, 165, 32, 0.3);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.share-btn:active {
    transform: scale(0.95);
    background: rgba(245, 208, 120, 0.55);
}

.share-btn.shared {
    color: #16a34a;
    background: rgba(187, 247, 208, 0.4);
    border-color: rgba(34, 197, 94, 0.3);
}

/* === Toast 提示 === */
.share-toast {
    position: fixed;
    top: 1.2rem;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
    color: #fff;
    background: rgba(30, 30, 30, 0.88);
    border-radius: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}

.share-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ========== 运势按钮固定栏 ========== */
.fortune-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 0.5rem;
    justify-content: center;
}

.fortune-bar-btn {
    flex: 1;
    max-width: 160px;
    padding: 0.55rem 0.8rem;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1.5px solid rgba(26, 111, 232, 0.5);
    border-radius: 10px;
    background: linear-gradient(135deg, #e8f0fd 0%, #f0f4ff 100%);
    color: #1a6fe8;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    position: relative;
}

.fortune-bar-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(26, 111, 232, 0.3);
}

.fortune-bar-btn:active {
    transform: translateY(0);
}

/* 蓝色阴影跳动动画 — 上方运势按钮：慢呼吸节奏 */
.fortune-pulse {
    animation: fortunePulse 2.4s ease-in-out infinite;
}

.fortune-pulse:nth-child(2) {
    animation-delay: 0.5s;
}

@keyframes fortunePulse {
    0%, 100% {
        box-shadow: 0 2px 6px rgba(26, 111, 232, 0.12);
    }
    50% {
        box-shadow: 0 3px 16px rgba(26, 111, 232, 0.4), 0 0 0 3px rgba(26, 111, 232, 0.1);
    }
}

/* ========== 赛博签文卡片 — Y2K Cyberpunk Style ========== */
.cyber-fortune-card {
    background-image: url('../img/card-border.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    border: none;
    border-radius: 0;
    padding: 3.5rem 2.5rem 7rem;
    color: #e0e0e0;
    position: relative;
    overflow: visible;
    width: 340px;
    box-shadow: none;
}

.cfc-header {
    text-align: center;
    margin-bottom: 1rem;
    position: relative;
}

.cfc-label {
    font-size: 0.7rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: rgba(138, 43, 226, 0.9);
    font-weight: 700;
    margin-bottom: 0.3rem;
    text-shadow: 0 0 6px rgba(138, 43, 226, 0.5);
}

.cfc-date {
    font-size: 0.72rem;
    color: rgba(180, 180, 200, 0.55);
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

.cfc-score-ring {
    text-align: center;
    margin: 0.5rem 0;
    padding: 0.5rem 0;
    position: relative;
}

.cfc-score-ring::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 1px solid rgba(138, 43, 226, 0.3);
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.15), inset 0 0 15px rgba(138, 43, 226, 0.1);
}

.cfc-score-ring::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 110px;
    height: 110px;
    border-radius: 50%;
    border: 1px dashed rgba(180, 180, 200, 0.15);
}

.cfc-score-num {
    font-size: 2.8rem;
    font-weight: 800;
    font-family: 'Courier New', monospace;
    line-height: 1;
    text-shadow: 0 0 20px currentColor, 0 0 40px currentColor, 0 0 60px currentColor;
    position: relative;
}

.cfc-score-label {
    font-size: 0.82rem;
    font-weight: 600;
    margin-top: 0.4rem;
    letter-spacing: 3px;
    text-shadow: 0 0 8px currentColor;
}

.cfc-main-text {
    text-align: center;
    font-size: 0.82rem;
    line-height: 1.7;
    color: rgba(230, 230, 240, 0.92);
    margin: 0.6rem 0;
    padding: 0.5rem 0.4rem;
    position: relative;
    border-left: 1px solid rgba(138, 43, 226, 0.25);
    border-right: 1px solid rgba(138, 43, 226, 0.25);
}

.cfc-dims {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.3rem;
    margin: 0.5rem 0;
    position: relative;
}

.cfc-dim {
    font-size: 0.72rem;
    color: rgba(200, 200, 220, 0.75);
    padding: 0.35rem 0.5rem;
    background: rgba(138, 43, 226, 0.06);
    border-radius: 2px;
    border: 1px solid rgba(138, 43, 226, 0.2);
    text-align: center;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
}

.cfc-tags {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin: 0.5rem 0 0.4rem;
    position: relative;
}

.cfc-tag {
    font-size: 0.66rem;
    color: rgba(200, 140, 255, 0.95);
    background: rgba(160, 80, 255, 0.08);
    padding: 0.2rem 0.6rem;
    border-radius: 2px;
    border: 1px solid rgba(180, 100, 255, 0.4);
    text-shadow: 0 0 4px rgba(180, 100, 255, 0.4);
    letter-spacing: 0.5px;
}

.cfc-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.6rem;
    padding-top: 0.4rem;
    border-top: 1px solid rgba(180, 180, 200, 0.12);
    position: relative;
}

.cfc-gz {
    font-size: 0.62rem;
    color: rgba(210, 210, 230, 0.85);
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
}

.cfc-brand {
    font-size: 0.65rem;
    color: rgba(190, 120, 255, 0.95);
    font-weight: 700;
    letter-spacing: 2px;
    text-shadow: 0 0 6px rgba(138, 43, 226, 0.4);
}

.cfc-save-tip {
    text-align: center;
    margin-top: 0.8rem;
    padding: 0.5rem 1rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: #00e5ff;
    background: rgba(0, 229, 255, 0.08);
    border: 1px solid rgba(0, 229, 255, 0.45);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    letter-spacing: 1.5px;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.5), 0 0 16px rgba(0, 229, 255, 0.2);
}

.cfc-save-tip:hover {
    background: rgba(0, 229, 255, 0.15);
    color: #00ffea;
    border-color: rgba(0, 229, 255, 0.7);
    text-shadow: 0 0 12px rgba(0, 229, 255, 0.7), 0 0 24px rgba(0, 229, 255, 0.3);
}

.cfc-save-tip:active {
    transform: scale(0.97);
}

.cyber-fortune-card.cfc-saving .cfc-save-tip {
    color: rgba(0, 229, 255, 0.9);
    border-color: rgba(0, 229, 255, 0.5);
    background: rgba(0, 229, 255, 0.08);
}

.cyber-fortune-card.cfc-saving .cfc-save-tip::after {
    content: ' ✓ 长按已触发';
}

/* === 卡片预览遮罩层（移动端保存） === */
.card-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.card-preview-overlay.active {
    opacity: 1;
}

.card-preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90vw;
    max-height: 90vh;
}

.card-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.8rem 0;
    margin-bottom: 0.5rem;
}

.card-preview-title {
    color: #fff;
    font-size: 0.95rem;
    opacity: 0.9;
    animation: previewTitlePulse 2s ease-in-out infinite;
}

@keyframes previewTitlePulse {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 0.5; }
}

.card-preview-close {
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    opacity: 0.7;
    padding: 0.3rem 0.6rem;
    transition: opacity 0.2s;
}

.card-preview-close:hover,
.card-preview-close:active {
    opacity: 1;
}

.card-preview-img-wrap {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.card-preview-img {
    display: block;
    max-width: 80vw;
    max-height: 65vh;
    object-fit: contain;
    border-radius: 8px;
    -webkit-touch-callout: default; /* 允许长按菜单 */
    -webkit-user-select: auto;
    user-select: auto;
}

.card-preview-actions {
    display: flex;
    gap: 0.8rem;
    margin-top: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.card-preview-btn {
    padding: 0.7rem 1.4rem;
    border: none;
    border-radius: 24px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    font-weight: 500;
}

.card-preview-btn:active {
    transform: scale(0.95);
}

.card-preview-share {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.card-preview-save {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

