/* ============================================================
   SURGENA — Frontend Design System
   商用レベル・プレミアム・モダンダークテーマ
   ============================================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&family=Poppins:wght@500;600;700&display=swap');

/* ============================================================
   1. CSS Custom Properties (Design Tokens)
   ============================================================ */
:root {
    /* Typography */
    --font-body: 'Lato', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Poppins', 'Noto Sans JP', sans-serif;

    /* Layout */
    --header-height: 56px;
    --nav-height: 40px;
    --sidebar-width: 56px;
    --sidebar-expanded-width: 220px;

    /* Grid columns (overridden by admin settings via inline style) */
    --grid-cols-pc: 4;
    --grid-cols-mobile: 2;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Shadows */
    --shadow-card: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-card-hover: 0 4px 16px rgba(0,0,0,0.5);
    --shadow-dropdown: 0 4px 24px rgba(0,0,0,0.4);

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

/* ── Dark Theme (Default) ── */
html[data-theme="dark"],
html:not([data-theme]) {
    --bg-page: #0f0f0f;
    --bg-surface: #1a1a1a;
    --bg-card: #212121;
    --bg-card-hover: #2a2a2a;
    --bg-elevated: #282828;
    --bg-header: rgba(15, 15, 15, 0.97);
    --bg-sidebar: #0f0f0f;
    --bg-overlay: rgba(0, 0, 0, 0.7);

    --text-primary: #f1f1f1;
    --text-secondary: #aaaaaa;
    --text-tertiary: #717171;
    --text-inverse: #0f0f0f;

    --accent: #3ea6ff;
    --accent-hover: #65b8ff;
    --accent-subtle: rgba(62, 166, 255, 0.12);

    --border-primary: #303030;
    --border-subtle: #272727;

    --badge-bg: rgba(0, 0, 0, 0.6);
    --badge-text: #fff;

    --search-bg: #121212;
    --search-border: #303030;
    --search-focus-border: var(--accent);

    --scrollbar-bg: transparent;
    --scrollbar-thumb: #404040;
    --scrollbar-thumb-hover: #555;
}

/* ── Light Theme ── */
html[data-theme="light"] {
    --bg-page: #f9f9f9;
    --bg-surface: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f2f2f2;
    --bg-elevated: #ffffff;
    --bg-header: rgba(255, 255, 255, 0.97);
    --bg-sidebar: #ffffff;
    --bg-overlay: rgba(0, 0, 0, 0.5);

    --text-primary: #0f0f0f;
    --text-secondary: #606060;
    --text-tertiary: #909090;
    --text-inverse: #ffffff;

    --accent: #065fd4;
    --accent-hover: #0356b8;
    --accent-subtle: rgba(6, 95, 212, 0.08);

    --border-primary: #e5e5e5;
    --border-subtle: #f0f0f0;

    --badge-bg: rgba(0, 0, 0, 0.6);
    --badge-text: #fff;

    --search-bg: #f0f0f0;
    --search-border: #d9d9d9;
    --search-focus-border: var(--accent);

    --scrollbar-bg: transparent;
    --scrollbar-thumb: #c0c0c0;
    --scrollbar-thumb-hover: #a0a0a0;

    --shadow-card: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-card-hover: 0 4px 16px rgba(0,0,0,0.12);
    --shadow-dropdown: 0 4px 24px rgba(0,0,0,0.12);
}

/* ============================================================
   2. Base Styles
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-page);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}

img {
    max-width: 100%;
    height: auto;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--scrollbar-bg);
}
::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* ============================================================
   3. Header
   ============================================================ */
.surgena-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--header-height);
    background: var(--bg-header);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    padding: 0 16px;
    transition: transform var(--transition-normal);
}

.surgena-header.header-hidden {
    transform: translateY(-100%);
}
.surgena-header.header-hidden + .surgena-nav {
    top: 0;
}

/* Offset content when nav bar is present */
body.has-nav .surgena-main {
    margin-top: calc(var(--header-height) + var(--nav-height));
    min-height: calc(100vh - var(--header-height) - var(--nav-height));
}
body.has-nav .surgena-sidebar {
    top: calc(var(--header-height) + var(--nav-height));
}

/* Navigation bar below header */
.surgena-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    z-index: 999;
    height: var(--nav-height, 40px);
    background: var(--bg-secondary, rgba(0,0,0,0.3));
    border-bottom: 1px solid var(--border-subtle);
    transition: top var(--transition-normal);
    overflow: visible;
}
.surgena-nav__inner {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 2px;
    padding: 0 16px;
    max-width: 1600px;
    margin: 0 auto;
    overflow-x: auto;
    scrollbar-width: none;
}
.surgena-nav__inner::-webkit-scrollbar { display: none; }
.surgena-nav__link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    white-space: nowrap;
    border-radius: 4px;
    border: none;
    background: none;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
}
.surgena-nav__link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

/* Dropdown */
.surgena-nav__dropdown {
    position: relative;
}
.surgena-nav__chevron {
    font-size: 10px;
    transition: transform 0.2s;
}
.surgena-nav__dropdown.open .surgena-nav__chevron {
    transform: rotate(180deg);
}
.surgena-nav__dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    padding: 6px 0;
    background: var(--bg-elevated, var(--surface));
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    z-index: 1010;
}
.surgena-nav__dropdown.open .surgena-nav__dropdown-menu {
    display: block;
}
.surgena-nav__dropdown-item {
    display: block;
    padding: 8px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.surgena-nav__dropdown-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.surgena-header__start {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 200px;
}

.surgena-header__menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    transition: background var(--transition-fast);
}

.surgena-header__menu-btn:hover {
    background: var(--accent-subtle);
}

.surgena-header__logo {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    letter-spacing: -0.5px;
}

.surgena-header__logo img {
    height: 24px;
    width: auto;
}

/* テーマ別ロゴの出し分け (両方DOMに存在し、CSSで表示切替) */
html[data-theme="light"] .surgena-header__logo-img--dark { display: none; }
html[data-theme="dark"]  .surgena-header__logo-img--light { display: none; }
/* data-theme未指定時(初期表示の一瞬) はライトを優先 */
html:not([data-theme]) .surgena-header__logo-img--dark { display: none; }

.surgena-header__center {
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 640px;
    margin: 0 auto;
}

.surgena-search {
    display: flex;
    width: 100%;
    max-width: 640px;
}

.surgena-search__input {
    flex: 1;
    height: 40px;
    padding: 0 16px;
    background: var(--search-bg);
    border: 1px solid var(--search-border);
    border-right: none;
    border-radius: 20px 0 0 20px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-body);
    outline: none;
    transition: border-color var(--transition-fast);
}

.surgena-search__input::placeholder {
    color: var(--text-tertiary);
}

.surgena-search__input:focus {
    border-color: var(--search-focus-border);
}

.surgena-search__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 40px;
    background: var(--bg-elevated);
    border: 1px solid var(--search-border);
    border-radius: 0 20px 20px 0;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 18px;
    transition: background var(--transition-fast);
}

