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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: #fff;
    height: 100vh;
    overflow: hidden;
    color: #333;
}

/* 顶部图片 - 抖音白色风格 - 完美宽高自适应，最佳尺寸720x180px */
.header-image {
    position: fixed;
    top: 0;
    left: 50%; /* 居中定位 */
    transform: translateX(-50%); /* 居中偏移 */
    width: 100%;
    max-width: 720px; /* 限制最大宽度为720px，适配标准手机 */
    z-index: 10;
    overflow: hidden;
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.header-image img {
    width: 100%;
    height: auto; /* 保持宽高比自适应 */
    min-height: 80px; /* 最小高度防止太矮 */
    max-height: 200px; /* 限制最大高度防止太高 */
    object-fit: contain; /* 保持图片完整显示，不裁剪 */
    object-position: center; /* 居中显示 */
    display: block; /* 消除底部空隙 */
}

/* 响应式调整 */
@media (max-width: 480px) {
    /* 小屏手机 */
    .header-image img {
        max-height: 120px;
    }
}

@media (min-width: 481px) and (max-width: 720px) {
    /* 中屏手机 */
    .header-image img {
        max-height: 150px;
    }
}

@media (min-width: 721px) {
    /* 平板和桌面 */
    .header-image {
        max-width: 720px; /* 保持720px最大宽度 */
    }

    .header-image img {
        max-height: 180px;
    }
}

/* 聊天容器 - 抖音白色主题，适配720px居中布局 */
.chat-container {
    position: fixed;
    top: 150px; /* 默认值，会通过JS动态调整 */
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 720px;
    bottom: 70px;
    padding: 15px 12px;
    overflow-y: auto;
    background: #fff;
    scrollbar-width: none;
    -ms-overflow-style: none;
    transition: top 0.3s ease; /* 添加平滑过渡 */
}

.chat-container::-webkit-scrollbar {
    display: none;
}

/* 消息样式 - 抖音私信风格 */
.message {
    display: flex;
    margin-bottom: 16px;
    align-items: flex-start;
    gap: 8px;
    animation: messageSlideIn 0.3s ease-out;
}

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

.message.system {
    justify-content: flex-start;
}

.message.user {
    justify-content: flex-end;
    flex-direction: row-reverse;
    margin-left: auto;
    width: fit-content;
    max-width: 85%;
}

/* 头像样式 */
.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(0,0,0,0.1);
    background: #f5f5f5;
}

.message-content {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 20px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    position: relative;
}

/* 系统消息（客服） */
.message.system .message-content {
    background: #f5f5f5;
    color: #333;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 20px 20px 20px 6px;
}

/* 用户消息 */
.message.user .message-content {
    background: linear-gradient(135deg, #FE2C55 0%, #FF4081 100%);
    color: #fff;
    border-radius: 20px 20px 6px 20px;
    box-shadow: 0 2px 8px rgba(254,44,85,0.3);
}

/* 卡片消息基础样式 - 统一的长方形左图右文布局 */
.card-message {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    width: 100%;
    max-width: 85%;
    margin: 8px 0;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    display: flex;
    min-height: 100px;
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.card-message:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    border-color: rgba(254, 44, 85, 0.2);
}

/* 统一的卡片左侧图片 */
.card-image {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    background: #f5f5f5;
    position: relative;
    overflow: hidden;
    display: flex;  /* 使用flex布局消除空隙 */
    align-items: center;
    justify-content: center;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;  /* 消除图片底部空隙 */
    vertical-align: middle;  /* 额外保险 */
    line-height: 0;  /* 消除行高导致的空隙 */
}

/* 统一的卡片右侧内容 */
.card-body {
    flex: 1;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

/* 卡片标题 */
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #161823;
    margin-bottom: 8px;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}

/* 卡片描述 */
.card-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}

/* 卡片价格（如果有） */
.card-price {
    margin-top: 8px;
    font-size: 18px;
    font-weight: 700;
    color: #FE2C55;
}

.card-price-label {
    font-size: 14px;
    font-weight: normal;
    margin-right: 2px;
}

