*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --text: #1d1d1f;
    --text-secondary: #86868b;
    --text-tertiary: #aeaeb2;
    --accent: #0ea5e9;
    --accent-hover: #0284c7;
    --accent-subtle: rgba(14, 165, 233, 0.06);
    --border: #d2d2d7;
    --border-light: #e8e8ed;
    --bg: #ffffff;
    --bg-section: #f5f5f7;
    --radius: 12px;
    --radius-sm: 8px;
    --overlay: rgba(0,0,0,0.02);
    --card-bg: #ffffff;
    --card-shadow: rgba(0,0,0,0.06);
    --footer-bg: #f5f5f7;
}

[data-theme="dark"] {
    --text: #f5f5f7;
    --text-secondary: #98989d;
    --text-tertiary: #6e6e73;
    --border: #424245;
    --border-light: #2c2c2e;
    --bg: #1c1c1e;
    --bg-section: #2c2c2e;
    --overlay: rgba(255,255,255,0.05);
    --card-bg: #2c2c2e;
    --card-shadow: rgba(0,0,0,0.3);
    --footer-bg: #1c1c1e;
    --accent-subtle: rgba(14, 165, 233, 0.12);
}

html {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "Noto Sans SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.47059;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background 0.3s ease, color 0.3s ease;
}

::selection {
    background: rgba(14, 165, 233, 0.2);
    color: var(--text);
}

/* ===== Catalog page layout (sticky footer) ===== */
.page-catalog {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg);
    transition: background 0.3s ease;
}

.main {
    flex: 1;
    max-width: 980px;
    margin: 0 auto;
    padding: 0 22px 40px;
    width: 100%;
}

.hero {
    text-align: center;
    padding: 64px 0 44px;
    position: relative;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.2;
    border-radius: 1px;
}

.hero-title {
    font-size: 48px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text);
    margin-bottom: 10px;
    transition: color 0.3s ease;
}

.hero-desc {
    font-size: 17px;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 0.3px;
    transition: color 0.3s ease;
}

/* ==============================
   Section
   ============================== */

.section {
    padding: 32px 0 40px;
}

.section-heading {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.1px;
    color: var(--text);
    margin-bottom: 20px;
    padding-left: 2px;
    transition: color 0.3s ease;
}

/* ==============================
   Grid
   ============================== */

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 18px;
}

.grid-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 20px;
    color: var(--text-secondary);
    font-size: 14px;
    transition: color 0.3s ease;
}

/* ==============================
   Skeleton Loading
   ============================== */

.skeleton {
    pointer-events: none;
    overflow: hidden;
}

.skeleton-card {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    overflow: hidden;
}

.skeleton-visual {
    height: 140px;
    background: var(--bg-section);
    border-bottom: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.skeleton-body {
    padding: 16px 18px 18px;
}

.skeleton-line {
    height: 12px;
    background: var(--bg-section);
    border-radius: 6px;
    margin-bottom: 8px;
    position: relative;
    overflow: hidden;
}

.skeleton-line:last-child {
    width: 40%;
    margin-bottom: 0;
}

.skeleton-shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255,255,255,0.4) 50%,
        transparent 100%);
    animation: shimmer 1.5s ease-in-out infinite;
}

[data-theme="dark"] .skeleton-shimmer {
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255,255,255,0.06) 50%,
        transparent 100%);
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.skeleton-card { animation: skeletonFade 1.5s ease-in-out infinite; }

@keyframes skeletonFade {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ==============================
   Card  (Apple product-card style)
   ============================== */

.card {
    display: block;
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    overflow: hidden;
    animation: cardIn 0.5s ease both;
}

.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }

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

.card:hover {
    border-color: rgba(14, 165, 233, 0.2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

/* Visual area (like Apple's product photo) */
.card-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 140px;
    background: radial-gradient(ellipse at 30% 40%, rgba(14, 165, 233, 0.06) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 60%, rgba(14, 165, 233, 0.04) 0%, transparent 50%),
                var(--bg-section);
    border-bottom: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.card-visual.has-thumb {
    background: #000;
}

.card-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.card:hover .card-thumb {
    transform: scale(1.03);
}

.card-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    padding: 2px 8px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.3px;
}

.card-visual-inner {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    border-radius: 14px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
    font-size: 16px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.3px;
    transition: background 0.3s ease;
}

.card:hover .card-visual-inner {
    box-shadow: 0 2px 12px rgba(14, 165, 233, 0.12);
}

/* Body */
.card-body {
    padding: 16px 18px 18px;
}

.card-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    letter-spacing: -0.2px;
    transition: color 0.3s ease;
}

.card-desc {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.card-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.2px;
    transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.card:hover .card-link {
    gap: 8px;
}

.card-link svg {
    transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.card:hover .card-link svg {
    transform: translateX(3px);
}

/* ==============================
   Footer
   ============================== */

.footer {
    background: var(--footer-bg);
    border-top: 1px solid var(--border-light);
    transition: background 0.3s ease;
}

.footer-inner {
    max-width: 980px;
    margin: 0 auto;
    padding: 20px 22px 24px;
    text-align: center;
}

.footer-copy {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.1px;
    transition: color 0.3s ease;
}

.footer-contact {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px 10px;
    transition: color 0.3s ease;
}

.footer-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    position: relative;
}

.footer-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.25s ease;
}