.surgena-search__btn:hover {
    background: var(--bg-card-hover);
}

.surgena-header__end {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 200px;
    justify-content: flex-end;
}

.surgena-header__icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    transition: background var(--transition-fast);
    position: relative;
}

.surgena-header__icon-btn:hover {
    background: var(--accent-subtle);
}

.surgena-header__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: opacity var(--transition-fast);
}

.surgena-header__avatar:hover {
    opacity: 0.8;
}

/* ============================================================
   4. Sidebar (PC Collapsible Nav)
   ============================================================ */
.surgena-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    z-index: 900;
    display: flex;
    flex-direction: column;
    padding: 8px 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    transition: width var(--transition-normal);
    border-right: 1px solid var(--border-secondary, rgba(255,255,255,0.04));
}

.surgena-sidebar.expanded {
    width: var(--sidebar-expanded-width);
}

.surgena-sidebar::-webkit-scrollbar {
    display: none;
}

/* Toggle button — アイコンと同じ左位置に固定 */
.surgena-sidebar__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 0 0 4px 8px;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
    flex-shrink: 0;
}

.surgena-sidebar__toggle:hover {
    background: var(--accent-subtle);
    color: var(--text-primary);
}

/* Nav container */
.surgena-sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 4px;
}

/* Nav items — collapsed (icon only) */
.surgena-sidebar__item {
    display: flex;
    flex-direction: row;
    align-items: center;
    height: 44px;
    padding: 0 12px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
    text-decoration: none;
    border: none;
    background: transparent;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
    gap: 14px;
}

.surgena-sidebar__item:hover {
    background: var(--accent-subtle);
    color: var(--text-primary);
}

.surgena-sidebar__item.active {
    color: var(--text-primary);
    background: var(--accent-subtle);
}

.surgena-sidebar__item i {
    flex-shrink: 0;
    width: 24px;
    text-align: center;
    font-size: 18px;
}

/* Text label — hidden when collapsed */
.surgena-sidebar__text {
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font-body);
    opacity: 0;
    width: 0;
    overflow: hidden;
    transition: opacity var(--transition-fast), width var(--transition-normal);
}

.surgena-sidebar.expanded .surgena-sidebar__text {
    opacity: 1;
    width: auto;
}

/* Sidebar Divider */
.surgena-sidebar__divider {
    height: 1px;
    background: var(--border-secondary, rgba(255,255,255,0.06));
    margin: 6px 8px;
}

/* Sidebar Section Label */
.surgena-sidebar__section-label {
    display: flex;
    align-items: center;
    gap: 14px;
    height: 36px;
    padding: 0 12px;
    color: var(--text-tertiary);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
}

.surgena-sidebar__section-label i {
    flex-shrink: 0;
    width: 24px;
    text-align: center;
    font-size: 16px;
}

/* Sidebar Ranking Item */
.surgena-sidebar__rank-item {
    gap: 10px !important;
}

.surgena-sidebar__rank-num {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    background: var(--bg-elevated);
    color: var(--text-secondary);
}

.surgena-sidebar__rank-num.top {
    background: var(--accent);
    color: #fff;
}

/* Sidebar Dropdown (Video categories) */
.surgena-sidebar__dropdown {
    position: relative;
}

.surgena-sidebar__dropdown-toggle {
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.surgena-sidebar__arrow {
    font-size: 12px;
    margin-left: auto;
    opacity: 0;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
    flex-shrink: 0;
}

.surgena-sidebar.expanded .surgena-sidebar__arrow {
    opacity: 1;
}

.surgena-sidebar__dropdown.open .surgena-sidebar__arrow {
    transform: rotate(180deg);
}

/* Collapsed sidebar: dropdown opens as floating panel */
.surgena-sidebar:not(.expanded) .surgena-sidebar__dropdown-menu {
    position: absolute;
    left: calc(var(--sidebar-width) + 4px);
    top: 0;
    min-width: 200px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    z-index: 1000;
    display: none;
}

.surgena-sidebar:not(.expanded) .surgena-sidebar__dropdown.open .surgena-sidebar__dropdown-menu {
    display: block;
}

/* Expanded sidebar: dropdown opens inline */
.surgena-sidebar.expanded .surgena-sidebar__dropdown-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.surgena-sidebar.expanded .surgena-sidebar__dropdown.open .surgena-sidebar__dropdown-menu {
    max-height: 800px;
}

.surgena-sidebar__sub-item {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 36px;
    padding: 0 12px 0 24px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 13px;
    text-decoration: none;
    transition: background var(--transition-fast), color var(--transition-fast);
    white-space: nowrap;
    overflow: hidden;
}

.surgena-sidebar:not(.expanded) .surgena-sidebar__sub-item {
    padding: 0 12px;
}

.surgena-sidebar__sub-item i {
    flex-shrink: 0;
    width: 18px;
    text-align: center;
    font-size: 14px;
}

.surgena-sidebar__sub-item span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.surgena-sidebar__sub-item:hover {
    background: var(--accent-subtle);
    color: var(--text-primary);
}

.surgena-sidebar__sub-item.active {
    color: var(--accent);
    background: var(--accent-subtle);
    font-weight: 600;
}

/* ============================================================
   5. Mobile Menu (Offcanvas)
   ============================================================ */
.surgena-mobile-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.surgena-mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

.surgena-mobile-menu {
    position: fixed;
    top: 0;
    left: -280px;
    bottom: 0;
    width: 280px;
    background: var(--bg-surface);
    z-index: 1200;
    transition: left var(--transition-normal);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.surgena-mobile-menu.active {
    left: 0;
}

.surgena-mobile-menu__header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-primary);
    min-height: var(--header-height);
}

.surgena-mobile-menu__logo {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.surgena-mobile-menu__nav {
    flex: 1;
    padding: 8px 0;
}

.surgena-mobile-menu__link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 24px;
    color: var(--text-primary);
    font-size: 14px;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.surgena-mobile-menu__link:hover {
    background: var(--accent-subtle);
}

.surgena-mobile-menu__link.active {
    background: var(--accent-subtle);
    font-weight: 600;
}

.surgena-mobile-menu__link i {
    font-size: 20px;
    width: 24px;
    text-align: center;
    color: var(--text-secondary);
}

.surgena-mobile-menu__divider {
    height: 1px;
    background: var(--border-primary);
    margin: 8px 0;
}

/* Mobile Menu Dropdown (Video categories) */
.surgena-mobile-menu__dropdown-toggle {
    width: 100%;
    text-align: left;
    font-family: inherit;
    position: relative;
}

.surgena-mobile-menu__arrow {
    font-size: 12px;
    margin-left: auto;
    transition: transform var(--transition-fast);
}

.surgena-mobile-menu__dropdown.open .surgena-mobile-menu__arrow {
    transform: rotate(180deg);
}

.surgena-mobile-menu__dropdown-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: var(--bg-base, rgba(0,0,0,0.1));
}

