/* 全局变量设计 */
/* 为什么这样设计：采用 CSS 自定义变量集中管理色盘，琥珀金与黑耀石黑的搭配最贴合古玩、文玩手串的高情感温度 */
:root {
    --bg-gradient: linear-gradient(135deg, #090a0f 0%, #151821 100%);
    --card-bg: rgba(255, 255, 255, 0.04);
    --card-border: rgba(255, 255, 255, 0.08);
    --gold-glow: rgba(212, 175, 55, 0.3);
    --gold-primary: #d4af37;
    --text-primary: #f0f2f5;
    --text-secondary: #a0aab8;
    --reasoning-bg: rgba(212, 175, 55, 0.05);
    --reasoning-border: rgba(212, 175, 55, 0.15);
    --font-sans: 'Outfit', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* 基础重置 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg-gradient);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    padding: 2rem 1rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* 容器限制 */
.appContainer {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* 头部视觉设计 */
.appHeader {
    text-align: center;
    padding: 1.5rem 0;
}

.logoText {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--gold-primary);
    margin-bottom: 0.5rem;
    background: linear-gradient(90deg, #b8901c, #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.mainTitle {
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.subTitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 300;
}

/* 玻璃拟态卡片定义 */
/* 为什么这样设计：backdrop-filter 能够过滤卡片背后，呈现高级的磨砂玻璃透光感，金色细微阴影突出品相 */
.glassCard {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: var(--transition-smooth);
}

.glassCard:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
}

.cardTitle {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.6rem;
}

.cardTitle h3 {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.cardTitle .icon {
    font-size: 1.2rem;
}

/* 上传区样式 */
.dropZone {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.01);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.dropZone:hover {
    border-color: var(--gold-primary);
    background: rgba(212, 175, 55, 0.02);
}

.uploadIcon {
    font-size: 2rem;
    margin-bottom: 0.8rem;
    opacity: 0.7;
}

.primaryPrompt {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 0.3rem;
}

.secondaryPrompt {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.imagePreview {
    max-width: 100%;
    max-height: 250px;
    border-radius: 8px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* 提问区样式 */
.inputGroup {
    margin-bottom: 1rem;
}

.customTextarea {
    width: 100%;
    height: 90px; /* 默认约90px高度可完美展示三行字 */
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 0.8rem;
    padding-right: 42px !important; /* 由于语音图标变小了，安全右边距可以从60px缩减到42px，节省输入空间 */
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    line-height: 1.5;
    resize: none;
    outline: none;
    transition: var(--transition-smooth);
}

.customTextarea:focus {
    border-color: var(--gold-primary);
    box-shadow: 0 0 10px var(--gold-glow);
}

.presetContainer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.presetLabel {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.presetTag {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 30px;
    padding: 0.3rem 0.7rem;
    font-size: 0.75rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.presetTag:hover {
    background: rgba(212, 175, 55, 0.12);
    border-color: var(--gold-primary);
    color: var(--gold-primary);
}

/* 按钮及流光动效 */
/* 为什么这样设计：发光（glow）视觉让操作变得极其生动，提升交互意愿 */
.actionButton {
    width: 100%;
    padding: 0.9rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: #0b0c10;
    background: var(--gold-primary);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.glowButton {
    box-shadow: 0 4px 20px var(--gold-glow);
}

.glowButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(212, 175, 55, 0.5);
    background: #e5bd3d;
}

.glowButton:active {
    transform: translateY(0);
}

/* 分析结果展示区 */
.resultCard {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* 思考链样式 */
/* 为什么这样设计：金色磨砂半透微亮，配合旋转的 loader 动画，让买家在现场等待 AI “鉴宝”时充满仪式感和期待感 */
.reasoningWrapper {
    background: var(--reasoning-bg);
    border: 1px solid var(--reasoning-border);
    border-radius: 12px;
    padding: 1.2rem;
}

.reasoningHeader {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    color: var(--gold-primary);
    margin-bottom: 0.8rem;
    font-weight: 500;
}

.reasoningContent {
    font-size: 0.85rem;
    line-height: 1.6;
    color: #c5a880;
    font-style: italic;
    white-space: pre-wrap;
    border-left: 2px solid var(--reasoning-border);
    padding-left: 0.8rem;
}

/* 结论排版区 */
.conclusionWrapper {
    animation: fadeIn 0.5s ease;
}

.conclusionContent {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-primary);
}

.conclusionContent h3 {
    color: var(--gold-primary);
    font-size: 1.2rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.4rem;
}

.conclusionContent p {
    margin-bottom: 0.8rem;
}

.conclusionContent ul {
    margin-left: 1.2rem;
    margin-bottom: 1rem;
}

.conclusionContent li {
    margin-bottom: 0.4rem;
}

/* 简易动画 */
.loader {
    width: 14px;
    height: 14px;
    border: 2px solid transparent;
    border-top-color: var(--gold-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

/* 页脚 */
.appFooter {
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.2);
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

/* 语音输入与耳返按钮样式 */
/* 为什么这样设计：与整体暗金调性契合。麦克风录制时带有红光脉冲，耳返播放时有绿光，给用户直观的高拟真反馈 */
.micBtn {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 26px; /* 进一步微缩至 26px，正占一行字的高度 */
    height: 26px; /* 进一步微缩至 26px，正占一行字的高度 */
    border-radius: 50% !important; /* 维持纯圆 */
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important; /* 移除内补丁 */
    font-size: 0.85rem; /* Icon 缩小，整体极其精致 */
    transition: var(--transition-smooth);
}

.micBtn:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--gold-primary);
    color: var(--gold-primary);
}

.micBtn.recording {
    background: rgba(235, 87, 87, 0.2);
    border-color: #eb5757;
    color: #eb5757;
    animation: pulse 1.5s infinite;
}

.ttsBtn {
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 6px;
    padding: 0.3rem 0.6rem;
    color: var(--gold-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition-smooth);
}

.ttsBtn:hover {
    background: rgba(212, 175, 55, 0.2);
    box-shadow: 0 0 8px var(--gold-glow);
}

.ttsBtn.playing {
    background: rgba(46, 204, 113, 0.15);
    border-color: #2ecc71;
    color: #2ecc71;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(235, 87, 87, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(235, 87, 87, 0); }
    100% { box-shadow: 0 0 0 0 rgba(235, 87, 87, 0); }
}

/* 全局清除点击焦点外圈与高亮，提升移动端手感 */
button, input, textarea, a, select {
    outline: none !important;
    -webkit-tap-highlight-color: transparent;
}

/* 语音转文字二级交互浮层 (仿豆包/微信) */
.voiceOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    display: flex;
    align-items: flex-end; /* 底部弹出 */
    justify-content: center;
}

.voiceMask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.voicePanel {
    position: relative;
    width: 100%;
    max-width: 680px;
    background: #141620;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px 24px 0 0;
    padding: 2rem 1.5rem 3rem 1.5rem;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
    z-index: 1001;
    transform: translateY(0);
    animation: slideUp 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.voiceHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.voiceTitle {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gold-primary);
}

.voiceCloseBtn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.voiceCloseBtn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

/* 麦克风动态水波纹音波图 */
.voiceWaveContainer {
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.voiceWaveIcon {
    font-size: 2.2rem;
    z-index: 2;
    background: #1e202b;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--gold-primary);
    box-shadow: 0 0 15px var(--gold-glow);
}

.voiceWaveCircle {
    position: absolute;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.2);
    animation: expandWave 2s infinite cubic-bezier(0.1, 0.8, 0.3, 1);
    z-index: 1;
}

.voiceWaveCircle.delay1 {
    animation-delay: 0.6s;
}

.voiceWaveCircle.delay2 {
    animation-delay: 1.2s;
}

@keyframes expandWave {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(2.2);
        opacity: 0;
    }
}

.voiceStatusText {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* 草稿文字编辑框 */
.voiceDraftBox {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 0.8rem;
}

.voiceDraftInput {
    width: 100%;
    height: 100px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    line-height: 1.6;
    resize: none;
    outline: none;
}

/* 按钮组 */
.voiceActionGroup {
    display: flex;
    gap: 1rem;
}

.voiceActionBtn {
    flex: 1;
    padding: 0.8rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
}

.voiceActionBtn.cancel {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.voiceActionBtn.cancel:hover {
    background: rgba(255, 255, 255, 0.1);
}

.voiceActionBtn.confirm {
    background: var(--gold-primary);
    color: #0b0c10;
}

.voiceActionBtn.confirm:hover {
    background: #e5bd3d;
}

/* 移动端首屏高度优化与留白压缩 */
@media (max-width: 480px) {
    body {
        padding: 0.5rem 0.5rem 2rem 0.5rem !important;
    }
    
    .appContainer {
        gap: 0.8rem !important;
    }
    
    .appHeader {
        padding: 0.4rem 0 !important;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 8px;
    }
    
    .logoText {
        margin-bottom: 0 !important;
        font-size: 0.8rem !important;
    }
    
    .mainTitle {
        font-size: 1.15rem !important;
        margin-bottom: 0 !important;
    }
    
    .glassCard {
        padding: 0.8rem !important;
        border-radius: 12px !important;
    }
    
    .cardTitle {
        margin-bottom: 0.7rem !important;
        padding-bottom: 0.4rem !important;
    }
    
    .dropZone {
        padding: 1.5rem 1rem !important;
    }
    
    .uploadIcon {
        font-size: 1.6rem !important;
        margin-bottom: 0.4rem !important;
    }
    
    .customTextarea {
        height: 84px !important; /* 移动端字号下展示3行的合适高度 */
        font-size: 0.85rem !important;
        padding-right: 42px !important;
    }
}

