/* ============================================================
   SayDock 站点附加样式
   1. 首页 Hero 聊天演示（纯 CSS 动画，无第三方组件）
   2. 下载页：下载卡片 / 系统要求 / 常见问题
   3. 通用：提示浮层 Toast、下载缺失提示
   配色与排版沿用 style.css 中的 CSS 变量，保持与官网一致
   ============================================================ */

/* ------------------------------------------------------------
   0. 基础：锚点跳转时避开固定导航栏
   ------------------------------------------------------------ */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

/* 滚动进入动画：作为渐进增强，仅在脚本可用时隐藏初始状态，
   脚本失效或加载失败时内容仍然可见 */
.fade-up {
    opacity: 1;
    transform: none;
}

html.js .fade-up:not(.visible) {
    opacity: 0;
    transform: translateY(30px);
}

/* ------------------------------------------------------------
   1. Hero 聊天演示
   ------------------------------------------------------------ */
.chat-demo {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-width: 500px;
    margin: 0 auto;
}

.chat-window {
    position: absolute;
    top: 4%;
    left: 0;
    width: 76%;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    box-shadow: 0 18px 48px rgba(37, 99, 235, 0.12);
    overflow: hidden;
    animation: chat-float 6s ease-in-out infinite;
}

.chat-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
}

.chat-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--accent-blue) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.chat-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-dark);
}

.chat-status {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--green-dark);
    background: rgba(34, 197, 94, 0.12);
    border-radius: 50px;
    padding: 0.15rem 0.5rem;
}

.chat-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    background: #ffffff;
    min-height: 220px;
}

.chat-bubble {
    font-size: 0.82rem;
    line-height: 1.6;
    padding: 0.6rem 0.85rem;
    border-radius: 14px;
    max-width: 88%;
}

.chat-bubble.left {
    background: #f1f5f9;
    color: var(--text-medium);
    border-top-left-radius: 4px;
    align-self: flex-start;
}

.chat-bubble.right {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    color: #fff;
    border-top-right-radius: 4px;
    align-self: flex-end;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
}

.chat-bubble.typing {
    opacity: 0;
    animation: chat-reveal 9s ease-in-out infinite;
}

.chat-typing {
    display: inline-flex;
    gap: 4px;
    align-self: flex-start;
    background: #f1f5f9;
    padding: 0.5rem 0.7rem;
    border-radius: 14px;
    border-top-left-radius: 4px;
}

.chat-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #94a3b8;
    animation: chat-dot 1.4s ease-in-out infinite;
}

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

/* 快捷回复面板 */
.dock-panel {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 66%;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
    overflow: hidden;
    animation: chat-float 6s ease-in-out infinite;
    animation-delay: -3s;
}

.dock-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 0.85rem;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    color: #fff;
}