/* 卡片标签（如果有） */
.card-tags {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.card-tag {
    padding: 2px 8px;
    background: rgba(254, 44, 85, 0.1);
    color: #FE2C55;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* 移动端适配 */
@media (max-width: 480px) {
    .card-message {
        max-width: 95%;
    }

    .card-image {
        width: 90px;
        height: 90px;
    }

    .card-body {
        padding: 12px;
    }

    .card-title {
        font-size: 15px;
    }

    .card-desc {
        font-size: 13px;
    }
}

/* 选项按钮样式 - 抖音风格 */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 90%;
    margin: 15px 0;
}

.options-buttons-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.options-title {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    padding: 0 4px;
    font-weight: 500;
    pointer-events: none;
    user-select: none;
}

.option-button {
    background: linear-gradient(135deg, #FE2C55 0%, #FF4081 100%);
    border: 2px solid transparent;
    border-radius: 25px;
    padding: 12px 24px;  /* 调整：高度减小，宽度增加 */
    font-size: 15px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(254, 44, 85, 0.3);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    min-width: 140px;  /* 增加最小宽度 */
}

.option-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #FF4081 0%, #FF6B9D 100%);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: -1;
}

.option-button:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(254,44,85,0.5);
    background: linear-gradient(135deg, #FF4081 0%, #FF6B9D 100%);
    border-color: rgba(254,44,85,0.3);
}

.option-button:hover::before {
    opacity: 1;
}

.option-button:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 4px 12px rgba(254,44,85,0.15);
}

.option-button.selected {
    background: linear-gradient(135deg, #D91E48 0%, #C2185B 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 20px rgba(217, 30, 72, 0.5);
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
    transform: scale(0.95);
}

.option-button.selected::before {
    opacity: 0;
}

.option-button.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
    transform: none !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05) !important;
}

/* 剧本控制按钮 */
.script-control-btn {
    background: linear-gradient(135deg, #666 0%, #888 100%);
    border: none;
    border-radius: 16px;
    padding: 10px 16px;
    font-size: 12px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
    font-weight: 500;
}

.script-control-btn:hover {
    background: linear-gradient(135deg, #555 0%, #777 100%);
    transform: translateY(-1px);
}

.script-control-btn:active {
    transform: translateY(0) scale(0.95);
}

/* 底部输入框 - 抖音白色风格，适配720px居中布局 */
.input-container {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 720px;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(20px);
    padding: 12px 15px;
    display: flex;
    gap: 10px;
    border-top: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
    z-index: 100;
}

#messageInput {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid rgba(0,0,0,0.2);
    border-radius: 22px;
    font-size: 14px;
    outline: none;
    background: #f8f9fa;
    color: #333;
    transition: all 0.3s ease;
}

#messageInput::placeholder {
    color: rgba(0,0,0,0.6);
}

#messageInput:focus {
    border-color: #FE2C55;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(254,44,85,0.2);
}

#sendBtn {
    padding: 12px 20px;
    background: linear-gradient(135deg, #FE2C55 0%, #FF4081 100%);
    color: #fff;
    border: none;
    border-radius: 22px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(254,44,85,0.3);
    min-width: 60px;
}

#sendBtn:hover {
    background: linear-gradient(135deg, #d91d43 0%, #e91e63 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(254,44,85,0.4);
}

#sendBtn:active {
    transform: translateY(0) scale(0.95);
    box-shadow: 0 2px 6px rgba(254,44,85,0.3);
}

/* 输入提示 - 抖音白色风格 */
.typing-indicator {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #f5f5f5;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 20px 20px 20px 6px;
    gap: 4px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FE2C55 0%, #FF4081 100%);
    animation: douyinTyping 1.4s infinite ease-in-out;
    box-shadow: 0 0 4px rgba(254,44,85,0.5);
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

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

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

@keyframes douyinTyping {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
        box-shadow: 0 0 8px rgba(254,44,85,0.8);
    }
}

/* 卡片样式变体 - 适应新布局 */

/* 默认样式 */
.card-style-default {
    border-left: 4px solid #667eea;
}

.card-style-default .card-icon-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 现代简约样式 */
.card-style-modern {
    border-radius: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
}

.card-style-modern .card-icon-container {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    border-radius: 16px;
}

.card-style-modern .card-button {
    border-radius: 12px;
    background: #6c757d;
}

.card-style-modern .card-button:hover {
    background: #5a6268;
}

/* 彩色活泼样式 */
.card-style-colorful {
    background: linear-gradient(135deg, #ff6b6b 0%, #4ecdc4 100%);
    color: white;
    border: none;
}

.card-style-colorful .card-icon-container {
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
}

.card-style-colorful .card-icon-emoji {
    color: #ff6b6b;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.card-style-colorful .card-title {
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.card-style-colorful .card-button {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(10px);
}

.card-style-colorful .card-button:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-1px);
}

/* 商务正式样式 */
.card-style-business {
    background: #2c3e50;
    color: white;
    border-radius: 12px;
    border: 1px solid #34495e;
}

.card-style-business .card-icon-container {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
}

.card-style-business .card-title {
    color: #ecf0f1;
}

.card-style-business .card-button {
    background: #3498db;
    border-radius: 6px;
}