.surgena-mobile-menu__dropdown.open .surgena-mobile-menu__dropdown-menu {
    max-height: 800px;
}

.surgena-mobile-menu__sub-link {
    padding-left: 48px !important;
    font-size: 13px;
}

.surgena-mobile-menu__sub-link i {
    font-size: 16px;
}

.surgena-mobile-menu__sub-link.active {
    color: var(--accent);
}

/* Theme Toggle */
.surgena-theme-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 14px;
    transition: background var(--transition-fast);
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}

.surgena-theme-toggle:hover {
    background: var(--accent-subtle);
}

.surgena-theme-toggle i {
    font-size: 20px;
    width: 24px;
    text-align: center;
    color: var(--text-secondary);
}

/* ============================================================
   6. Main Content Area
   ============================================================ */
.surgena-main {
    margin-top: var(--header-height);
    margin-left: var(--sidebar-width);
    min-height: calc(100vh - var(--header-height));
    padding: 16px 24px;
    transition: margin-left var(--transition-normal);
}

.sidebar-expanded .surgena-main {
    margin-left: var(--sidebar-expanded-width);
}

/* ============================================================
   7. Video Card (Core Component)
   ============================================================ */
.video-grid {
    display: grid;
    grid-template-columns: repeat(var(--grid-cols-pc), 1fr);
    gap: 16px;
}

.video-card {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    border-radius: var(--radius-lg);
    transition: transform var(--transition-fast);
}

.video-card:hover {
    transform: translateY(-2px);
}

.video-card__thumbnail {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: var(--thumbnail-radius, var(--radius-lg));
    overflow: hidden;
    background: var(--bg-card);
}

.video-card__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.video-card:hover .video-card__thumbnail img {
    transform: scale(1.03);
}

.video-card__duration {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: var(--badge-bg);
    color: var(--badge-text);
    font-size: 12px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    line-height: 1.3;
    letter-spacing: 0.3px;
}

.video-card__info {
    padding: 10px 4px 4px;
}

.video-card__title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.video-card__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-tertiary);
}

.video-card__meta .dot {
    width: 3px;
    height: 3px;
    background: var(--text-tertiary);
    border-radius: 50%;
}

/* Category badge on thumbnail (top-left) */
.video-card__category {
    position: absolute;
    top: 6px;
    left: 6px;
    background: var(--accent-subtle);
    background: color-mix(in srgb, var(--accent) 60%, transparent);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    z-index: 2;
    width: fit-content;
}

/* Access level badge on thumbnail (bottom-left) */
.access-badge {
    position: absolute !important;
    bottom: 6px !important;
    left: 6px !important;
    top: auto !important;
    right: auto !important;
    width: auto !important;
    max-width: fit-content;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    z-index: 2;
    backdrop-filter: blur(4px);
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.access-badge--paid {
    background: rgba(37, 99, 195, 0.6);
    color: #fff;
}

.access-badge--premium {
    background: rgba(194, 160, 10, 0.6);
    color: #fff;
}

/* ============================================================
   8. Section Headers
   ============================================================ */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 0 4px;
}

.section-header__title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.section-header__more {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 500;
    color: var(--accent);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--border-primary);
    transition: background var(--transition-fast);
    white-space: nowrap;
}

.section-header__more:hover {
    background: var(--accent-subtle);
    color: var(--accent);
}

/* ============================================================
   9. Category Carousel Section
   ============================================================ */
.carousel-section {
    margin-bottom: 32px;
}

.carousel-wrapper {
    position: relative;
    overflow: hidden;
}

.carousel-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 4px;
}

.carousel-track::-webkit-scrollbar {
    display: none;
}

.carousel-track .video-card {
    min-width: 280px;
    flex-shrink: 0;
}

.carousel-nav {
    position: absolute;
    top: 0;
    bottom: 40px; /* account for card info */
    width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    cursor: pointer;
    border: none;
    font-size: 24px;
    color: var(--text-primary);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.carousel-wrapper:hover .carousel-nav {
    opacity: 1;
}

.carousel-nav--prev {
    left: 0;
    background: linear-gradient(to right, var(--bg-page) 40%, transparent);
}

.carousel-nav--next {
    right: 0;
    background: linear-gradient(to left, var(--bg-page) 40%, transparent);
}

.carousel-nav:hover {
    color: var(--accent);
}

/* ---------- 10. Announcement Bar ---------- */
.announcement-bar {
    background: var(--ab-bg, linear-gradient(135deg, var(--accent), #7c3aed));
    color: var(--ab-color, #fff);
    min-height: var(--ab-height, 44px);
    font-size: var(--ab-font-size, 14px);
    padding: 0 48px 0 24px;
    margin: -16px -24px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    font-weight: 500;
    position: relative;
    z-index: 50;
    cursor: default;
    overflow: hidden;
    /* FOUC対策: JS判定後に .is-ready が付与されるまで非表示 */
    visibility: hidden;
}
.announcement-bar.is-ready {
    visibility: visible;
}
.announcement-bar + .announcement-bar {
    margin-top: 0;
}
.announcement-bar[data-link] {
    cursor: pointer;
}
.announcement-bar[data-link]:hover {
    filter: brightness(1.1);
}
.announcement-bar__icon {
    font-size: 1.1em;
    flex-shrink: 0;
}
.announcement-bar__text {
    flex: 1;
    min-width: 0;
}
.announcement-bar__text--scroll {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.announcement-bar__text--scroll .ab-scroll-inner {
    display: inline-block;
    white-space: nowrap;
    padding-left: 100%;
    animation: ab-scroll var(--ab-scroll-duration, 20s) linear infinite;
}
@keyframes ab-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}
.announcement-bar--striped {
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255,255,255,0.07) 10px,
        rgba(255,255,255,0.07) 20px
    );
}
.announcement-bar__close {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: inherit;
    opacity: 0.7;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    line-height: 1;
    transition: opacity 0.2s;
}
.announcement-bar__close:hover {
    opacity: 1;
}
@media (max-width: 768px) {
    .announcement-bar {
        margin: -12px -12px 12px;
        padding: 0 40px 0 16px;
        min-height: calc(var(--ab-height, 44px) * 0.85);
        font-size: calc(var(--ab-font-size, 14px) * 0.9);
    }
}

/* ============================================================
   10.5 Featured / Picks Section Layouts
   ============================================================ */

/* Featured layout: 1 hero + 3 small cards */
.featured-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 4px;
}
.featured-grid__hero { grid-row: 1 / 3; }
.featured-grid__side { display: flex; flex-direction: column; gap: 4px; }

/* Featured card */
.featured-card {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: var(--thumbnail-radius, 8px);
    text-decoration: none;
    color: #fff;
}
.featured-card__thumb {
    position: relative;
    width: 100%;
    height: 100%;
}
.featured-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}
.featured-card:hover .featured-card__thumb img {
    transform: scale(1.03);
}
.featured-card__overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 16px 14px;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
}
.featured-card__category {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(0,0,0,0.7);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 6px;
}
.featured-card__title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.featured-card--hero .featured-card__title {
    font-size: 18px;
    -webkit-line-clamp: 3;
}
.featured-card--hero .featured-card__overlay {
    padding: 60px 20px 18px;
}
.featured-card__duration {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 2px 6px;
    background: rgba(0,0,0,0.6);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
}

