* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb, rgba(128, 128, 128, 0.3));
    border-radius: 100px;
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover, rgba(128, 128, 128, 0.5));
    background-clip: content-box;
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* ===== Light Mode (Default) ===== */
:root {
    /* Apple System Colors - Light Mode */
    --system-bg: #F2F2F7;
    --system-grouped-bg: #FFFFFF;
    --card-bg: #FFFFFF;
    --card-bg-elevated: #F9F9F9;

    /* Semantic Materials - Light */
    --material-sidebar: rgba(255, 255, 255, 0.85);
    --material-header: rgba(242, 242, 247, 0.9);
    --material-thick: rgba(255, 255, 255, 0.9);

    /* System Labels - Light */
    --label-primary: #000000;
    --label-secondary: rgba(60, 60, 67, 0.6);
    --label-tertiary: rgba(60, 60, 67, 0.3);
    --label-quaternary: rgba(60, 60, 67, 0.18);

    /* System Tints - Light (slightly darker for contrast) */
    --tint-blue: #007AFF;
    --tint-green: #34C759;
    --tint-orange: #FF9500;
    --tint-red: #FF3B30;
    --tint-purple: #AF52DE;
    --tint-pink: #FF2D55;
    --tint-indigo: #5856D6;
    --tint-teal: #5AC8FA;

    /* Separators - Light */
    --separator: rgba(60, 60, 67, 0.29);
    --separator-trace: rgba(60, 60, 67, 0.12);

    /* Scrollbar - Light */
    --scrollbar-thumb: rgba(0, 0, 0, 0.15);
    --scrollbar-thumb-hover: rgba(0, 0, 0, 0.25);

    /* Metrics */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;

    --header-height: 60px;
    --sidebar-width: 260px;

    --transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

/* ===== Dark Mode ===== */
@media (prefers-color-scheme: dark) {
    :root {
        /* Apple System Colors - Dark Mode */
        --system-bg: #000000;
        --system-grouped-bg: #000000;
        --card-bg: #1c1c1e;
        --card-bg-elevated: #2c2c2e;

        /* Semantic Materials - Dark */
        --material-sidebar: rgba(30, 30, 30, 0.7);
        --material-header: rgba(0, 0, 0, 0.6);
        --material-thick: rgba(40, 40, 40, 0.5);

        /* System Labels - Dark */
        --label-primary: #FFFFFF;
        --label-secondary: rgba(235, 235, 245, 0.6);
        --label-tertiary: rgba(235, 235, 245, 0.3);
        --label-quaternary: rgba(235, 235, 245, 0.18);

        /* System Tints - Dark (brighter for visibility) */
        --tint-blue: #0A84FF;
        --tint-green: #30D158;
        --tint-orange: #FF9F0A;
        --tint-red: #FF453A;
        --tint-purple: #BF5AF2;
        --tint-pink: #FF375F;
        --tint-indigo: #5E5CE6;
        --tint-teal: #64D2FF;

        /* Separators - Dark */
        --separator: rgba(84, 84, 88, 0.65);
        --separator-trace: rgba(255, 255, 255, 0.1);

        /* Scrollbar - Dark */
        --scrollbar-thumb: rgba(255, 255, 255, 0.15);
        --scrollbar-thumb-hover: rgba(255, 255, 255, 0.25);
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background: var(--system-bg);
    color: var(--label-primary);
    min-height: 100vh;
    line-height: 1.5;
    font-size: 15px;
    /* iOS Human Interface Guidelines body size */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

#app {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Sidebar - macOS source list style */
.sidebar {
    width: var(--sidebar-width);
    background: var(--material-sidebar);
    backdrop-filter: blur(50px) saturate(180%);
    -webkit-backdrop-filter: blur(50px) saturate(180%);
    border-right: 0.5px solid var(--separator-trace);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    /* iOS slide over curve */
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

.logo {
    padding: 24px 24px 16px;
    /* Optimized spacing */
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 24px;
    height: 24px;
    color: var(--tint-blue);
    filter: drop-shadow(0 0 8px rgba(10, 132, 255, 0.4));
}

.logo-text {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.4px;
    background: linear-gradient(135deg, #fff 0%, #ddd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav {
    flex: 1;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--label-secondary);
    text-decoration: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--label-primary);
}

.nav-item.active {
    background: rgba(10, 132, 255, 0.15);
    /* iOS selection style */
    color: var(--tint-blue);
}

.nav-icon-svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
    /* Thicker iOS style strokes */
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px 24px;
    border-top: 0.5px solid var(--separator-trace);
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--label-tertiary);
    font-size: 13px;
    font-weight: 500;
}

.status-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--tint-red);
    box-shadow: 0 0 6px var(--tint-red);
}