.dock-title {
    font-size: 0.82rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.dock-hint {
    font-size: 0.65rem;
    opacity: 0.75;
    letter-spacing: 0.05em;
}

.dock-search {
    margin: 0.65rem 0.7rem 0.35rem;
    padding: 0.4rem 0.6rem;
    border-radius: 9px;
    background: var(--bg-gray);
    color: var(--text-light);
    font-size: 0.72rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.dock-list {
    list-style: none;
    margin: 0;
    padding: 0.3rem 0.55rem 0.7rem;
}

.dock-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.72rem;
    color: var(--text-medium);
    padding: 0.42rem 0.5rem;
    border-radius: 9px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dock-list li.active {
    background: var(--soft-blue);
    color: var(--primary-blue);
    font-weight: 600;
}

.dock-list kbd {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.6rem;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    background: #fff;
    border: 1px solid var(--border-color);
    color: var(--primary-blue);
    box-shadow: none;
}

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

@keyframes chat-reveal {
    0%, 12%   { opacity: 0; transform: translateY(6px); }
    22%, 82%  { opacity: 1; transform: translateY(0); }
    92%, 100% { opacity: 0; transform: translateY(6px); }
}

@keyframes chat-dot {
    0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
    30%           { opacity: 1; transform: translateY(-3px); }
}

@media (max-width: 575px) {
    .chat-window { width: 88%; }
    .dock-panel  { width: 78%; }
    .chat-body   { min-height: 180px; }
}

/* 尊重系统「减少动态效果」偏好 */
@media (prefers-reduced-motion: reduce) {
    .chat-window,
    .dock-panel,
    .chat-bubble.typing,
    .chat-typing span {
        animation: none;
    }
    .chat-bubble.typing { opacity: 1; }
}

/* ------------------------------------------------------------
   2. 下载页
   ------------------------------------------------------------ */
.download-hero {
    background: linear-gradient(180deg, var(--soft-blue) 0%, #ffffff 100%);
    padding: 140px 0 60px;
    text-align: center;
}

.download-hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.download-hero p {
    color: var(--text-medium);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 1rem;
}

.download-hero .version-badge {
    display: inline-block;
    background: var(--soft-blue-2);
    color: var(--primary-blue);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
}

.download-section {
    padding: 4rem 0;
    background: #fff;
}

.download-cards {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.download-card {
    background: #f8fafc;
    border-radius: 20px;
    padding: 2.5rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    width: 300px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.download-card:hover {
    border-color: var(--primary-blue);
    background: #f0f7ff;
}

.download-card .os-icon {
    margin: 0 auto 1rem;
    font-size: 4rem;
}

.download-card.windows .os-icon { color: #0078d4; }
.download-card.macos .os-icon   { color: #1d1d1d; }

.download-card .os-name {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.download-card .os-version {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 2rem;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.download-card .btn-download-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.download-card.windows .btn-download-main {
    background: linear-gradient(135deg, #00a4ef 0%, #0078d4 100%);
    color: #fff;
}

.download-card.windows .btn-download-main:hover {
    background: linear-gradient(135deg, #0078d4 0%, #005a9e 100%);
    transform: scale(1.02);
    color: #fff;
}

.download-card.macos .btn-download-main {
    background: linear-gradient(135deg, #555 0%, #1d1d1d 100%);
    color: #fff;
}

.download-card.macos .btn-download-main:hover {
    background: linear-gradient(135deg, #333 0%, #000 100%);
    transform: scale(1.02);
    color: #fff;
}

.download-card .file-name {
    margin-top: 1rem;
    font-size: 0.75rem;
    color: var(--text-light);
    word-break: break-all;
}

.requirements-section {
    padding: 4rem 0;
    background: #fff;
}

.requirements-title {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 3rem;
}

.requirement-card {
    background: #f8fafc;
    border-radius: 16px;
    padding: 2rem;
    height: 100%;
}

.requirement-card h4 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
}

.requirement-card h4 i { font-size: 1.5rem; }
.requirement-card.windows h4 i { color: #0078d4; }
.requirement-card.macos h4 i   { color: #1d1d1d; }

.requirement-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.requirement-card ul li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: var(--text-medium);
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.requirement-card ul li i {
    color: var(--green-primary);
    margin-top: 0.2rem;
}

.faq-section {
    padding: 4rem 0;
    background: #f8fafc;
}

.faq-title {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 3rem;
}

.faq-item {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.faq-item h5 {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.faq-item h5 i { color: var(--primary-blue); }

.faq-item p {
    color: var(--text-medium);
    margin-bottom: 0;
    padding-left: 1.75rem;
}

/* ------------------------------------------------------------
   3. 通用：提示浮层
   ------------------------------------------------------------ */
.site-toast {
    position: fixed;
    left: 50%;
    bottom: 32px;
    transform: translate(-50%, 20px);
    max-width: min(92vw, 460px);
    background: #1e293b;
    color: #fff;
    font-size: 0.9rem;
    line-height: 1.6;
    padding: 0.85rem 1.15rem;
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.28);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 2000;
}

.site-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.site-toast code {
    color: #93c5fd;
    font-size: 0.85em;
}