/* Hero card min height */
.featured-grid__hero .featured-card { min-height: 360px; }
.featured-grid__side .featured-card { flex: 1; min-height: 0; }

/* Ranking style */
.ranking-grid { display: flex; flex-direction: column; gap: 8px; }
.ranking-item {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    padding: 8px;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--border-primary);
    transition: background 0.15s;
}
.ranking-item:hover { background: var(--surface-hover, rgba(255,255,255,0.05)); }
.ranking-item__rank {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; font-weight: 700; font-size: 14px; flex-shrink: 0;
    background: var(--bg-secondary, rgba(255,255,255,0.06)); color: var(--text-secondary);
}
.ranking-item:nth-child(1) .ranking-item__rank { background: #ffd700; color: #000; }
.ranking-item:nth-child(2) .ranking-item__rank { background: #c0c0c0; color: #000; }
.ranking-item:nth-child(3) .ranking-item__rank { background: #cd7f32; color: #fff; }
.ranking-item__thumb {
    width: 120px; height: 68px; flex-shrink: 0; border-radius: 6px; overflow: hidden;
    background: var(--bg-secondary, rgba(255,255,255,0.06));
}
.ranking-item__thumb img { width: 100%; height: 100%; object-fit: cover; }
.ranking-item__info { flex: 1; min-width: 0; }
.ranking-item__title {
    font-size: 14px; font-weight: 600; line-height: 1.4; margin: 0;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    color: var(--text-primary);
}
.ranking-item__meta { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }

/* Vertical card (Shorts-style) */
.carousel-vertical { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px; }
.carousel-vertical::-webkit-scrollbar { display: none; }
.vcard-vertical {
    display: block; position: relative; flex-shrink: 0;
    width: 180px; aspect-ratio: 9/16; border-radius: 12px; overflow: hidden;
    text-decoration: none; color: #fff; scroll-snap-align: start;
    background: var(--bg-secondary, #111);
}
/* In grid layouts, fill the column */
.video-grid .vcard-vertical,
[style*="grid"] .vcard-vertical {
    width: 100%;
}
.vcard-vertical__thumb { width: 100%; height: 100%; }
.vcard-vertical__thumb img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    transition: transform 0.3s;
}
.vcard-vertical:hover .vcard-vertical__thumb img { transform: scale(1.05); }
.vcard-vertical__duration {
    position: absolute; top: 8px; right: 8px;
    padding: 2px 6px; background: rgba(0,0,0,0.6); border-radius: 4px;
    font-size: 11px; font-weight: 600;
}
.vcard-vertical__overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 32px 12px 12px;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
}
.vcard-vertical__title {
    font-size: 13px; font-weight: 600; line-height: 1.4; margin: 0;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.vcard-vertical__meta {
    font-size: 11px; color: rgba(255,255,255,0.6); margin-top: 4px; display: block;
}

@media (max-width: 768px) {
    .featured-grid { grid-template-columns: 1fr; grid-template-rows: auto; }
    .featured-grid__hero { grid-row: auto; }
    .featured-grid__hero .featured-card { min-height: 200px; }
    .ranking-item__thumb { width: 80px; height: 45px; }
    .vcard-vertical { width: 140px; }
}

/* Text RSS list */
.rss-text-scroll {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) transparent;
}
.rss-text-scroll::-webkit-scrollbar { width: 6px; }
.rss-text-scroll::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }
.rss-text-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 7px 14px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.4;
    border-bottom: 1px solid var(--border-subtle);
    transition: background 0.12s;
    break-inside: avoid;
}
.rss-text-item:last-child { border-bottom: none; }
.rss-text-item:hover { background: rgba(255,255,255,0.04); }
.rss-text-item__title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rss-text-item__site {
    flex-shrink: 0;
    font-size: 11px;
    color: var(--text-tertiary);
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================================
   11. Footer
   ============================================================ */
.surgena-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-primary);
    padding: 40px 24px 24px;
    margin-left: var(--sidebar-width);
    transition: margin-left var(--transition-normal);
}

.sidebar-expanded .surgena-footer {
    margin-left: var(--sidebar-expanded-width);
}

.surgena-footer__grid {
    display: grid;
    gap: 32px;
    max-width: 1400px;
    margin: 0 auto;
}
.surgena-footer__grid > div {
    min-width: 0;
    overflow: hidden;
}

.surgena-footer__grid--1 { grid-template-columns: 1fr; }
.surgena-footer__grid--2 { grid-template-columns: repeat(2, 1fr); }
.surgena-footer__grid--3 { grid-template-columns: repeat(3, 1fr); }
.surgena-footer__grid--4 { grid-template-columns: repeat(4, 1fr); }

/* PC/Mobile footer widget visibility */
.surgena-footer__mobile-only { display: none; }

.surgena-footer__section-title {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.surgena-footer__widget {
    margin-bottom: 24px;
}

.surgena-footer__widget:last-child {
    margin-bottom: 0;
}

.surgena-footer__links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.surgena-footer__links li {
    padding: 4px 0;
}

.surgena-footer__links a {
    color: var(--text-secondary);
    font-size: 13px;
    transition: color var(--transition-fast);
}

.surgena-footer__links a:hover {
    color: var(--accent);
}

.surgena-footer__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.surgena-footer__tag {
    font-size: 12px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.06);
    padding: 4px 12px;
    border-radius: 20px;
    text-decoration: none;
    transition: background var(--transition-fast), color var(--transition-fast);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.surgena-footer__tag:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--accent);
}

/* Ranking table in footer */
.surgena-footer__ranking-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed;
}
.surgena-footer__ranking-th {
    text-align: left;
    padding: 6px 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-primary);
}
.surgena-footer__ranking-th--rank {
    width: 28px;
}
.surgena-footer__ranking-th--num {
    text-align: right;
    width: 64px;
}
.surgena-footer__ranking-row td {
    padding: 5px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.surgena-footer__ranking-row:last-child td {
    border-bottom: none;
}
.surgena-footer__ranking-row:hover {
    background: rgba(255, 255, 255, 0.03);
}
.surgena-footer__ranking-rank {
    width: 28px;
    text-align: center;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 12px;
}
.surgena-footer__ranking-row:nth-child(-n+3) .surgena-footer__ranking-rank {
    color: var(--accent);
}
.surgena-footer__ranking-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.surgena-footer__ranking-name a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s;
}
.surgena-footer__ranking-name a:hover {
    color: var(--accent);
}
.surgena-footer__ranking-count {
    text-align: right;
    white-space: nowrap;
    color: var(--text-secondary);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

/* Card-style content widgets in footer */
.surgena-footer__cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.surgena-footer__card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    text-decoration: none;
    color: var(--text-secondary);
    border-radius: 6px;
    padding: 6px;
    margin: 0 -6px;
    transition: background 0.15s;
}
.surgena-footer__card:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent);
}
.surgena-footer__card-img {
    width: 80px;
    height: 45px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
}
.surgena-footer__card-title {
    font-size: 12px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Social icons in footer */
.surgena-footer__social {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border-primary);
}
.surgena-footer__social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    font-size: 16px;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, transform 0.2s;
}
.surgena-footer__social-link:hover {
    background: var(--accent);
    color: #fff;
    transform: translateY(-2px);
}