.status-indicator.online {
    background: var(--tint-green);
    box-shadow: 0 0 6px var(--tint-green);
}

/* Mobile Overlay */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 900;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mobile-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

/* Main */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 32px 40px;
    min-height: 100vh;
    transition: margin-left 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    position: sticky;
    top: 0;
    z-index: 100;
    margin-top: -32px;
    padding-top: 32px;
    padding-bottom: 16px;
    background: linear-gradient(to bottom, var(--system-bg) 80%, rgba(0, 0, 0, 0) 100%);
    backdrop-filter: blur(10px);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    display: none;
    /* Mobile only */
    background: none;
    border: none;
    color: var(--tint-blue);
    padding: 8px;
    margin-left: -8px;
    cursor: pointer;
}

.page-title {
    font-size: 34px;
    /* iOS Large Title */
    font-weight: 700;
    letter-spacing: 0.3px;
    color: var(--label-primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.update-time {
    color: var(--label-tertiary);
    font-size: 13px;
    font-feature-settings: "tnum";
}

/* Report Layout */
.report-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
    height: calc(100vh - 140px);
}

.series-selector {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    /* No border, use shadow/bg diff */
    overflow-y: auto;
    padding: 12px;
}

.series-selector-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 8px;
    position: relative;
    overflow: hidden;
}

.series-selector-item:hover {
    background: var(--card-bg-elevated);
}

.series-selector-item.active {
    background: var(--card-bg-elevated);
}

.series-selector-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 3px;
    background: var(--tint-blue);
    border-radius: 0 4px 4px 0;
}

.series-selector-cover {
    width: 44px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.series-selector-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.series-selector-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--label-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.series-selector-meta {
    font-size: 12px;
    color: var(--label-secondary);
}

/* Report Area */
.report-area {
    overflow-y: auto;
    padding-right: 4px;
    /* Scrollbar space */
}

.report-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.report-stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 20px 16px;
    text-align: left;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    transition: transform 0.2s ease;
}

.report-stat-card:hover {
    transform: translateY(-2px);
    background: var(--card-bg-elevated);
}

.report-stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--label-primary);
    font-feature-settings: "tnum";
    letter-spacing: -0.5px;
}

.report-stat-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--label-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Chart Section */
.report-chart-section {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--label-primary);
}

.section-badge {
    background: var(--card-bg-elevated);
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    color: var(--label-secondary);
}

/* Time Range Selector */
.time-range-selector {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 8px;
    /* Compact padding */
    margin-bottom: 24px;
}

.time-range-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--label-secondary);
    margin-left: 12px;
}

.time-range-buttons {
    display: flex;
    background: var(--system-bg);
    /* Segmented Control style */
    padding: 3px;
    border-radius: 10px;
}

.time-btn {
    padding: 6px 16px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    background: transparent;
    color: var(--label-secondary);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.time-btn:hover {
    color: var(--label-primary);
}

.time-btn.active {
    background: var(--card-bg-elevated);
    color: var(--label-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 4 Charts Grid */
.charts-grid-4 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.chart-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.chart-card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 20px 24px 0;
}

.chart-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--label-secondary);
}

.chart-value {
    font-size: 28px;
    font-weight: 700;
    font-family: "SF Pro Display", sans-serif;
    letter-spacing: -0.5px;
}

.chart-value-blue {
    color: var(--tint-blue);
}

.chart-value-green {
    color: var(--tint-green);
}

.chart-value-orange {
    color: var(--tint-orange);
}

.chart-value-purple {
    color: var(--tint-purple);
}

.mini-chart {
    height: 180px;
}

.episode-chart {
    height: 240px;
}

/* Episodes Table */
.report-episodes-section {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 0;
    /* Flush style */
    margin-bottom: 24px;
    overflow: hidden;
}

