* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --primary: #f97316;
    --primary-light: #fb923c;
    --primary-dark: #ea580c;
    --bg: #ffffff;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #f1f5f9;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
    --radius: 12px;
    --radius-sm: 8px;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}
#app { min-height: 100vh; display: flex; flex-direction: column; }

/* ===== Header ===== */
.top-nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: 56px;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px;
    transition: box-shadow 0.3s;
}
.top-nav.scrolled { box-shadow: var(--shadow-md); }
.nav-logo {
    display: flex; align-items: center; gap: 10px;
    font-size: 20px; font-weight: 700; color: var(--primary);
    cursor: pointer; text-decoration: none;
}
.nav-logo svg { width: 28px; height: 28px; }
.nav-search {
    flex: 1; max-width: 480px; margin: 0 24px;
}
.nav-search-input {
    width: 100%; height: 36px; border-radius: 18px;
    border: 1px solid var(--border); background: var(--bg);
    padding: 0 16px 0 36px; font-size: 14px; color: var(--text);
    outline: none; transition: all 0.2s;
}
.nav-search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(249,115,22,0.15); }
.nav-search-wrap { position: relative; }
.nav-search-icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    width: 16px; height: 16px; color: var(--text-muted); pointer-events: none;
}

/* ===== Hero Section ===== */
.hero {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center;
    padding: 140px 24px 30px;
    transition: padding 0.4s;
}
.hero.compact { padding: 90px 24px 0px 24px; }
.hero-title {
    font-size: 36px; font-weight: 700; margin-bottom: 8px;
    background: linear-gradient(135deg, var(--primary) 0%, #a855f7 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-subtitle {
    font-size: 15px; color: var(--text-secondary); margin-bottom: 36px;
}

/* ===== Search Box ===== */
.search-box {
    width: 100%; max-width: 620px; position: relative;
}
.search-input-wrap {
    position: relative; display: flex; align-items: center;
}
.search-input {
    width: 100%; height: 52px; border-radius: 26px;
    border: 1px solid var(--border); background: var(--card-bg);
    padding: 0 120px 0 48px;
    font-size: 16px; color: var(--text);
    outline: none; transition: all 0.25s;
    animation: searchGlow 2.5s ease-in-out infinite;
}
@keyframes searchGlow {
    0%, 100% { box-shadow: 0 0 2px rgba(249,115,22,0.2); }
    50% { box-shadow: 0 0 6px rgba(249,115,22,0.35), 0 0 2px rgba(239,68,68,0.2); }
}
.search-input:focus {
    border-color: var(--primary);
    animation: none;
    box-shadow: 0 0 0 3px rgba(249,115,22,0.15);
}
.search-input::placeholder { color: var(--text-muted); }
.search-icon {
    position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
    width: 20px; height: 20px; color: var(--text-muted);
}
.search-btn {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    height: 40px; padding: 0 24px; border-radius: 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white; border: none; font-size: 15px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
    display: flex; align-items: center; gap: 6px;
}
.search-btn:hover { opacity: 0.9; transform: translateY(-50%) scale(1.02); }
.search-btn:active { transform: translateY(-50%) scale(0.98); }
.search-btn svg { width: 16px; height: 16px; }

/* ===== Hot Tags ===== */
.hot-tags {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-top: 16px; justify-content: center; max-width: 620px;
}
.hot-tag {
    padding: 6px 14px; border-radius: 16px;
    font-size: 13px; font-weight: 500;
    cursor: pointer; transition: all 0.2s;
    display: flex; align-items: center;
}
.hot-tag:hover { opacity: 0.85; transform: scale(1.03); }
.hot-tag.color-0 { background: rgba(239,68,68,0.1); color: #dc2626; border: 1px solid rgba(239,68,68,0.25); }
.hot-tag.color-1 { background: rgba(249,115,22,0.1); color: #ea580c; border: 1px solid rgba(249,115,22,0.25); }
.hot-tag.color-2 { background: rgba(34,197,94,0.1); color: #16a34a; border: 1px solid rgba(34,197,94,0.25); }
.hot-tag.color-3 { background: rgba(14,165,233,0.1); color: #0284c7; border: 1px solid rgba(14,165,233,0.25); }
.hot-tag.color-4 { background: rgba(168,85,247,0.1); color: #9333ea; border: 1px solid rgba(168,85,247,0.25); }
.hot-tag.color-5 { background: rgba(236,72,153,0.1); color: #db2777; border: 1px solid rgba(236,72,153,0.25); }
.hot-tag.color-6 { background: rgba(20,184,166,0.1); color: #0d9488; border: 1px solid rgba(20,184,166,0.25); }
.hot-tag.color-7 { background: rgba(99,102,241,0.1); color: #4f46e5; border: 1px solid rgba(99,102,241,0.25); }

/* ===== Content Area ===== */
.content {
    flex: 1; padding: 30px 24px 60px; max-width: 1200px; margin: 0 auto; width: 100%;
}

/* ===== Section Title ===== */
.section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px;
}
.section-title {
    font-size: 18px; font-weight: 500; color: var(--text);
    display: flex; align-items: center; gap: 2px;
}
.section-title svg { width: 22px; height: 22px; color: var(--primary); }
.section-back {
    font-size: 14px; color: var(--text-secondary); cursor: pointer;
    display: flex; align-items: center; gap: 4px;
    padding: 6px 12px; border-radius: var(--radius-sm);
    transition: all 0.2s;
}
.section-back:hover { background: rgba(249,115,22,0.06); color: var(--primary); }

/* 搜索结果页专用标题样式 */
.search-results-header {
    display: flex; align-items: center; justify-content: space-between;
    margin: 4px 0 12px 0px;
    padding: 16px 20px;
    background: rgba(0,0,0,0.02);
    border-radius: 6px;
}
.search-results-header .section-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.search-keyword {
    display: inline-block;
    max-width: 400px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
}

/* ===== Movie Grid ===== */
.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
}
.movie-card {
    cursor: pointer; transition: all 0.3s;
    border-radius: 6px; overflow: hidden;
    background: var(--card-bg);
    box-shadow: var(--shadow);
}
.movie-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.movie-poster {
    position: relative; width: 100%;
    padding-top: 140%; overflow: hidden;
    background: #f1f5f9;
}
.movie-poster img {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover; transition: transform 0.4s;
}
.movie-card:hover .movie-poster img { transform: scale(1.05); }
.movie-poster .badge {
    position: absolute; top: 8px; left: 8px;
    padding: 2px 8px; border-radius: 4px;
    font-size: 11px; font-weight: 600; color: white;
    background: rgba(0,0,0,0.55); backdrop-filter: blur(4px);
}
.movie-poster .rating-badge {
    position: absolute; top: 8px; right: 8px;
    padding: 2px 7px; border-radius: 4px;
    font-size: 12px; font-weight: 700; color: white;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
}
.movie-info { padding: 10px 12px 14px; }
.movie-name {
    font-size: 14px; font-weight: 600; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-bottom: 4px;
}
.movie-meta {
    font-size: 12px; color: var(--text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ===== Search Results ===== */
.result-list { display: flex; flex-direction: column; gap: 12px; }
.result-card {
    display: flex; gap: 16px;
    background: var(--card-bg); border-radius: 6px;
    padding: 16px; 
    border: 1px solid var(--border);
    cursor: pointer; transition: all 0.25s;
}
.result-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.result-poster {
    width: 100px; min-width: 100px; height: 140px;
    border-radius: 4px; overflow: hidden;
    background: #f1f5f9; flex-shrink: 0;
    position: relative;
}
.result-poster img { width: 100%; height: 100%; object-fit: cover; }
.poster-rating {
    position: absolute; top: 4px; left: 4px;
    background: rgba(239,68,68,0.9); color: #fff;
    font-size: 11px; font-weight: 600; padding: 2px 5px;
    border-radius: 4px;
}
.result-info { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.result-title {
    font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 6px;
    display: flex; align-items: center; gap: 8px;
}
.result-title .source-tag {
    font-size: 11px; font-weight: 500; padding: 2px 8px;
    border-radius: 4px; background: rgba(249,115,22,0.1);
    color: var(--primary); white-space: nowrap;
}
.result-title .platform-tag {
    font-size: 11px; font-weight: 500; padding: 2px 8px;
    border-radius: 4px; background: rgba(14,165,233,0.1);
    color: #0284c7; white-space: nowrap;
}
.result-title .quality-tag {
    font-size: 11px; font-weight: 500; padding: 2px 8px;
    border-radius: 4px; background: rgba(34,197,94,0.1);
    color: #16a34a; white-space: nowrap;
}
.result-title .rating-tag {
    font-size: 11px; font-weight: 600; padding: 2px 8px;
    border-radius: 4px; background: rgba(239,68,68,0.1);
    color: #dc2626; white-space: nowrap;
}
.result-desc {
    font-size: 13px; color: var(--text-secondary); line-height: 1.6;
    display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
    margin-bottom: 8px;
}
.result-meta {
    font-size: 12px; color: var(--text-muted); margin-bottom: 6px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.result-meta span { margin-right: 16px; }
.result-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 0px; }
.result-tag {
    font-size: 12px; padding: 3px 10px; border-radius: 12px;
}
.result-tag.tag-year {
    background: rgba(99,102,241,0.1); color: #6366f1;
}
.result-tag.tag-region {
    background: rgba(20,184,166,0.1); color: #14b8a6;
}
.result-tag.tag-type {
    background: rgba(168,85,247,0.1); color: #a855f7;
}
.result-tag.tag-extra {
    background: rgba(236,72,153,0.1); color: #ec4899;
}
/* 底部标签中的评分/来源/平台/清晰度 - 桌面端隐藏（标题行已显示） */
.result-tag.tag-rating,
.result-tag.tag-source,
.result-tag.tag-platform,
.result-tag.tag-quality { display: none; }
.result-episode {
    font-size: 12px; color: var(--primary); font-weight: 500;
}

/* ===== Loading ===== */
.loading { text-align: center; padding: 60px 0; }
.spinner {
    width: 36px; height: 36px; margin: 0 auto 12px;
    border: 3px solid var(--border); border-top-color: var(--primary);
    border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 14px; color: var(--text-muted); }

/* ===== Empty ===== */
.empty { text-align: center; padding: 80px 0; }
.empty svg { width: 64px; height: 64px; color: var(--border); margin-bottom: 16px; }
.empty-text { font-size: 15px; color: var(--text-muted); }

/* ===== Footer ===== */
.footer {
    text-align: center; padding: 24px;
    font-size: 13px; color: var(--text-muted);
    border-top: 1px solid var(--border); margin-top: auto;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .hero { padding: 120px 16px 40px; }
    .hero.compact { padding: 80px 16px 0px 20px; }
    .hero-title { font-size: 28px; }
    .search-input { height: 46px; padding: 0 100px 0 40px; font-size: 15px; }
    .search-btn { height: 34px; padding: 0 16px; font-size: 13px; }
    .content { padding: 20px 12px 40px; }
    .movie-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
    .nav-search { display: none; }
    
    /* 搜索结果标题 - 防止换行 */
    .section-header { flex-wrap: nowrap; gap: 2px; }
    .section-title { 
        font-size: 16px; flex: 1; min-width: 0;
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .section-back { flex-shrink: 0; padding: 4px 8px; font-size: 12px; white-space: nowrap; }
    
    /* 手机端搜索关键词宽度限制 */
    .search-keyword { max-width: 200px; }
    
    /* 搜索结果卡片 - 手机端专用布局 */
    .result-card { padding: 10px; gap: 10px; }
    .result-poster { width: 85px; min-width: 85px; height: 120px; }
    .result-info { gap: 4px; }
    
    /* 第1行：标题 + 右侧固定来源标签 */
    .result-title { 
        font-size: 14px; font-weight: 600;
        display: flex; align-items: center; gap: 6px;
    }
    .result-title .title-text {
        flex: 1; min-width: 0;
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .result-title .rating-tag,
    .result-title .platform-tag,
    .result-title .quality-tag { display: none; }
    .result-title .source-tag { 
        flex-shrink: 0;
        font-size: 10px; padding: 2px 6px; border-radius: 4px;
        background: rgba(249,115,22,0.1); color: var(--primary);
    }
    
    /* 第2行：只显示主演（隐藏导演） */
    .result-meta { font-size: 11px; }
    .result-meta span:first-child { display: none; } /* 隐藏导演 */
    .result-meta span:last-child { 
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    
    /* 第3行：介绍2行 */
    .result-desc { font-size: 12px; -webkit-line-clamp: 2; line-clamp: 2; margin-bottom: 2px; }
    
    /* 底部标签只显示1行 */
    .result-tags { 
        gap: 4px; max-height: 22px; overflow: hidden;
        flex-wrap: nowrap;
    }
    .result-tag { font-size: 10px; padding: 2px 6px; flex-shrink: 0; }
    /* 手机端只显示：年份+集数+类型+平台 */
    .result-tag.tag-rating,
    .result-tag.tag-source,
    .result-tag.tag-region,
    .result-tag.tag-extra { display: none; }
    .result-tag.tag-quality { display: inline-block; background: rgba(34,197,94,0.1); color: #16a34a; }
    .result-tag.tag-year { display: inline-block; }
    .result-tag.tag-type { display: inline-block; }
    .result-tag.tag-platform { display: inline-block; background: rgba(14,165,233,0.1); color: #0284c7; }
}
@media (max-width: 480px) {
    .movie-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .movie-info { padding: 8px 8px 10px; }
    .movie-name { font-size: 13px; }
}

/* ===== Back to Top ===== */
.back-top {
    position: fixed; bottom: 24px; right: 24px;
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--primary); color: #fff;
    border: none; cursor: pointer;
    box-shadow: 0 4px 12px rgba(249,115,22,0.3);
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s; z-index: 100;
}
.back-top:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(249,115,22,0.4); }
.back-top svg { width: 20px; height: 20px; }

/* ===== Fade transitions ===== */
.fade-enter-active, .fade-leave-active { transition: opacity 0.3s; }
.fade-enter-from, .fade-leave-to { opacity: 0; }

/* ===== Nav History ===== */
.nav-history {
    width: 36px; height: 36px; border-radius: 50%;
    background: transparent; border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s; flex-shrink: 0;
}
.nav-history:hover { background: rgba(0,0,0,0.05); }
.nav-history svg { width: 20px; height: 20px; stroke: var(--text-secondary); }

/* ===== History Modal ===== */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4); z-index: 200;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(4px);
}
.modal-box {
    background: #fff; border-radius: var(--radius); width: 90%; max-width: 520px;
    max-height: 60vh; display: flex; flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; font-weight: 600; color: var(--text); }
.modal-close {
    width: 32px; height: 32px; border-radius: 50%; border: none;
    background: rgba(0,0,0,0.04); color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s;
}
.modal-close:hover { background: rgba(0,0,0,0.08); }
.modal-close svg { width: 16px; height: 16px; }
.modal-body { flex: 1; overflow-y: auto; padding: 12px 20px; }
.modal-empty {
    text-align: center; padding: 40px 0; color: var(--text-muted); font-size: 14px;
}
.history-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px; border-radius: var(--radius-sm);
    cursor: pointer; transition: all 0.2s; margin-bottom: 4px;
}
.history-item:hover { background: rgba(0,0,0,0.03); }
.history-info { flex: 1; min-width: 0; }
.history-title {
    display: flex; align-items: center; gap: 6px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    font-size: 14px;
}
.history-title .h-name { font-weight: 500; color: var(--text); flex-shrink: 0; max-width: 60%; overflow: hidden; text-overflow: ellipsis; }
.history-title .h-ep { color: var(--primary); overflow: hidden; text-overflow: ellipsis; }
.history-meta {
    font-size: 11px; color: var(--text-muted); margin-top: 4px;
    display: flex; gap: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.history-progress {
    width: 100%; height: 3px; background: var(--border);
    border-radius: 2px; margin-top: 6px; overflow: hidden;
}
.history-progress-bar {
    height: 100%; background: var(--primary); border-radius: 2px;
}
.history-del {
    width: 28px; height: 28px; border-radius: 50%; border: none;
    background: transparent; color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s; flex-shrink: 0;
}
.history-del:hover { background: rgba(239,68,68,0.1); color: #ef4444; }
.history-del svg { width: 14px; height: 14px; }
.modal-footer {
    padding: 12px 20px; border-top: 1px solid var(--border);
    text-align: center;
}
.modal-footer button {
    padding: 6px 20px; border-radius: 16px; border: none;
    background: rgba(239,68,68,0.1); color: #ef4444;
    font-size: 13px; cursor: pointer; transition: all 0.2s;
}
.modal-footer button:hover { background: rgba(239,68,68,0.15); }