.surgena-footer__bottom {
    border-top: 1px solid var(--border-primary);
    margin-top: 20px;
    padding-top: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    font-size: 12px;
    color: var(--text-tertiary);
}

.surgena-footer__legal {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 16px;
    flex-wrap: wrap;
}

.surgena-footer__legal a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s;
}

.surgena-footer__legal a:hover {
    color: var(--accent);
}

.surgena-footer__copyright {
    margin-left: auto;
}

.surgena-footer__brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.surgena-footer__brand-logo {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ============================================================
   12. Pagination
   ============================================================ */
.surgena-pagination {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 24px 0;
}
.surgena-pagination__pages {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
}
.surgena-pagination__item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
    cursor: pointer;
    border: 1px solid var(--border-primary);
    background: var(--surface);
}
.surgena-pagination__item:hover {
    background: var(--accent-subtle);
    transform: translateY(-1px);
}
.surgena-pagination__item.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(var(--accent-rgb, 0,0,0), 0.3);
}
.surgena-pagination__item.disabled {
    color: var(--text-tertiary);
    pointer-events: none;
    border-color: transparent;
    background: transparent;
}
.surgena-pagination__ellipsis {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 38px;
    color: var(--text-tertiary);
    font-size: 16px;
    letter-spacing: 2px;
}
.surgena-pagination__jump {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--text-tertiary);
}
.surgena-pagination__info {
    white-space: nowrap;
}
.surgena-pagination__form {
    display: flex;
    gap: 4px;
}
.surgena-pagination__input {
    width: 60px;
    height: 30px;
    padding: 0 8px;
    border-radius: 6px;
    border: 1px solid var(--border-primary);
    background: var(--surface);
    color: var(--text-primary);
    font-size: 12px;
    text-align: center;
}
.surgena-pagination__input:focus {
    outline: none;
    border-color: var(--accent);
}
.surgena-pagination__go {
    height: 30px;
    padding: 0 12px;
    border-radius: 6px;
    border: 1px solid var(--border-primary);
    background: var(--surface-hover);
    color: var(--text-primary);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}
.surgena-pagination__go:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ============================================================
   13. Blog Card
   ============================================================ */
.blog-card {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.blog-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-1px);
}

.blog-card__thumbnail {
    width: 200px;
    min-width: 200px;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-elevated);
}