.report-episodes-section .section-header {
    padding: 20px 24px;
    margin-bottom: 0;
    border-bottom: 0.5px solid var(--separator-trace);
}

.episodes-table-wrapper {
    max-height: 400px;
    overflow-y: auto;
}

.episodes-table {
    width: 100%;
    border-collapse: collapse;
}

.episodes-table th,
.episodes-table td {
    padding: 14px 24px;
    text-align: left;
    font-size: 14px;
}

.episodes-table th {
    position: sticky;
    top: 0;
    background: var(--card-bg);
    /* Opaque for sticking */
    color: var(--label-secondary);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 0.5px solid var(--separator-trace);
    z-index: 10;
}

.episodes-table td {
    border-bottom: 0.5px solid var(--separator-trace);
    color: var(--label-primary);
}

.episodes-table tbody tr:last-child td {
    border-bottom: none;
}

.episodes-table tbody tr:hover {
    background: var(--card-bg-elevated);
}

.ep-index {
    font-weight: 600;
    color: var(--tint-blue);
    font-variant-numeric: tabular-nums;
}

.download-panel {
    margin-top: 16px;
    padding: 16px;
    background: var(--system-bg);
    border-radius: var(--radius-md);
    font-size: 13px;
    border: 0.5px solid var(--separator-trace);
}

.download-panel span {
    color: var(--label-secondary);
    display: block;
    margin-bottom: 8px;
}

.download-panel a {
    color: var(--tint-blue);
    word-break: break-all;
    text-decoration: none;
}

/* Card General */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 0.5px solid var(--separator-trace);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 17px;
    font-weight: 600;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    font-family: inherit;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-icon {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: var(--blue);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    filter: brightness(1.1);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 0.5px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-elevated);
}

.btn-text {
    background: transparent;
    color: var(--blue);
    padding: 6px 12px;
}

.btn-text:hover {
    background: rgba(10, 132, 255, 0.1);
}

.btn-text-danger {
    color: var(--red);
}

.btn-text-danger:hover {
    background: rgba(255, 69, 58, 0.1);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 14px 20px;
    text-align: left;
}

.data-table th {
    color: var(--text-tertiary);
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 0.5px solid var(--border);
}

