:root {
    --bg: #0b1020;
    --card: rgba(255, 255, 255, 0.94);
    --text: #111827;
    --muted: #6b7280;
    --line: #e5e7eb;
    --brand: #2563eb;
    --brand-dark: #1d4ed8;
    --danger: #b91c1c;
    --success: #15803d;
    --gold: #f59e0b;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, "Microsoft YaHei", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(37,99,235,.35), transparent 32%),
        radial-gradient(circle at top right, rgba(245,158,11,.22), transparent 28%),
        linear-gradient(135deg, #07111f 0%, #111827 48%, #1f2937 100%);
    min-height: 100vh;
}

a {
    color: var(--brand);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.site-header {
    width: 100%;
    padding: 18px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.logo {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: .3px;
}

.logo span {
    color: var(--gold);
}

.nav a {
    color: rgba(255,255,255,.86);
    margin-left: 22px;
    font-size: 14px;
}

.page {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 36px 0 72px;
}

.hero {
    display: grid;
    grid-template-columns: 1.08fr .92fr;
    gap: 28px;
    align-items: center;
    margin-top: 18px;
}

.hero-copy {
    color: white;
    padding: 26px 8px;
}

.badge {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    color: rgba(255,255,255,.88);
    font-size: 13px;
    margin-bottom: 18px;
}

.hero h1 {
    font-size: 46px;
    line-height: 1.12;
    margin: 0 0 18px;
    letter-spacing: -1px;
}

.hero p {
    font-size: 17px;
    line-height: 1.85;
    color: rgba(255,255,255,.78);
    margin: 0 0 22px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 24px;
}

.feature {
    padding: 14px;
    border-radius: 16px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    color: rgba(255,255,255,.88);
    font-size: 14px;
}

.panel {
    background: var(--card);
    border-radius: 26px;
    padding: 30px;
    box-shadow: 0 28px 80px rgba(0,0,0,.28);
    border: 1px solid rgba(255,255,255,.5);
}

.panel h1,
.panel h2 {
    margin-top: 0;
}

.panel-title {
    font-size: 28px;
    margin-bottom: 8px;
}

.panel-subtitle {
    color: var(--muted);
    line-height: 1.7;
    margin-bottom: 24px;
}

.form-row {
    margin-bottom: 16px;
}

label {
    display: block;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 8px;
}

input,
select,
textarea {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    font-size: 15px;
    outline: none;
    background: white;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}

button,
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border: 0;
    border-radius: 14px;
    padding: 13px 18px;
    background: var(--brand);
    color: white;
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
    text-decoration: none;
}

button:hover,
.btn:hover {
    background: var(--brand-dark);
    text-decoration: none;
}

.btn-secondary {
    background: #111827;
}

.btn-secondary:hover {
    background: #000;
}

.btn-full {
    width: 100%;
}

.notice {
    padding: 13px 15px;
    border-radius: 14px;
    margin: 16px 0;
    line-height: 1.6;
}

.notice-success {
    background: #ecfdf5;
    color: var(--success);
    border: 1px solid #bbf7d0;
}

.notice-error {
    background: #fef2f2;
    color: var(--danger);
    border: 1px solid #fecaca;
}

.trust-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 28px;
}

.trust-card {
    background: rgba(255,255,255,.94);
    border-radius: 20px;
    padding: 18px;
    border: 1px solid rgba(255,255,255,.65);
    box-shadow: 0 14px 38px rgba(0,0,0,.18);
}

.trust-card strong {
    display: block;
    margin-bottom: 8px;
}

.trust-card p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.65;
}

.footer {
    color: rgba(255,255,255,.55);
    text-align: center;
    padding: 24px;
    font-size: 13px;
}

.small {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.7;
}

.hr {
    height: 1px;
    background: var(--line);
    margin: 22px 0;
}

@media (max-width: 820px) {
    .site-header {
        padding: 16px;
    }

    .nav a {
        margin-left: 12px;
    }

    .hero {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 34px;
    }

    .feature-grid,
    .trust-list {
        grid-template-columns: 1fr;
    }

    .panel {
        padding: 24px;
    }
}

/* ===== Course Center ===== */

.member-shell {
    display: grid;
    gap: 24px;
}

.member-hero {
    color: white;
    padding: 28px;
    border-radius: 28px;
    background:
        linear-gradient(135deg, rgba(37,99,235,.34), rgba(17,24,39,.82)),
        rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.14);
    box-shadow: 0 24px 60px rgba(0,0,0,.22);
}

.member-hero h1 {
    font-size: 38px;
    margin: 0 0 10px;
}

.member-hero p {
    color: rgba(255,255,255,.76);
    line-height: 1.8;
    margin: 0;
}