.blog-card__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-card__content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-card__title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card__excerpt {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.blog-card__date {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* ============================================================
   14. Text Link Block (Top page link area)
   ============================================================ */
.text-links-block {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 32px;
    font-size: 13px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.text-links-block a {
    color: var(--accent);
    margin-right: 4px;
}

.text-links-block a:hover {
    text-decoration: underline;
}

/* ============================================================
   15. Access Ranking Widget (IN/OUT)
   ============================================================ */
.access-ranking {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 24px 0;
}

.access-ranking__block {
    background: var(--surface);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.access-ranking__header {
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--surface-hover) 0%, var(--surface) 100%);
    border-bottom: 2px solid var(--accent);
}

.access-ranking__sub {
    font-weight: 400;
    font-size: 11px;
    color: var(--text-tertiary);
    margin-left: 4px;
    text-transform: none;
    letter-spacing: 0;
}

.access-ranking__list {
    list-style: none;
    margin: 0;
    padding: 4px 0;
}

.access-ranking__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 14px;
    font-size: 13px;
    border-bottom: 1px solid var(--border-secondary, rgba(255,255,255,0.04));
    transition: background 0.2s, transform 0.15s;
}

.access-ranking__item:last-child {
    border-bottom: none;
}

.access-ranking__item:hover {
    background: var(--surface-hover);
}

/* -- Rank badges -- */
.access-ranking__rank {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 800;
    color: var(--text-tertiary);
    background: var(--surface-hover);
    border: 1.5px solid var(--border-primary);
    font-family: 'Poppins', sans-serif;
}

/* Gold / Silver / Bronze medals */
.access-ranking__rank--1 {
    background: linear-gradient(145deg, #ffd700, #e6ac00);
    color: #1a1200;
    border-color: #e6ac00;
    box-shadow: 0 1px 6px rgba(255,215,0,0.35);
}

.access-ranking__rank--2 {
    background: linear-gradient(145deg, #c0c0c0, #a0a0a0);
    color: #1a1a1a;
    border-color: #a0a0a0;
    box-shadow: 0 1px 6px rgba(192,192,192,0.3);
}

.access-ranking__rank--3 {
    background: linear-gradient(145deg, #cd7f32, #a0622a);
    color: #fff;
    border-color: #a0622a;
    box-shadow: 0 1px 6px rgba(205,127,50,0.3);
}

/* legacy fallback */
.access-ranking__rank--top {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.access-ranking__name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
}

a.access-ranking__name:hover {
    color: var(--accent);
}

.access-ranking__count {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    font-variant-numeric: tabular-nums;
    background: var(--surface-hover);
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 32px;
    text-align: center;
}

@media (max-width: 640px) {
    .access-ranking {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   16. Content Sidebar (Right Widget Sidebar)
   ============================================================ */
.content-sidebar {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.content-sidebar__widget {
    overflow: hidden;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-secondary, rgba(255,255,255,0.06));
}

.content-sidebar__widget:first-child {
    padding-top: 0;
}

.content-sidebar__widget:last-child {
    border-bottom: none;
}

.content-sidebar__header {
    padding: 0 0 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.content-sidebar__header:empty {
    display: none;
}

/* Script-only widgets (no title, content is just script tags) get no spacing */
.content-sidebar__widget--script-only {
    padding: 0 !important;
    border-bottom: none !important;
}

.content-sidebar__sub-header {
    padding: 6px 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-secondary, rgba(255,255,255,0.04));
}

/* Video list items */
.content-sidebar__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.content-sidebar__video-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 0;
    text-decoration: none;
    color: var(--text-primary);
    border-radius: 8px;
    transition: background var(--transition-fast);
}

.content-sidebar__video-item:last-child {
    border-bottom: none;
}

.content-sidebar__video-item:hover {
    background: var(--surface-hover);
}

.content-sidebar__thumb {
    flex-shrink: 0;
    position: relative;
    width: 168px;
    aspect-ratio: 16/9;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}

.content-sidebar__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.content-sidebar__thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: 20px;
}

.content-sidebar__duration {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 4px;
    border-radius: 3px;
    line-height: 1.4;
    letter-spacing: 0.3px;
}

.content-sidebar__video-info {
    flex: 1;
    min-width: 0;
    padding-top: 1px;
}

.content-sidebar__video-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.content-sidebar__video-meta {
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.5;
}

/* Rank badge (inside thumbnail, top-right) */
.content-sidebar__rank-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 2;
    min-width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    color: #fff;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    font-family: 'Poppins', sans-serif;
    padding: 0 5px;
}
.content-sidebar__rank-badge--1 {
    background: linear-gradient(145deg, #ffd700, #e6ac00);
    color: #1a1200;
    box-shadow: 0 1px 6px rgba(255,215,0,0.4);
}
.content-sidebar__rank-badge--2 {
    background: linear-gradient(145deg, #c0c0c0, #a0a0a0);
    color: #1a1a1a;
    box-shadow: 0 1px 6px rgba(192,192,192,0.35);
}
.content-sidebar__rank-badge--3 {
    background: linear-gradient(145deg, #cd7f32, #a0622a);
    color: #fff;
    box-shadow: 0 1px 6px rgba(205,127,50,0.35);
}

/* Rank badge (IN/OUT ranking list) */
.content-sidebar__rank {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-tertiary);
    background: var(--surface-hover);
}
.content-sidebar__rank--top {
    background: var(--accent);
    color: #fff;
}

/* Ranking list (IN/OUT) */
.content-sidebar__ranking {
    list-style: none;
    margin: 0;
    padding: 0;
}

.content-sidebar__ranking li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px;
    font-size: 12px;
    border-bottom: 1px solid var(--border-secondary, rgba(255,255,255,0.04));
}

.content-sidebar__ranking li:last-child {
    border-bottom: none;
}

.content-sidebar__rank-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
    text-decoration: none;
}

a.content-sidebar__rank-name:hover {
    color: var(--accent);
}

.content-sidebar__rank-count {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    font-variant-numeric: tabular-nums;
}

/* Tags / Categories */
.content-sidebar__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.content-sidebar__tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--surface-hover);
    border: 1px solid var(--border-primary);
    border-radius: 20px;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.content-sidebar__tag:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.content-sidebar__tag-count {
    font-size: 10px;
    color: var(--text-tertiary);
}

/* Category list style */
.category-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.category-list li {
    border-bottom: 1px solid var(--border-secondary, rgba(255,255,255,0.06));
}
.category-list li:last-child {
    border-bottom: none;
}
.category-list__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    transition: all var(--transition-fast);
    border-radius: 6px;
}
.category-list__item:hover {
    color: var(--accent);
    background: var(--surface-hover);
}
.category-list__name {
    font-weight: 500;
}
.category-list__count {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    background: var(--bg-elevated, rgba(255,255,255,0.06));
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 28px;
    text-align: center;
}

/* Search */
.content-sidebar__search {
    display: flex;
}

.content-sidebar__search-input {
    flex: 1;
    padding: 6px 12px;
    font-size: 13px;
    background: var(--bg);
    border: 1px solid var(--border-primary);
    border-right: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    color: var(--text-primary);
    outline: none;
}

.content-sidebar__search-input:focus {
    border-color: var(--accent);
}

.content-sidebar__search-btn {
    padding: 6px 12px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    cursor: pointer;
}

/* Custom HTML / Ad */
.content-sidebar__html {
    padding: 12px 14px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.content-sidebar__ad {
    padding: 0;
}

.content-sidebar__ad-img {
    width: 100%;
    height: auto;
    display: block;
}

/* Two-column layout for detail pages with sidebar */
.detail-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.detail-with-sidebar__main {
    min-width: 0;
}

@media (max-width: 1024px) {
    .detail-with-sidebar {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   17. Responsive Design
   ============================================================ */

/* Tablet */
@media (max-width: 1024px) {
    .video-grid {
        grid-template-columns: repeat(min(var(--grid-cols-pc), 3), 1fr);
    }

    .carousel-track .video-card {
        min-width: 220px;
    }

    .surgena-footer__grid--4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile */
@media (max-width: 768px) {
    .surgena-sidebar {
        display: none;
    }

    .surgena-nav {
        display: none;
    }

    body.has-nav .surgena-main {
        margin-top: var(--header-height);
        min-height: calc(100vh - var(--header-height));
    }

    .surgena-main {
        margin-left: 0;
        padding: 12px 12px;
    }

    .surgena-footer {
        margin-left: 0;
        padding: 24px 16px 16px;
    }

    .surgena-footer__pc-only { display: none; }
    .surgena-footer__mobile-only { display: grid; }

    .sidebar-expanded .surgena-main,
    .sidebar-expanded .surgena-footer {
        margin-left: 0;
    }

    .surgena-header__center {
        display: none;
    }

    .surgena-header__start {
        min-width: auto;
    }

    .surgena-header__end {
        min-width: auto;
        margin-left: auto;
    }

    .video-grid {
        grid-template-columns: repeat(var(--grid-cols-mobile), 1fr);
        gap: 10px;
    }

    .video-card__title {
        font-size: 13px;
    }

    .video-card__duration {
        font-size: 11px;
        padding: 1px 4px;
    }

    .section-header__title {
        font-size: 16px;
    }

    .carousel-track .video-card {
        min-width: 200px;
    }

    .blog-card {
        flex-direction: column;
    }

    .blog-card__thumbnail {
        width: 100%;
        min-width: auto;
    }

    .surgena-footer__grid--2,
    .surgena-footer__grid--3,
    .surgena-footer__grid--4 {
        grid-template-columns: 1fr;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .video-grid {
        grid-template-columns: repeat(var(--grid-cols-mobile), 1fr);
        gap: 8px;
    }

    .video-card__info {
        padding: 6px 2px 2px;
    }

    .video-card__title {
        font-size: 12px;
    }

    .video-card__meta {
        font-size: 11px;
    }
}

/* ============================================================
   16. Loading & Utility
   ============================================================ */
.skeleton {
    background: linear-gradient(90deg,
        var(--bg-card) 25%,
        var(--bg-card-hover) 37%,
        var(--bg-card) 63%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================================
   17. Category Chips (Filter bar)
   ============================================================ */
.category-chips-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    padding: 8px 0 16px;
}

.category-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    flex: 1;
    min-width: 0;
}

.category-chips::-webkit-scrollbar {
    display: none;
}

.category-chips-nav {
    display: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg-elevated);
    color: var(--text-primary);
    cursor: pointer;
    flex-shrink: 0;
    z-index: 2;
    font-size: 14px;
    transition: background var(--transition-fast), box-shadow var(--transition-fast);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.category-chips-nav:hover {
    background: var(--bg-card-hover);
}

/* Show nav buttons only on PC when content overflows */
@media (min-width: 769px) {
    .category-chips-nav.visible {
        display: flex;
    }
    .category-chips-nav--prev {
        margin-right: 8px;
    }
    .category-chips-nav--next {
        margin-left: 8px;
    }
}

.category-chip {
    display: inline-flex;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
    border: none;
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.category-chip:hover {
    background: var(--bg-card-hover);
}

.category-chip.active {
    background: var(--text-primary);
    color: var(--text-inverse);
}

/* ============================================================
   Blog Card Component
   ============================================================ */
.blog-card {
    display: flex;
    gap: 16px;
    padding: 16px;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    transition: background var(--transition-fast), transform var(--transition-fast);
    text-decoration: none;
    color: inherit;
    position: relative;
}

.blog-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    color: inherit;
}

.blog-card__thumbnail {
    flex-shrink: 0;
    width: 200px;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-elevated);
    position: relative;
}

.blog-card__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.blog-card:hover .blog-card__thumbnail img {
    transform: scale(1.05);
}

.blog-card__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.blog-card__title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

.blog-card__excerpt {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

.blog-card__date {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: auto;
}

/* ブログカードのアクセスバッジ */
.blog-card__access-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.blog-card__access-badge--paid {
    background: rgba(37, 99, 195, 0.6);
    color: #fff;
}

.blog-card__access-badge--premium {
    background: rgba(194, 160, 10, 0.6);
    color: #fff;
}

@media (max-width: 600px) {
    .blog-card {
        flex-direction: column;
        gap: 12px;
    }
    .blog-card__thumbnail {
        width: 100%;
    }
}

/* ============================================================
   Content Lock Screen (共通ロック画面)
   ============================================================ */
.content-lock {
    position: relative;
    margin-top: 24px;
}

.content-lock__overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 24px;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-primary);
}

.content-lock__icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(62,166,255,0.15), rgba(124,58,237,0.15));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    animation: lockPulse 2s ease-in-out infinite;
}

.content-lock__icon i {
    font-size: 28px;
    color: var(--accent);
}

@keyframes lockPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.content-lock__title {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.content-lock__desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    max-width: 400px;
}

.content-lock__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 32px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    margin: 4px 6px;
}

.content-lock__btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.content-lock__btn--primary {
    background: linear-gradient(135deg, var(--accent), #7c3aed);
    color: #fff;
}

.content-lock__btn--secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
}

/* ============================================================
   Comment Section
   ============================================================ */
.comment-section {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--border-primary);
}