.data-table td {
    font-size: 14px;
    border-bottom: 0.5px solid var(--divider);
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.cover-img {
    width: 48px;
    height: 64px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.cover-placeholder {
    width: 48px;
    height: 64px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.title-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-badge.active {
    background: rgba(48, 209, 88, 0.12);
    color: var(--green);
}

.status-badge.inactive {
    background: rgba(255, 69, 58, 0.12);
    color: var(--red);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 480px;
    border: 1px solid var(--separator-trace);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalIn 0.25s ease;
}

.modal-lg {
    max-width: 680px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.96);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 0.5px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: 17px;
    font-weight: 600;
}

.modal-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.modal-close svg {
    width: 14px;
    height: 14px;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 0.5px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

/* Add Subscription Modal */
.add-search-section {
    margin-bottom: 20px;
}

.search-box-inline {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.search-input {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
}

.search-input:focus {
    outline: none;
    border-color: var(--blue);
}

.search-input::placeholder {
    color: var(--text-tertiary);
}

.search-results-grid {
    max-height: 300px;
    overflow-y: auto;
}

.search-result-card {
    display: flex;
    gap: 14px;
    padding: 14px;
    border-radius: var(--radius-md);
    transition: var(--transition);
    cursor: pointer;
    align-items: flex-start;
}

.search-result-card:hover {
    background: rgba(255, 255, 255, 0.03);
}

.search-result-cover {
    width: 56px;
    height: 76px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.search-result-placeholder {
    width: 56px;
    height: 76px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-info h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result-meta {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 6px;
}

.search-result-desc {
    font-size: 12px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.section-divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.section-divider::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 0.5px;
    background: var(--border);
}

.section-divider span {
    background: var(--bg-secondary);
    padding: 0 16px;
    color: var(--text-tertiary);
    font-size: 12px;
    position: relative;
}

.add-manual-section {
    padding-top: 0;
}

.form-row {
    display: flex;
    gap: 16px;
}

.flex-1 {
    flex: 1;
}

.form-group {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--blue);
}

.input-with-suffix {
    position: relative;
}

.input-with-suffix .form-input {
    padding-right: 50px;
}

.input-suffix {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: 13px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    animation: toastIn 0.3s ease;
    z-index: 2000;
}

.toast.success {
    background: var(--green);
    color: white;
}

.toast.error {
    background: var(--red);
    color: white;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.loading,
.empty-state {
    text-align: center;
    padding: 60px;
    color: var(--text-tertiary);
    font-size: 14px;
}

code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-family: 'SF Mono', Menlo, monospace;
}

/* Mobile Design - iOS Guidelines */
@media (max-width: 1200px) {
    .report-stats {
        grid-template-columns: repeat(3, 1fr);
    }

    .report-layout {
        grid-template-columns: 200px 1fr;
    }
}

@media (max-width: 900px) {
    .report-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .series-selector {
        display: flex;
        overflow-x: auto;
        padding: 12px;
        scroll-snap-type: x mandatory;
        background: var(--card-bg);
    }

    .series-selector-item {
        flex-shrink: 0;
        margin-bottom: 0;
        margin-right: 12px;
        scroll-snap-align: start;
        width: 200px;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
    }

    /* Sidebar as Drawer */
    .sidebar {
        width: 280px;
        /* Standard iOS Drawer width */
        transform: translateX(-100%);
        box-shadow: none;
        /* Shadow handled by backdrop usually, or add specifics */
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 50px 0 100px rgba(0, 0, 0, 0.5);
    }

    /* Main Content */
    .main-content {
        margin-left: 0;
        padding: 20px;
        width: 100%;
    }

    /* Header */
    .header {
        margin-bottom: 24px;
        padding-top: env(safe-area-inset-top);
    }

    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        /* Minimum touch target */
        height: 44px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 50%;
        color: var(--label-primary);
        margin-right: 8px;
    }

    .page-title {
        font-size: 22px;
    }

    /* Grids */
    .report-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .report-stat-card {
        padding: 16px;
    }

    .report-stat-value {
        font-size: 20px;
    }

    .charts-grid-4 {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Time Range */
    .time-range-selector {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .time-range-label {
        margin-left: 4px;
    }

    .time-range-buttons {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
    }

    .time-btn {
        padding: 6px 0;
        justify-content: center;
        display: flex;
    }

    /* Hide less important columns in table */
    .episodes-table th:nth-child(2),
    /* Duration */
    .episodes-table td:nth-child(2),
    .episodes-table th:nth-child(4),
    /* Comments */
    .episodes-table td:nth-child(4) {
        display: none;
    }

    /* Modal */
    .modal {
        width: 100%;
        height: 100%;
        /* Full screen modal on mobile */
        max-width: none;
        max-height: none;
        border-radius: 0;
    }

    .modal-lg {
        height: 100%;
    }

    /* Episode Chart - Mobile */
    .episode-chart {
        height: 280px;
        margin-left: -10px;
        margin-right: -10px;
    }

    .report-chart-section {
        padding: 16px;
        margin-bottom: 16px;
    }

    /* Report Area */
    .report-area {
        padding-bottom: 40px;
    }

    /* Subscription Management - Mobile */
    .card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .card-header h3 {
        font-size: 15px;
    }

    .card-header .btn {
        width: 100%;
        justify-content: center;
    }

    /* Data Table Mobile */
    .data-table th,
    .data-table td {
        padding: 10px 12px;
        font-size: 12px;
    }

    /* Hide less important columns */
    .data-table th:nth-child(4),
    /* 间隔 */
    .data-table td:nth-child(4),
    .data-table th:nth-child(5),
    /* 更新时间 */
    .data-table td:nth-child(5) {
        display: none;
    }

    .cover-img,
    .cover-placeholder {
        width: 36px;
        height: 48px;
    }

    .title-cell {
        max-width: 100px;
        font-size: 13px;
    }

    .status-badge {
        font-size: 9px;
        padding: 3px 6px;
    }

    /* Action buttons stack vertically */
    .data-table td:last-child {
        white-space: nowrap;
    }

    .data-table td:last-child .btn {
        padding: 4px 8px;
        font-size: 11px;
    }
}