.member-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.member-stat {
    background: rgba(255,255,255,.94);
    border-radius: 20px;
    padding: 18px;
    box-shadow: 0 12px 34px rgba(0,0,0,.16);
    border: 1px solid rgba(255,255,255,.72);
}

.member-stat span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 8px;
}

.member-stat strong {
    font-size: 18px;
    word-break: break-all;
}

.course-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.course-card {
    background: rgba(255,255,255,.96);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 18px 54px rgba(0,0,0,.18);
    border: 1px solid rgba(255,255,255,.72);
}

.course-card h2 {
    margin: 0 0 10px;
    font-size: 24px;
}

.course-desc {
    color: var(--muted);
    line-height: 1.75;
    margin-bottom: 18px;
}

.lesson-list {
    display: grid;
    gap: 12px;
}

.lesson-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
}

.lesson-row-title {
    font-weight: 800;
    margin-bottom: 5px;
}

.lesson-row-meta {
    color: var(--muted);
    font-size: 13px;
}

.tag {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 800;
    margin-right: 6px;
}

.tag-pdf {
    background: #ecfdf5;
    color: #15803d;
}

.tag-video {
    background: #fff7ed;
    color: #c2410c;
}

.empty-state {
    background: rgba(255,255,255,.95);
    border-radius: 24px;
    padding: 32px;
    text-align: center;
    color: var(--muted);
}

/* ===== Lesson Page ===== */

.lesson-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 22px;
    align-items: start;
}

.lesson-main {
    background: rgba(255,255,255,.96);
    border-radius: 26px;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
}

.lesson-side {
    background: rgba(255,255,255,.96);
    border-radius: 26px;
    padding: 22px;
    box-shadow: 0 20px 60px rgba(0,0,0,.18);
    position: sticky;
    top: 20px;
}

.lesson-title {
    font-size: 30px;
    margin: 0 0 8px;
}

.lesson-meta {
    color: var(--muted);
    margin-bottom: 20px;
}

.player-wrap {
    position: relative;
    border-radius: 22px;
    overflow: hidden;
    background: #000;
    border: 1px solid #111827;
}

.player-wrap video {
    width: 100%;
    display: block;
    background: #000;
}

.lesson-watermark {
    position: absolute;
    left: 24px;
    bottom: 24px;
    z-index: 4;
    padding: 8px 12px;
    border-radius: 999px;
    color: rgba(255,255,255,.72);
    background: rgba(0,0,0,.38);
    font-size: 13px;
    pointer-events: none;
}

.pdf-reader {
    display: grid;
    gap: 18px;
}

.pdf-page {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    background: #f3f4f6;
    border: 1px solid var(--line);
}

.pdf-page img {
    width: 100%;
    display: block;
}

.pdf-page-no {
    position: absolute;
    right: 14px;
    top: 14px;
    background: rgba(0,0,0,.58);
    color: white;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
}

.side-block {
    margin-bottom: 18px;
}

.side-block strong {
    display: block;
    margin-bottom: 8px;
}

.side-block p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
    font-size: 14px;
}

.warning-box {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    border-radius: 16px;
    padding: 14px;
    line-height: 1.65;
    font-size: 14px;
}

@media (max-width: 900px) {
    .member-stats,
    .course-grid,
    .lesson-layout {
        grid-template-columns: 1fr;
    }

    .lesson-side {
        position: static;
    }

    .member-hero h1 {
        font-size: 30px;
    }

    .lesson-row {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ===== Contrast Fix ===== */
.member-hero {
    background:
        linear-gradient(135deg, rgba(15,23,42,.92), rgba(30,41,59,.88)),
        rgba(255,255,255,.06) !important;
}

.member-hero p,
.member-hero .badge {
    color: rgba(255,255,255,.92) !important;
}

.course-card,
.member-stat,
.lesson-main,
.lesson-side,
.trust-card,
.panel {
    background: #ffffff !important;
    color: #111827 !important;
}

.course-desc,
.lesson-row-meta,
.member-stat span,
.lesson-meta,
.side-block p,
.small,
.panel-subtitle {
    color: #374151 !important;
}

.lesson-row {
    background: #f9fafb !important;
    border-color: #d1d5db !important;
}

.lesson-row-title,
.course-card h2,
.member-stat strong,
.lesson-title,
.panel-title {
    color: #111827 !important;
}

.empty-state {
    background: #ffffff !important;
    color: #374151 !important;
    border: 1px solid #d1d5db;
}

/* ===== Stronger watermark ===== */
.watermark-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}

.watermark-item {
    position: absolute;
    color: rgba(255,255,255,.22);
    font-size: 22px;
    font-weight: 800;
    transform: rotate(-24deg);
    white-space: nowrap;
    user-select: none;
}

.watermark-item-dark {
    color: rgba(0,0,0,.16);
}

.video-watermark-chip {
    position: absolute;
    left: 18px;
    top: 18px;
    z-index: 6;
    background: rgba(0,0,0,.45);
    color: rgba(255,255,255,.92);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 700;
    pointer-events: none;
}

/* ===== PDF pager ===== */
.pdf-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding: 14px;
    background: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 16px;
}