.comment-section__header {
    margin-bottom: 20px;
}

.comment-section__title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-section__title i {
    color: var(--accent);
}

.comment-section__count {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-tertiary);
}

/* Flash message */
.comment-flash {
    background: rgba(34,197,94,0.1);
    border: 1px solid rgba(34,197,94,0.3);
    color: #22c55e;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    margin-bottom: 16px;
}

/* Comment form */
.comment-form {
    margin-bottom: 24px;
}

.comment-form__row {
    display: flex;
    gap: 12px;
}

.comment-form__avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--text-tertiary);
    font-size: 20px;
}

.comment-form__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-form__input-wrap {
    flex: 1;
}

.comment-form__input {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-primary);
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-size: 14px;
    resize: none;
    transition: border-color var(--transition-fast);
    font-family: inherit;
}

.comment-form__input:focus {
    outline: none;
    border-color: var(--accent);
}

.comment-form__actions {
    display: none;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}

.comment-form.expanded .comment-form__actions {
    display: flex;
}

.comment-form.expanded .comment-form__input {
    min-height: 80px;
    resize: vertical;
}

.comment-form__cancel {
    padding: 6px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 16px;
}

.comment-form__cancel:hover {
    background: var(--bg-elevated);
}

.comment-form__submit {
    padding: 6px 20px;
    border: none;
    background: linear-gradient(135deg, var(--accent), #7c3aed);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 16px;
    transition: transform var(--transition-fast);
}

.comment-form__submit:hover {
    transform: translateY(-1px);
}

/* Login prompt */
.comment-login-prompt {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}

/* Comment list */
.comment-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Comment item */
.comment-item {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-item--reply {
    padding-left: 0;
    border-bottom: none;
    padding-top: 12px;
    padding-bottom: 8px;
}

.comment-item__avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--text-tertiary);
    font-size: 18px;
}

.comment-item--reply .comment-item__avatar {
    width: 28px;
    height: 28px;
    font-size: 14px;
}

.comment-item__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-item__body {
    flex: 1;
    min-width: 0;
}

.comment-item__header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.comment-item__name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.comment-item__badge {
    font-size: 10px;
    padding: 1px 8px;
    border-radius: 10px;
    font-weight: 700;
}

.comment-item__badge--staff {
    background: linear-gradient(135deg, var(--accent), #7c3aed);
    color: #fff;
}

.comment-item__time {
    font-size: 12px;
    color: var(--text-tertiary);
}

.comment-item__text {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-primary);
    margin: 0 0 6px;
    white-space: pre-line;
    word-break: break-word;
}

.comment-item__actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px 4px;
    margin-top: 4px;
}

.comment-item__action-btn {
    padding: 4px 10px;
    border: none;
    background: transparent;
    color: var(--text-secondary, #aaa);
    font-size: 12px;
    cursor: pointer;
    border-radius: 12px;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.comment-item__action-btn:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.comment-item__action-btn--danger:hover {
    color: #ef4444;
}

/* Reply form */
.comment-reply-form {
    margin-top: 10px;
    padding-left: 4px;
}

.comment-reply-form__input {
    width: 100%;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-primary);
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-size: 13px;
    resize: vertical;
    font-family: inherit;
}

.comment-reply-form__input:focus {
    outline: none;
    border-color: var(--accent);
}

.comment-reply-form__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

/* Replies container */
.comment-replies {
    margin-top: 8px;
    padding-left: 12px;
    border-left: 2px solid rgba(255,255,255,0.06);
}

/* Empty state */
.comment-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-tertiary);
    font-size: 14px;
}

.comment-empty p {
    margin-top: 8px;
}

