/* css/style.css */

/* ========== 1. 全局基础 ========== */
:root {
    --primary-color: #4080ff;
    --primary-hover: #3070ef;
    --text-main: #333;
    --text-gray: #666;
    --bg-color: #f6f7f9;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* 防止图片撑开 */
img, svg { max-width: 100%; display: inline-block; vertical-align: middle; }
a { text-decoration: none; color: inherit; cursor: pointer; }
ul { list-style: none; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ========== 2. 顶部导航 ========== */
.header { background: #fff; padding: 0; height: 60px; box-shadow: 0 1px 4px rgba(0,0,0,0.05); position: fixed; width: 100%; top: 0; z-index: 50; }
.navbar { display: flex; justify-content: space-between; align-items: center; height: 100%; }
.logo { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 20px; color: #000; }
.logo img { width: 32px; height: 32px; }
.nav-menu { display: flex; height: 100%; }
.nav-menu li { height: 100%; display: flex; align-items: center; }
.nav-menu a { padding: 0 20px; color: #4e5969; font-size: 14px; height: 100%; display: flex; align-items: center; transition: color 0.2s; }
.nav-menu a:hover, .nav-menu a.active { color: var(--primary-color); font-weight: 500; }

/* ========== 3. 主内容区 ========== */
.main-content { padding-top: 100px; min-height: 85vh; padding-bottom: 60px; background-image: url('https://snapany.com/images/hero-pattern.svg'); background-size: cover; background-attachment: fixed; }
.hero-section { text-align: center; max-width: 800px; margin: 0 auto; }

/* 标题区 */
.hero-title { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 16px; }
.hero-title img { width: 32px; height: 32px; }
.hero-title h1 { font-size: 30px; font-weight: 700; color: #1d2129; }
.subtitle { color: #86909c; font-size: 16px; margin-bottom: 40px; }

/* 解析卡片 */
.parse-card { background: #fff; border-radius: 12px; padding: 32px; box-shadow: 0 4px 16px rgba(0,0,0,0.04); text-align: left; margin-bottom: 40px; }
.input-label { font-size: 14px; font-weight: 500; margin-bottom: 12px; color: #4e5969; display: flex; align-items: center; gap: 4px; }
.input-group { position: relative; margin-bottom: 24px; }
.input-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: #c9cdd4; }
.input-group input { width: 100%; padding: 14px 40px 14px 44px; border: 1px solid #e5e6eb; border-radius: 8px; font-size: 14px; outline: none; transition: all 0.2s; color: #1d2129; }
.input-group input:focus { border-color: var(--primary-color); box-shadow: 0 0 0 2px rgba(64, 128, 255, 0.1); }
.clear-btn { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); cursor: pointer; color: #c9cdd4; font-size: 18px; transition: color 0.2s; }
.clear-btn:hover { color: #86909c; }

/* 平台图标列表 */
.platform-area { margin-bottom: 30px; }
.platform-title { font-size: 12px; color: #86909c; margin-bottom: 12px; }
.platform-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.platform-item { display: flex; align-items: center; gap: 6px; background: #f7f8fa; padding: 6px 12px; border-radius: 4px; font-size: 12px; color: #4e5969; cursor: pointer; border: 1px solid transparent; transition: all 0.2s; }
.platform-item:hover { background: #e8f3ff; color: var(--primary-color); border-color: var(--primary-color); }
.platform-item img { width: 16px; height: 16px; object-fit: contain; }

/* 解析按钮 */
.btn-submit { width: 100%; padding: 12px; background: var(--primary-color); color: #fff; border: none; border-radius: 8px; font-size: 16px; font-weight: 500; cursor: pointer; transition: background 0.2s; position: relative; }
.btn-submit:hover { background: var(--primary-hover); }
.btn-submit.loading { background: #94bfff; pointer-events: none; color: transparent; }
.btn-submit.loading::after { content: ""; position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; margin-left: -10px; margin-top: -10px; border: 2px solid #fff; border-top-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }

/* 底部链接条 */
.bottom-links { margin-top: 24px; display: flex; justify-content: center; align-items: center; gap: 16px; flex-wrap: wrap; }
.link-item { display: flex; align-items: center; gap: 4px; font-size: 14px; color: #86909c; transition: color 0.2s; }
.link-item:hover { color: var(--primary-color); }
.link-item svg { width: 16px; height: 16px; }
.divider { width: 1px; height: 14px; background: #e5e6eb; }
.new-badge { background: linear-gradient(90deg, #ff4d4f, #f76560); color: #fff; font-size: 10px; padding: 1px 5px; border-radius: 4px; margin-left: 4px; transform: scale(0.9); }

/* ========== 4. 弹窗系统 (复刻原站) ========== */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: all 0.3s;
    backdrop-filter: blur(4px);
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.modal-content {
    background: #fff; width: 90%; max-width: 480px; border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.1); transform: scale(0.95); opacity: 0; transition: all 0.3s;
    display: flex; flex-direction: column; max-height: 85vh;
}
.modal-overlay.active .modal-content { transform: scale(1); opacity: 1; }

.modal-header {
    padding: 16px 20px; border-bottom: 1px solid #f2f3f5;
    display: flex; justify-content: center; align-items: center; position: relative;
}
.modal-title { font-size: 16px; font-weight: 600; color: #1d2129; }
.modal-close {
    position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; color: #86909c; padding: 4px; border-radius: 4px;
}
.modal-close:hover { background: #f2f3f5; color: #4e5969; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-footer { padding: 16px 20px; border-top: 1px solid #f2f3f5; text-align: right; }
.btn-close { background: #f2f3f5; color: #4e5969; border: none; padding: 8px 20px; border-radius: 4px; cursor: pointer; font-size: 14px; transition: all 0.2s; }
.btn-close:hover { background: #e5e6eb; color: #1d2129; }

/* 弹窗卡片 (关于作者) */
.info-card {
    display: flex; align-items: flex-start; padding: 16px; border-radius: 12px;
    margin-bottom: 16px; transition: transform 0.2s, box-shadow 0.2s; cursor: default;
}
.info-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.info-card-icon { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-right: 12px; color: #fff; flex-shrink: 0; }
.info-card-content h3 { font-size: 15px; font-weight: 600; color: #1d2129; margin-bottom: 4px; }
.info-card-content p, .info-card-content a { font-size: 14px; color: #4e5969; }
.info-card-content a:hover { text-decoration: underline; }

/* 渐变色定义 */
.bg-blue-grad { background: linear-gradient(to right, #eff6ff, #eef2ff); }
.bg-green-grad { background: linear-gradient(to right, #f0fdf4, #ecfdf5); }
.bg-gray-grad { background: linear-gradient(to right, #f9fafb, #f8fafc); }
.bg-purple-grad { background: linear-gradient(to right, #faf5ff, #f5f3ff); }

/* ========== 5. 右上角提示 (复刻原站) ========== */
.toast-notice {
    position: fixed; top: 80px; right: 20px;
    background: #fff; border-radius: 8px; padding: 12px 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08); z-index: 100;
    display: flex; align-items: flex-start; gap: 12px;
    max-width: 340px; animation: slideIn 0.4s ease;
}
.toast-icon { color: #00b42a; margin-top: 2px; }
.toast-text { font-size: 14px; color: #1d2129; line-height: 1.5; flex: 1; }
.toast-close-btn { color: #c9cdd4; background: none; border: none; cursor: pointer; padding: 0; }
.toast-close-btn:hover { color: #86909c; }

/* ========== 6. 结果卡片 (优化版) ========== */
.result-card { background: #fff; border-radius: 12px; box-shadow: 0 4px 16px rgba(0,0,0,0.06); overflow: hidden; margin-top: 24px; animation: slideUp 0.4s ease; border: 1px solid #f2f3f5; }
.result-header { padding: 16px 20px; border-bottom: 1px solid #f2f3f5; display: flex; justify-content: space-between; align-items: center; }
.result-label { font-size: 16px; font-weight: 600; color: #1d2129; border-left: 4px solid var(--primary-color); padding-left: 10px; }
.result-actions { display: flex; gap: 8px; }
.action-btn { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 4px; font-size: 13px; cursor: pointer; border: none; transition: all 0.2s; }
.btn-primary { background: var(--primary-color); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-default { background: #f2f3f5; color: #4e5969; }
.btn-default:hover { background: #e5e6eb; color: #1d2129; }
.video-wrapper { background: #000; display: flex; justify-content: center; align-items: center; min-height: 300px; }
.video-player { width: 100%; max-height: 480px; min-height: 300px; }
.result-title { padding: 16px 20px; font-size: 14px; color: #4e5969; background: #fcfcfc; border-top: 1px solid #f2f3f5; }

/* ========== 7. 其他 ========== */
.footer { text-align: center; padding: 40px 0; color: #86909c; font-size: 13px; background: #f9fafb; margin-top: 40px; }
.footer nav { margin-bottom: 16px; }
.footer a { margin: 0 10px; color: #4e5969; }
.footer a:hover { color: var(--primary-color); }

.share-btn { position: fixed; bottom: 40px; right: 40px; width: 48px; height: 48px; background: #fff; border-radius: 50%; box-shadow: 0 4px 12px rgba(0,0,0,0.1); display: flex; align-items: center; justify-content: center; cursor: pointer; color: #4e5969; transition: all 0.2s; border: 1px solid #e5e6eb; }
.share-btn:hover { transform: translateY(-2px); color: var(--primary-color); box-shadow: 0 6px 16px rgba(0,0,0,0.12); }

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* 移动端适配 */
@media (max-width: 640px) {
    .header { padding: 0 10px; }
    .main-content { padding-top: 80px; }
    .toast-notice { top: auto; bottom: 20px; right: 20px; left: 20px; max-width: none; }
    .result-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .result-actions { width: 100%; justify-content: space-between; }
    .action-btn { flex: 1; justify-content: center; }
}