.footer-link:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.footer-link:hover {
    color: var(--accent-hover);
    text-decoration: none;
}

.footer-link--red {
    color: #ff2442;
}

.footer-link--red::after {
    background: #ff2442;
}

.footer-link--red:hover {
    color: #d41b36;
}

.footer-link--douyin {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    background: #010101;
    color: #fff;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s ease;
    letter-spacing: 0.5px;
}

.footer-link--douyin:hover {
    color: #fff;
    opacity: 0.8;
}

.footer-link--douyin::after {
    display: none;
}

/* ==============================
   Dark Mode Toggle (floating)
   ============================== */

.theme-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-light);
    background: var(--card-bg);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 12px var(--card-shadow);
}

.theme-toggle:hover {
    border-color: var(--border);
    color: var(--accent);
    transform: scale(1.05);
}

.theme-toggle:active {
    transform: scale(0.95);
}

/* ==============================
   Player (Apple TV+ style)
   ============================== */

.page-player {
    background: #000;
    overflow: hidden;
}

.player-root {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Top bar */
.player-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
    background: linear-gradient(180deg, rgba(0,0,0,0.5) 0%, transparent 100%);
    transition: opacity 0.6s ease, transform 0.6s ease;
    min-height: 44px;
}

.player-bottom {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
    background: linear-gradient(0deg, rgba(0,0,0,0.5) 0%, transparent 100%);
    transition: opacity 0.6s ease, transform 0.6s ease;
    min-height: 40px;
}

.cinema .player-top {
    opacity: 0;
    transform: translateY(-100%);
}

.cinema .player-bottom {
    opacity: 0;
    transform: translateY(100%);
}

.player-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    border-radius: 50%;
    transition: color 0.2s ease, background 0.2s ease;
}

.player-back:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.player-back svg {
    transition: transform 0.2s ease;
}

.player-back:hover svg {
    transform: translateX(-1px);
}

/* Video */
.video-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    background: #000;
}

.video-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, transparent 15%, transparent 85%, rgba(0,0,0,0.3) 100%);
    pointer-events: none;
    z-index: 2;
    transition: opacity 0.5s ease;
}

.video-wrapper.playing::after { opacity: 0; }
.video-wrapper:hover::after { opacity: 0.4; }
.cinema .video-wrapper::after { opacity: 0.7 !important; }

#videoPlayer {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: transparent;
    position: relative;
    z-index: 0;
}

#videoPlayer::-webkit-media-controls-panel {
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.6) 100%);
}

#videoPlayer::-webkit-media-controls-timeline { filter: brightness(1.15); }
#videoPlayer::-webkit-media-controls-volume-slider { filter: brightness(1.15); }

/* Bottom info */
.player-info {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==============================
   Download Button / Dropdown
   ============================== */

.download-group {
    position: relative;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: none;
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.download-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.download-btn:active {
    transform: scale(0.97);
}

.download-btn svg {
    transition: transform 0.2s ease;
}

.download-btn:hover svg {
    transform: translateY(1px);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 230px;
    background: rgba(28, 28, 30, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all 0.2s ease;
    z-index: 200;
    transform-origin: top right;
}

.dropdown-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 10px 14px 2px;
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 0.8px;
}

.dropdown-list {
    padding: 2px 4px 8px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.06);
    padding-left: 14px;
}

.dropdown-item svg {
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.25);
    transition: color 0.15s ease;
}

.dropdown-item:hover svg {
    color: var(--accent);
}

.dropdown-item .file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.dropdown-item .file-size {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.25);
    flex-shrink: 0;
}

.dropdown-empty {
    padding: 18px 14px;
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.3);
}

.dropdown-item--video {
    margin: 4px;
    color: var(--accent) !important;
}

.dropdown-item--video svg {
    color: var(--accent) !important;
}

.dropdown-item--video:hover {
    background: rgba(14, 165, 233, 0.12);
}

.dropdown-divider {
    height: 1px;
    margin: 4px 12px;
    background: rgba(255, 255, 255, 0.06);
}

/* ==============================
   Player Error
   ============================== */

.player-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.45);
    font-size: 14px;
}

.player-error .back-home {
    color: var(--accent);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 5px 14px;
    border: 1px solid rgba(14, 165, 233, 0.25);
    border-radius: 20px;
    transition: all 0.2s ease;
}

.player-error .back-home:hover {
    background: var(--accent);
    color: #fff;
}

/* ==============================
   Scrollbar
   ============================== */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(14, 165, 233, 0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(14, 165, 233, 0.25); }

/* ==============================
   Animations
   ============================== */

.hero { animation: fadeInUp 0.6s cubic-bezier(0.25, 0.1, 0.25, 1) 0.1s both; }
.section { animation: fadeInUp 0.6s cubic-bezier(0.25, 0.1, 0.25, 1) 0.15s both; }
.footer { animation: fadeIn 0.5s ease 0.3s both; }

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