@media (max-width: 600px) {
    .comment-form__avatar,
    .comment-item__avatar {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    .comment-item--reply .comment-item__avatar {
        width: 24px;
        height: 24px;
    }
    .comment-replies {
        padding-left: 8px;
    }
}

/* ============================================================
   Comment Toggle (Mobile) & Reactions
   ============================================================ */

/* Mobile: tap-to-open trigger bar */
.comment-toggle {
    margin-top: 24px;
    cursor: pointer;
}
.comment-toggle__inner {
    display: flex; align-items: center; gap: 8px;
    padding: 14px 16px;
    background: var(--surface, #1a1d21);
    border: 1px solid var(--border-primary, rgba(255,255,255,0.08));
    border-radius: 10px;
    color: var(--text-primary); font-size: 14px; font-weight: 600;
    transition: background 0.15s;
}
.comment-toggle__inner:active { background: var(--bg-elevated, #252830); }
.comment-toggle__inner i:first-child { color: var(--accent); font-size: 18px; }
.comment-toggle__chevron { margin-left: auto; color: var(--text-tertiary); font-size: 12px; transition: transform 0.2s; }

/* Mobile: comment section hidden by default, shown when .open */
@media (max-width: 991.98px) {
    .comment-section {
        display: none;
        position: fixed; inset: 0; z-index: 1050;
        background: var(--bg, #0f1115);
        overflow-y: auto; padding: 0 16px 40px;
        margin-top: 0; border-top: none;
        overscroll-behavior: contain;
        will-change: transform;
    }
    .comment-section.open { display: block; animation: commentSlideUp 0.25s ease-out; }
    .comment-section.dragging { transition: none !important; }
    @keyframes commentSlideUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }
    .comment-grip {
        position: sticky; top: 0; z-index: 2;
        display: flex; justify-content: center; align-items: center;
        height: 28px;
        margin: 0 -16px;
        background: var(--bg, #0f1115);
        touch-action: none;
        cursor: grab;
    }
    .comment-grip::before {
        content: '';
        width: 40px; height: 4px;
        background: var(--text-tertiary, #6b7280);
        opacity: 0.5;
        border-radius: 2px;
    }
    .comment-grip:active { cursor: grabbing; }
    .comment-section__header { display: flex; justify-content: space-between; align-items: center; padding-top: 8px; }
}

/* PC: always visible, no toggle */
@media (min-width: 992px) {
    .comment-toggle { display: none !important; }
    .comment-section { display: block !important; }
    .comment-close { display: none !important; }
    .comment-grip { display: none !important; }
}

/* Close button (mobile) */
.comment-close {
    background: none; border: none; color: var(--text-secondary); font-size: 20px;
    padding: 4px 8px; cursor: pointer; border-radius: 6px;
    transition: background 0.15s;
}
.comment-close:hover { background: rgba(255,255,255,0.08); }

/* Comment reactions (YouTube-style like/dislike) */
.comment-reactions {
    display: inline-flex; align-items: center; gap: 0; margin-right: 8px;
}
.comment-react-btn {
    display: inline-flex; align-items: center; gap: 4px;
    background: transparent; border: none;
    color: var(--text-secondary, #aaa);
    padding: 6px 12px;
    cursor: pointer; transition: color 0.15s;
    line-height: 1; position: relative;
}
.comment-react-btn:first-child { padding-right: 10px; }
.comment-react-btn:last-child { padding-left: 10px; }
.comment-react-btn:first-child::after {
    content: ''; position: absolute; right: 0; top: 20%; height: 60%;
    width: 1px; background: var(--border-primary, rgba(255,255,255,0.12));
}
.comment-react-btn:hover { color: var(--text-primary, #fff); }
.comment-react-btn.active[data-type="like"] { color: var(--accent, #3ea6ff); }
.comment-react-btn.active[data-type="dislike"] { color: var(--text-primary, #fff); }
.comment-react-btn i { font-size: 15px; }
.comment-react-btn span { font-size: 12px; font-weight: 500; min-width: 4px; }

/* ============================================================
   Comment Rank Badges
   ============================================================ */
.comment-rank-badge {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 1px 8px; border-radius: 10px;
    font-size: 10px; font-weight: 700; letter-spacing: 0.02em;
    white-space: nowrap; vertical-align: middle; line-height: 1.6;
}
.comment-rank-badge i { font-size: 10px; }

/* Guest badge */
.comment-rank-badge--guest {
    background: rgba(255,255,255,0.06); color: var(--text-tertiary, #666);
    border: 1px solid rgba(255,255,255,0.08);
}

/* Rank-specific shimmer for premium tiers */
.comment-rank-badge--diamond {
    animation: badgeShimmer 3s ease-in-out infinite;
    text-shadow: 0 0 6px rgba(185,242,255,0.4);
}
.comment-rank-badge--platinum {
    text-shadow: 0 0 4px rgba(226,232,240,0.3);
}
.comment-rank-badge--gold {
    box-shadow: 0 1px 4px rgba(245,158,11,0.3);
}

@keyframes badgeShimmer {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
}

/* Guest name style */
.comment-item__name--guest {
    color: var(--text-tertiary, #888); font-style: italic;
}

/* ============================================================
   Mobile Footer Bar
   ============================================================ */
.mobile-footer-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--mfb-height, 56px);
    background: rgba(15, 17, 21, var(--mfb-opacity, 0.85));
    /* 透明度に連動してぼかし強度を変化 (0.5→0px ぼかしなし, 1.0→12px ぼかし最大) */
    backdrop-filter: blur(calc((var(--mfb-opacity, 0.85) - 0.5) * 24px));
    -webkit-backdrop-filter: blur(calc((var(--mfb-opacity, 0.85) - 0.5) * 24px));
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 4px;
    z-index: 900;
}

.mobile-footer-bar__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex: 1;
    min-width: 0;
    height: 100%;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 10px;
    font-weight: 500;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.mobile-footer-bar__item i {
    font-size: 20px;
    line-height: 1;
}

.mobile-footer-bar__item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.mobile-footer-bar__item:hover,
.mobile-footer-bar__item:active {
    color: rgba(255, 255, 255, 0.9);
}

.mobile-footer-bar__item.active {
    color: var(--accent);
}

/* Add bottom padding to main content on mobile to prevent footer bar overlap */
@media (max-width: 767.98px) {
    .surgena-main {
        padding-bottom: calc(var(--mfb-height, 56px) + 12px) !important;
    }
    .surgena-footer {
        padding-bottom: calc(var(--mfb-height, 56px) + 16px);
    }
}

/* ============================================================
   Text-only item list (sections/widgets style: 'text')
============================================================ */
.text-item-list {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--border-subtle);
}
.text-item {
    display: block;
    padding: 12px 4px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.15s;
}
.text-item:hover {
    background: var(--bg-card-hover, rgba(255,255,255,0.04));
}
.text-item__title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.text-item__meta {
    font-size: 11px;
    color: var(--text-tertiary);
    display: flex;
    gap: 4px;
    align-items: center;
}
.text-item__meta .dot { color: var(--text-tertiary); }

/* ============================================================
   Ranking list (popular_videos style: 'ranking')
============================================================ */
.video-ranking-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.video-ranking-list__item {
    display: flex;
    align-items: stretch;
    gap: 12px;
}
.video-ranking-list__rank {
    flex-shrink: 0;
    width: 40px;
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading, inherit);
}
.video-ranking-list__item:nth-child(1) .video-ranking-list__rank { font-size: 36px; }
.video-ranking-list__item:nth-child(2) .video-ranking-list__rank { color: #c0c0c0; }
.video-ranking-list__item:nth-child(3) .video-ranking-list__rank { color: #cd7f32; }
.video-ranking-list__card {
    flex: 1;
    min-width: 0;
}