.pdf-toolbar-left,
.pdf-toolbar-right {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.pdf-page-input {
    width: 90px !important;
    padding: 10px 12px !important;
}

.pdf-page-stage {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
}

.pdf-page-stage img {
    width: 100%;
    display: block;
}

.pdf-page-counter {
    font-weight: 700;
    color: #111827;
}

@media (max-width: 900px) {
    .watermark-item {
        font-size: 16px;
    }

    .pdf-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .pdf-toolbar-left,
    .pdf-toolbar-right {
        justify-content: center;
    }
}

/* ===== Strong visible video watermark ===== */

.player-wrap {
    position: relative !important;
    overflow: hidden !important;
}

.player-wrap video {
    position: relative;
    z-index: 1;
}

.video-watermark-chip {
    position: absolute !important;
    left: 18px !important;
    top: 18px !important;
    z-index: 50 !important;
    background: rgba(0,0,0,.58) !important;
    color: rgba(255,255,255,.96) !important;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 800;
    pointer-events: none;
    text-shadow: 0 1px 3px rgba(0,0,0,.9);
}

.video-watermark-overlay {
    position: absolute !important;
    inset: 0 !important;
    z-index: 40 !important;
    pointer-events: none !important;
    overflow: hidden !important;
}

.video-watermark-item {
    position: absolute;
    color: rgba(255,255,255,.46);
    font-size: 24px;
    font-weight: 900;
    transform: rotate(-23deg);
    white-space: nowrap;
    user-select: none;
    text-shadow:
        0 2px 6px rgba(0,0,0,.85),
        0 0 16px rgba(0,0,0,.5);
}

.video-watermark-center {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 45;
    transform: translate(-50%, -50%) rotate(-22deg);
    color: rgba(255,255,255,.32);
    font-size: 34px;
    font-weight: 900;
    white-space: nowrap;
    text-shadow:
        0 2px 8px rgba(0,0,0,.9),
        0 0 18px rgba(0,0,0,.6);
    pointer-events: none;
}

/* ===== PDF responsive reader with thumbnails ===== */

.pdf-layout {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.pdf-thumbs {
    position: sticky;
    top: 18px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 18px;
    padding: 10px;
}

.pdf-thumb {
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 6px;
    margin-bottom: 10px;
    background: #f9fafb;
    cursor: pointer;
    transition: all .15s ease;
}

.pdf-thumb:hover {
    border-color: #93c5fd;
    background: #eff6ff;
}

.pdf-thumb.active {
    border-color: #2563eb;
    background: #dbeafe;
}

.pdf-thumb img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
    background: #f3f4f6;
}

.pdf-thumb span {
    display: block;
    text-align: center;
    margin-top: 6px;
    font-size: 12px;
    font-weight: 800;
    color: #374151;
}

.pdf-viewer {
    min-width: 0;
    width: 100%;
}

.pdf-page-stage {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.pdf-page-stage img {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    object-fit: contain;
}

.pdf-toolbar {
    position: sticky;
    top: 0;
    z-index: 20;
}

.pdf-watermark-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 10;
    overflow: hidden;
}

.pdf-watermark-item {
    position: absolute;
    color: rgba(0,0,0,.20);
    font-size: 28px;
    font-weight: 900;
    transform: rotate(-24deg);
    white-space: nowrap;
    user-select: none;
}

@media (max-width: 900px) {
    .pdf-layout {
        grid-template-columns: 1fr;
    }

    .pdf-thumbs {
        position: static;
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        max-height: none;
        gap: 10px;
    }

    .pdf-thumb {
        min-width: 92px;
        margin-bottom: 0;
    }

    .video-watermark-item {
        font-size: 16px;
    }

    .video-watermark-center {
        font-size: 22px;
    }

    .pdf-watermark-item {
        font-size: 18px;
    }
}

/* ===== Restore lighter watermark style ===== */

.video-watermark-chip {
    background: rgba(0,0,0,.38) !important;
    color: rgba(255,255,255,.72) !important;
    border: none !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-shadow: none !important;
}

.video-watermark-center {
    display: none !important;
}

.video-watermark-item {
    color: rgba(255,255,255,.22) !important;
    font-size: 22px !important;
    font-weight: 800 !important;
    text-shadow: none !important;
}

.pdf-watermark-item {
    color: rgba(0,0,0,.16) !important;
    font-size: 22px !important;
    font-weight: 800 !important;
}

@media (max-width: 900px) {
    .video-watermark-item {
        font-size: 16px !important;
    }

    .pdf-watermark-item {
        font-size: 16px !important;
    }
}