.card-style-business .card-button:hover {
    background: #2980b9;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* 极简风格样式 */
.card-style-minimal {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.card-style-minimal .card-icon-container {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
}

.card-style-minimal .card-icon-emoji {
    color: #757575;
    text-shadow: none;
}

.card-style-minimal .card-title {
    color: #424242;
}

.card-style-minimal .card-button {
    background: #ffffff;
    color: #424242;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.card-style-minimal .card-button:hover {
    background: #f5f5f5;
    border-color: #bdbdbd;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 手机验证弹窗样式 - 精细化优化版 */
.verify-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(8px);
    }
}

.verify-modal-content {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 24px;
    width: 90%;
    max-width: 420px;
    padding: 0;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 1px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* 顶部装饰渐变 */
.verify-modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #ff2d55 0%, #ff6b6b 50%, #ff2d55 100%);
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
}

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

@keyframes slideUp {
    from {
        transform: translateY(60px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.verify-header {
    text-align: center;
    padding: 32px 32px 24px;
    background: linear-gradient(135deg, rgba(255, 45, 85, 0.05) 0%, rgba(255, 107, 107, 0.05) 100%);
    border-bottom: 1px solid rgba(255, 45, 85, 0.08);
    position: relative;
}

/* 标题图标装饰 */
.verify-header::before {
    content: '📱';
    display: block;
    font-size: 48px;
    margin-bottom: 12px;
    filter: drop-shadow(0 4px 8px rgba(255, 45, 85, 0.2));
    animation: float 3s ease-in-out infinite;
}

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

.verify-header h3 {
    margin: 0 0 10px 0;
    font-size: 22px;
    color: #1a1a1a;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ff2d55 0%, #ff6b6b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.verify-desc {
    margin: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    font-weight: 400;
}

.verify-body {
    padding: 28px 32px 24px;
}

.verify-step {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.verify-step input {
    width: 100%;
    padding: 15px 18px;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    font-size: 16px;
    box-sizing: border-box;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #ffffff;
    color: #1a1a1a;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.verify-step input::placeholder {
    color: #aaa;
    font-weight: 400;
    letter-spacing: 0;
}

.verify-step input:focus {
    outline: none;
    border-color: #ff2d55;
    background: #fff;
    box-shadow:
        0 0 0 4px rgba(255, 45, 85, 0.1),
        0 4px 12px rgba(255, 45, 85, 0.15);
    transform: translateY(-1px);
}

.verify-step input:hover:not(:focus) {
    border-color: #d0d0d0;
}

.verify-btn {
    width: 100%;
    padding: 15px 18px;
    background: linear-gradient(135deg, #ff2d55 0%, #ff6b6b 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(255, 45, 85, 0.25);
}

/* 按钮光泽效果 */
.verify-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.verify-btn:hover::before {
    left: 100%;
}

.verify-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 45, 85, 0.35);
}

.verify-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(255, 45, 85, 0.3);
}

.verify-btn:disabled {
    background: linear-gradient(135deg, #d0d0d0 0%, #c0c0c0 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

.verify-message {
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    text-align: center;
    min-height: 20px;
    line-height: 1.5;
    font-weight: 500;
    animation: slideInMessage 0.3s ease;
}

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

.verify-message.success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 1px solid #b8dfc8;
    box-shadow: 0 2px 8px rgba(21, 87, 36, 0.1);
}

.verify-message.success::before {
    content: '✓ ';
    font-weight: 700;
}

.verify-message.error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 1px solid #f1aeb5;
    box-shadow: 0 2px 8px rgba(114, 28, 36, 0.1);
}

.verify-message.error::before {
    content: '✕ ';
    font-weight: 700;
}

.verify-message.info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
    border: 1px solid #abdde5;
    box-shadow: 0 2px 8px rgba(12, 84, 96, 0.1);
}

.verify-message.info::before {
    content: 'ℹ ';
    font-weight: 700;
}

.verify-footer {
    text-align: center;
    padding: 0 32px 32px;
}

.cancel-btn {
    padding: 12px 28px;
    background: #f8f9fa;
    color: #666;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
}

.cancel-btn:hover {
    background: #ffffff;
    color: #333;
    border-color: #d0d0d0;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.cancel-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

/* 响应式优化 */
@media (max-width: 480px) {
    .verify-modal-content {
        width: 95%;
        max-width: none;
        margin: 0 10px;
    }

    .verify-header {
        padding: 28px 24px 20px;
    }

    .verify-header::before {
        font-size: 40px;
        margin-bottom: 10px;
    }

    .verify-header h3 {
        font-size: 20px;
    }

    .verify-body {
        padding: 24px;
    }

    .verify-footer {
        padding: 0 24px 28px;
    }
}
