:root {
    --primary-color: #4a67b0;
    --bg-color: #f0f2f5;
    --container-bg: #ffffff;
    --text-main: #333333;
    --text-muted: #666666;
    --border-color: #d1d5da;
    --font-family: 'Segoe UI', Tahoma, Arial, sans-serif;

    --topbar-bg: #ffffff;
    --text-title: #000000;
    --text-heading: #222222;
    --text-link: #555555;
    --panel-bg: #ffffff;
    --panel-border: #cdd4db;
    --notice-border: #cfd8dc;
    --notice-border-dotted: #e0e0e0;
    --footer-bg: #f4f6f8;
    --footer-border: #e0e4e8;
    --icon-color: #333333;
}

body.dark-mode {
    --primary-color: #4a67b0;
    --bg-color: #121212;
    --container-bg: #1e1e1e;
    --text-main: #dddddd;
    --text-muted: #aaaaaa;
    --border-color: #333333;

    --topbar-bg: #1a1a1a;
    --text-title: #ffffff;
    --text-heading: #eeeeee;
    --text-link: #cccccc;
    --panel-bg: #2a2a2a;
    --panel-border: #444444;
    --notice-border: #444444;
    --notice-border-dotted: #444444;
    --footer-bg: #151515;
    --footer-border: #333333;
    --icon-color: #ffca28;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
    color: var(--text-main);
    transition: background-color 0.3s, color 0.3s;
}

a {
    color: inherit;
}

/* Top Bar */
.topbar {
    background-color: var(--topbar-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    transition: background-color 0.3s;
}

.topbar-inner {
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    min-height: 55px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    min-width: 0;
}

.logo-img {
    max-height: 70px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

.header-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    min-width: 0;
}

.server-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-title);
}

.nav-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu li a {
    text-decoration: none;
    color: var(--text-title);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    letter-spacing: 0.3px;
    transition: color 0.2s;
}

.nav-menu li a:hover {
    color: var(--primary-color);
}

.nav-menu li a::after {
    content: '▼';
    font-size: 0.6em;
    color: var(--text-muted);
    margin-left: 5px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.moon-icon {
    font-size: 1.2rem;
    color: var(--icon-color);
    cursor: pointer;
    user-select: none;
    background: none;
    border: none;
    padding: 4px;
    line-height: 1;
}

/* Main Container */
.main-container {
    max-width: 1440px;
    width: calc(100% - 32px);
    box-sizing: border-box;
    margin: 30px auto;
    background-color: var(--container-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 35px 45px 40px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
    position: relative;
    overflow: hidden;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 25px;
    gap: 16px;
}

.headline h1 {
    font-size: 1.8rem;
    margin: 0 0 6px;
    font-weight: 800;
    color: var(--text-heading);
}

.headline p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
}

.page-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.page-actions a {
    text-decoration: none;
}

.lang-select {
    font-size: 0.75rem;
    cursor: pointer;
    color: var(--text-title);
    font-weight: 600;
}

.view-source-btn {
    background: none;
    border: none;
    color: #3b5998;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    text-transform: uppercase;
    padding: 0;
    text-decoration: none;
}

.content-grid {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 20px;
    align-items: start;
}

.col-left,
.col-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.col-left .panel {
    display: flex;
    flex-direction: column;
}

.col-left .panel-body a {
    display: block;
    width: 100%;
    text-decoration: none;
}

.col-left .panel-body img {
    width: 100%;
    height: auto;
    display: block;
}

/* Notice */
.notice-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.notice-header {
    display: flex;
    align-items: center;
    border-bottom: 2px dotted var(--notice-border);
    padding-bottom: 10px;
}

.notice-icon {
    font-size: 2rem;
    margin-right: 15px;
    background-color: #ff9800;
    border-radius: 8px;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.notice-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.notice-title {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.notice-title h3 {
    margin: 0;
    color: #4caf50;
    font-size: 1.4rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.notice-title span {
    font-size: 0.65rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: bold;
}

.notice-more {
    font-size: 0.8rem;
    color: #bbb;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    flex-shrink: 0;
}

.notice-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.notice-list li {
    display: flex;
    align-items: center;
    border-bottom: 1px dotted var(--notice-border-dotted);
    padding: 8px 0;
    font-size: 0.85rem;
    gap: 8px;
}

.notice-list li:last-child {
    border-bottom: none;
}

.notice-badge {
    width: 15px;
    height: 15px;
    background-color: #ff9800;
    color: white;
    font-size: 0.6rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    flex-shrink: 0;
}

.notice-badge.blue-badge {
    background-color: #fff;
    border: 2px solid #64b5f6;
    border-radius: 50%;
    color: transparent;
    width: 11px;
    height: 11px;
}

.notice-list a {
    flex-grow: 1;
    text-decoration: none;
    color: var(--text-link);
    transition: color 0.2s;
}

.notice-list a:hover {
    color: var(--primary-color);
}

.notice-date {
    color: #888;
    font-size: 0.8rem;
    flex-shrink: 0;
}

/* Panels */
.panel {
    border: 1px solid var(--panel-border);
    border-radius: 5px;
    overflow: hidden;
    background-color: var(--panel-bg);
}

.panel-header {
    background-color: var(--primary-color);
    color: white;
    padding: 8px 10px;
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.panel-body {
    background-color: var(--panel-bg);
}

.panel-body.no-padding {
    padding: 0;
    display: flex;
}

.panel-body.no-padding a {
    display: block;
    width: 100%;
    text-decoration: none;
}

.banner-group-vertical {
    flex-direction: column;
    gap: 4px;
}

.panel-body img {
    display: block;
    width: 100%;
    height: auto;
}

.policy-text {
    padding: 18px;
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--text-heading);
}

.policy-text strong {
    color: #d32f2f;
}

.footer-copyright {
    margin-top: 35px;
    margin-left: -45px;
    margin-right: -45px;
    padding: 12px 0;
    background-color: var(--footer-bg);
    border-top: 1px solid var(--footer-border);
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

.footer-copyright strong {
    color: var(--primary-color);
    font-weight: 700;
}

/* Slideshow */
.slideshow-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5;
    display: block !important;
    background: #0c1733;
    overflow: hidden;
}

.slideshow-wrapper a.slide-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    z-index: 1;
}

.slideshow-wrapper a.slide-item:first-child {
    position: absolute;
}

.slideshow-wrapper a.slide-item.active {
    opacity: 1;
    z-index: 2;
}

.slideshow-wrapper a.slide-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* ===== Quest Change Job Section ===== */
.quest-change-section {
    margin-top: 30px;
    padding: 0;
    background: transparent;
}

.quest-change-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 24px 14px;
    margin-bottom: 18px;
    border-bottom: 1px dashed #d6d3cd;
}

.quest-change-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #ffe082 0%, #ffb300 100%);
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(255, 152, 0, 0.3);
}

.quest-change-icon svg {
    width: 32px;
    height: 32px;
    color: #5d3a0a;
}

.quest-change-title-wrap h2 {
    margin: 0;
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: 2px;
}

.quest-change-title-wrap h2 .q-quest { color: #4a9ed8; }
.quest-change-title-wrap h2 .q-change { color: #d94545; }
.quest-change-title-wrap h2 .q-job { color: #4a9ed8; }

.quest-change-sub {
    margin: 4px 0 0;
    font-size: 0.85rem;
    color: #888;
    letter-spacing: 0.3px;
}

.quest-change-sub .q-class {
    color: #d94545;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.quest-change-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 18px;
    padding: 10px 12px 24px;
    border: 1px dashed #d6d3cd;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.55);
}

.box-job {
    display: block;
    padding: 14px 10px 14px;
    background: #ffffff;
    border: 1px solid #eee;
    border-radius: 10px;
    text-align: center;
    text-decoration: none;
    color: #333;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.box-job:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

.box-job img {
    width: auto;
    height: 90px;
    object-fit: contain;
    display: block;
    margin: 0 auto 10px;
}

.box-job .text-job {
    color: #d94545;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: 0.3px;
}

.box-job .name-job {
    color: #222;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

@media (max-width: 1100px) {
    .quest-change-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 768px) {
    .quest-change-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
    .quest-change-title-wrap h2 { font-size: 1.3rem; letter-spacing: 1px; }
    .quest-change-icon { width: 44px; height: 44px; }
    .quest-change-icon svg { width: 24px; height: 24px; }
}

@media (max-width: 480px) {
    .quest-change-grid { grid-template-columns: repeat(2, 1fr); }
    .box-job img { height: 72px; }
}

/* Sub Pages */
.sub-page {
    padding-bottom: 35px;
}

.sub-page h2 {
    margin: 0 0 8px;
    color: var(--text-heading);
    font-size: 1.5rem;
}

.sub-page .subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0 0 24px;
}

.form-panel {
    max-width: 520px;
    margin: 0 auto;
}

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

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-heading);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--panel-border);
    border-radius: 4px;
    font-size: 0.9rem;
    background: var(--panel-bg);
    color: var(--text-main);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-primary {
    display: inline-block;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    text-transform: uppercase;
}

.btn-primary:hover {
    opacity: 0.9;
}

.download-list {
    display: grid;
    gap: 16px;
}

.download-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border: 1px solid var(--panel-border);
    border-radius: 5px;
    background: var(--panel-bg);
}

.download-item h3 {
    margin: 0 0 4px;
    font-size: 1rem;
    color: var(--text-heading);
}

.download-item p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ===== Home Page Background ===== */
.home-page {
    position: relative;
}

.home-page::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: url('../../images/home-bg.jpg?v=2');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* ===== Download Page (new layout) ===== */
.download-page {
    margin-top: 60px;
    padding-top: 40px;
    position: relative;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.download-page::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: url('../../images/download-page-bg.jpg?v=5');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.download-page-wrap {
    position: relative;
    padding-top: 28px;
}

.download-banner {
    position: absolute;
    top: 0;
    left: 24px;
    z-index: 3;
}

.download-banner-shape {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 300px;
    height: 56px;
    padding: 0 70px 0 32px;
    background: linear-gradient(180deg, #5fb2e8 0%, #2079c2 100%);
    color: #fff;
    border-radius: 4px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -2px 0 rgba(0, 0, 0, 0.15),
        0 6px 14px rgba(31, 111, 179, 0.4);
    clip-path: polygon(0 0, calc(100% - 32px) 0, 100% 50%, calc(100% - 32px) 100%, 0 100%);
    outline: 2px solid #ffffff;
    outline-offset: -5px;
}

.download-banner-text {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 5px;
    text-transform: uppercase;
    text-shadow: 0 2px 3px rgba(0, 0, 0, 0.35);
}

.download-card {
    position: relative;
    background:
        linear-gradient(180deg, #ffffff 0%, #fbfaf5 100%);
    border: 1px solid #d8d4c4;
    border-radius: 12px;
    padding: 56px 36px 36px;
    margin-top: 28px;
    box-shadow:
        0 6px 20px rgba(60, 50, 30, 0.12),
        inset 0 0 0 1px rgba(255, 255, 255, 0.8);
}

body.dark-mode .download-card {
    background: linear-gradient(180deg, #232323 0%, #1a1a1a 100%);
    border-color: #3a3a3a;
}

/* ===== Rules Mini List (Homepage Panel) ===== */
.rules-mini-list {
    list-style: none;
    padding: 14px 18px 4px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rules-mini-list li {
    position: relative;
    padding: 8px 4px 8px 22px;
    font-size: 0.86rem;
    line-height: 1.5;
    color: var(--text-main);
    border-bottom: 1px dashed var(--notice-border-dotted);
}

.rules-mini-list li:last-child {
    border-bottom: none;
}

.rules-mini-list li::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 15px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d94545;
    box-shadow: 0 0 0 2px rgba(217, 69, 69, 0.18);
}

.rules-more-link {
    display: inline-block;
    margin: 0 18px 14px;
    font-size: 0.82rem;
    color: #1f6fb3;
    text-decoration: none;
    font-weight: 600;
}

.rules-more-link:hover {
    text-decoration: underline;
}

/* ===== Rules Page ===== */
.rules-page {
    margin-top: 60px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.rules-intro {
    margin: 0 0 24px;
    padding: 0 6px;
    font-size: 1.05rem;
    font-weight: 600;
    color: #1f6fb3;
    letter-spacing: 0.3px;
    border-left: 4px solid #4a9ed8;
    padding-left: 14px;
    line-height: 1.5;
}

.rules-section {
    margin-bottom: 32px;
}

.rules-section:last-child {
    margin-bottom: 0;
}

.rules-section-title {
    margin: 0 0 16px;
    padding: 12px 18px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(180deg, #5fb2e8 0%, #2079c2 100%);
    border-radius: 8px;
    border: 1px solid #1a5e98;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 2px 6px rgba(31, 111, 179, 0.2);
    letter-spacing: 0.5px;
}

.rules-section-strict .rules-section-title {
    background: linear-gradient(180deg, #e87a4a 0%, #c2541f 100%);
    border-color: #983e1a;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 2px 6px rgba(194, 84, 31, 0.2);
}

.rules-section-strict .rules-no {
    background: linear-gradient(180deg, #e87a4a 0%, #c2541f 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        0 3px 6px rgba(194, 84, 31, 0.3);
}

.rules-section-strict .rules-item {
    border-color: #f0d4c2;
    background: linear-gradient(180deg, #ffffff 0%, #fff7f2 100%);
}

.rules-section-strict .rules-item:hover {
    border-color: #e87a4a;
    box-shadow: 0 4px 12px rgba(194, 84, 31, 0.12);
}

.rules-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    counter-reset: rules-counter;
}

.rules-item {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding: 18px 20px;
    background: linear-gradient(180deg, #ffffff 0%, #f6faff 100%);
    border: 1px solid #d8e3ee;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(31, 111, 179, 0.06);
    transition: all 0.18s ease;
}

.rules-item:hover {
    border-color: #4a9ed8;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(31, 111, 179, 0.12);
}

.rules-no {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #5fb2e8 0%, #2079c2 100%);
    color: #ffffff;
    font-size: 1.15rem;
    font-weight: 700;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        0 3px 6px rgba(31, 111, 179, 0.3);
}

.rules-body {
    flex: 1;
    padding-top: 6px;
}

.rules-text {
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text-main);
}

/* ---- Sub items (9.1, 12.1, ...) ---- */
.rules-subs {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rules-sub {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(31, 111, 179, 0.04);
    border-left: 3px solid #b7d4ea;
    border-radius: 6px;
    line-height: 1.6;
    font-size: 0.95rem;
    color: var(--text-main);
}

.rules-section-strict .rules-sub {
    background: rgba(194, 84, 31, 0.05);
    border-left-color: #f0c2ab;
}

.rules-sub-no {
    flex-shrink: 0;
    font-weight: 700;
    color: #2079c2;
    min-width: 34px;
}

.rules-section-strict .rules-sub-no {
    color: #c2541f;
}

/* ---- Intro / footnote notes ---- */
.rules-note {
    margin: 0 0 16px;
    padding: 12px 16px;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #4a5b6b;
    background: #f5f9fd;
    border-radius: 8px;
    border: 1px dashed #cddceb;
}

.rules-note-foot {
    margin: 16px 0 0;
    font-style: italic;
}

.rules-section-strict .rules-note {
    background: #fff8f4;
    border-color: #f0d4c2;
}

/* ---- Bullet sections (penalties / warnings) ---- */
.rules-bullets {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rules-bullet {
    position: relative;
    padding: 16px 20px 16px 44px;
    background: linear-gradient(180deg, #ffffff 0%, #f6faff 100%);
    border: 1px solid #d8e3ee;
    border-radius: 10px;
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text-main);
    box-shadow: 0 2px 6px rgba(31, 111, 179, 0.06);
}

.rules-bullet::before {
    content: "";
    position: absolute;
    left: 18px;
    top: 22px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(180deg, #5fb2e8 0%, #2079c2 100%);
}

.rules-section-strict .rules-bullet {
    border-color: #f0d4c2;
    background: linear-gradient(180deg, #ffffff 0%, #fff7f2 100%);
}

.rules-section-strict .rules-bullet::before {
    background: linear-gradient(180deg, #e87a4a 0%, #c2541f 100%);
}

@media (max-width: 640px) {
    .rules-item {
        padding: 14px 14px;
        gap: 12px;
    }

    .rules-no {
        width: 34px;
        height: 34px;
        font-size: 1rem;
    }

    .rules-text {
        font-size: 0.92rem;
    }

    .rules-sub {
        font-size: 0.88rem;
        padding: 8px 12px;
    }

    .rules-bullet {
        font-size: 0.92rem;
        padding: 14px 14px 14px 40px;
    }
}

/* ===== Register Page ===== */
.register-page {
    max-width: 720px;
    margin: 60px auto 40px;
    position: relative;
    padding: 40px 16px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.register-page::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: url('../../images/register-bg.jpg?v=5');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.register-card {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(184, 212, 236, 0.6);
    border-radius: 14px;
    overflow: hidden;
    box-shadow:
        0 12px 36px rgba(40, 60, 100, 0.18),
        inset 0 0 0 1px rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.register-banner {
    background:
        linear-gradient(180deg, #6db8ec 0%, #2e87cd 50%, #2079c2 100%);
    color: #ffffff;
    padding: 16px 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    border-bottom: 1px solid rgba(31, 111, 179, 0.5);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        inset 0 -2px 0 rgba(0, 0, 0, 0.12);
}

.register-banner-text {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 5px;
    text-transform: uppercase;
    text-shadow: 0 2px 3px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

.register-banner-deco {
    width: 40px;
    height: 24px;
    color: rgba(255, 255, 255, 0.85);
    flex-shrink: 0;
}

.register-body {
    padding: 32px 36px 28px;
}

.register-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.reg-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}

.reg-row-full {
    grid-template-columns: 1fr;
}

.reg-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reg-field label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #3a7fb5;
}

.reg-field input {
    height: 42px;
    padding: 0 18px;
    background: #ffffff;
    border: 1.5px solid #b8d4ec;
    border-radius: 999px;
    font-size: 0.95rem;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
    font-family: inherit;
}

.reg-field input:focus {
    border-color: #2e87cd;
    box-shadow:
        inset 0 1px 2px rgba(0, 0, 0, 0.04),
        0 0 0 3px rgba(46, 135, 205, 0.15);
}

.reg-submit {
    display: flex;
    justify-content: center;
    margin-top: 8px;
}

.reg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 220px;
    height: 46px;
    padding: 0 36px;
    background: linear-gradient(180deg, #4a9ed8 0%, #1f6fb3 100%);
    color: #ffffff;
    border: 1px solid #1a5e98;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 4px 10px rgba(31, 111, 179, 0.3);
    transition: all 0.15s ease;
}

.reg-btn:hover {
    background: linear-gradient(180deg, #58aee5 0%, #2a7dc1 100%);
    transform: translateY(-1px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 6px 14px rgba(31, 111, 179, 0.4);
}

.reg-btn:active {
    transform: translateY(0);
}

.reg-note {
    text-align: center;
    font-size: 0.82rem;
    color: #d94545;
    margin: 4px 0 0;
}

.register-alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.88rem;
    margin-bottom: 18px;
    text-align: center;
}

.register-alert-info {
    background: #e3f2fd;
    border: 1px solid #90caf9;
    color: #1565c0;
}

.register-alert-error {
    background: #fdecea;
    border: 1px solid #f5b7b1;
    color: #c0392b;
}

body.dark-mode .register-card {
    background: rgba(30, 30, 30, 0.92);
    border-color: #3a3a3a;
}

body.dark-mode .reg-field input {
    background: #2a2a2a;
    border-color: #4a5560;
    color: var(--text-main);
}

body.dark-mode .reg-field label {
    color: #6db8ec;
}

.reg-gender {
    display: flex;
    gap: 20px;
    padding-top: 8px;
}

.reg-radio {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    cursor: pointer;
}

.reg-terms {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.reg-terms a {
    color: #2e87cd;
    font-weight: 600;
}

.reg-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
}

.field-status {
    font-size: 0.78rem;
    min-height: 1em;
}

.field-status.ok { color: #2e7d32; }
.field-status.err { color: #c0392b; }

.register-alert-success {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    color: #2e7d32;
}

/* CAPTCHA */
.captcha-block {
    position: relative;
    padding: 16px;
    border: 1px solid #b8d4ec;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.6);
}

.captcha-block.blurred .captcha-image {
    filter: blur(8px);
}

.captcha-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    z-index: 2;
}

.captcha-reveal-btn {
    background: #2e87cd;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.captcha-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.captcha-image {
    display: block;
    width: 240px;
    height: 80px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    image-rendering: auto;
}

.captcha-refresh-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #b8d4ec;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    font-size: 1.2rem;
    color: #2e87cd;
}

/* Member page */
.member-page {
    padding-bottom: 35px;
}

.member-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.member-header h1 {
    margin: 0 0 6px;
    font-size: 1.6rem;
    color: var(--text-heading);
}

.member-header p {
    margin: 0;
    color: var(--text-muted);
}

.member-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.member-cash {
    font-size: 0.95rem;
    color: var(--primary-color);
    font-weight: 600;
}

.btn-logout {
    display: inline-block;
    padding: 8px 16px;
    background: #c0392b;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}

.member-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.member-action-btn {
    padding: 14px 12px;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: var(--panel-bg);
    color: var(--text-heading);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.member-action-btn:hover {
    border-color: var(--primary-color);
    background: rgba(74, 103, 176, 0.08);
}

.member-table-wrap {
    overflow-x: auto;
    padding: 0 !important;
}

.member-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.member-table th,
.member-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--panel-border);
}

.member-table th {
    background: var(--footer-bg);
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.5px;
}

.member-loading,
.member-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 24px !important;
}

.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.online {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-badge.offline {
    background: #f5f5f5;
    color: #666;
}

/* Modals */
.member-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
}

.member-modal.hidden {
    display: none;
}

.member-modal-box {
    background: var(--container-bg);
    border-radius: 10px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.member-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.member-modal-head h3 {
    margin: 0;
    font-size: 1.1rem;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
}

.member-modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.member-modal-body .reg-field input,
.member-modal-body .reg-field select {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    border: 1.5px solid #b8d4ec;
    border-radius: 8px;
    font-family: inherit;
    background: var(--panel-bg);
    color: var(--text-main);
}

.modal-desc {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.member-modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 8px;
}

.btn-secondary {
    padding: 10px 18px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--panel-bg);
    cursor: pointer;
    font-weight: 600;
}

@media (max-width: 600px) {
    .reg-row {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .register-body {
        padding: 24px 20px 22px;
    }

    .reg-btn {
        min-width: 100%;
    }
}

.download-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    position: relative;
}

.download-columns::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: linear-gradient(180deg, transparent 0%, var(--panel-border) 20%, var(--panel-border) 80%, transparent 100%);
}

.download-col {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 0 6px;
}

.dl-item {
    display: flex;
    align-items: center;
    gap: 16px;
}

.dl-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: var(--text-main);
}

.dl-icon-pc {
    background: transparent;
    border: none;
    padding: 0;
    overflow: hidden;
    border-radius: 6px;
}

.dl-icon-pc img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    display: block;
    border-radius: 4px;
}

.dl-icon-pc svg {
    width: 28px;
    height: 28px;
}

.dl-icon-mobile {
    background: #ffffff;
    border: 1.5px solid #b0bcc8;
    color: #5f6b78;
}

.dl-icon-mobile svg {
    width: 22px;
    height: 28px;
}

.dl-info {
    flex: 1;
    min-width: 0;
}

.dl-title {
    margin: 0 0 2px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-heading);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.dl-desc {
    margin: 0;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.dl-note {
    margin: 2px 0 0;
    font-size: 0.75rem;
    color: #d94545;
    font-style: italic;
}

.dl-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    height: 38px;
    padding: 0 22px;
    background: linear-gradient(180deg, #4a9ed8 0%, #1f6fb3 100%);
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 1.5px;
    border: 1px solid #1a5e98;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(31, 111, 179, 0.25);
    transition: all 0.15s ease;
}

.dl-btn:hover {
    background: linear-gradient(180deg, #58aee5 0%, #2a7dc1 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(31, 111, 179, 0.35);
}

.dl-btn:active {
    transform: translateY(0);
}

body.dark-mode .download-card {
    background: var(--container-bg);
}

body.dark-mode .dl-icon-pc {
    background: #3a2f1a;
    border-color: #6e5a30;
    color: #e8c89a;
}

body.dark-mode .dl-icon-mobile {
    background: #2a2f35;
    border-color: #4a5560;
    color: #aab4be;
}

.alert-info {
    padding: 12px 16px;
    background: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #1565c0;
    margin-bottom: 20px;
}

body.dark-mode .alert-info {
    background: #1a237e;
    border-color: #3949ab;
    color: #90caf9;
}

/* Responsive */
@media (max-width: 960px) {
    .content-grid {
        grid-template-columns: 1fr;
    }

    .topbar-inner {
        flex-wrap: wrap;
        gap: 12px;
    }

    .nav-menu {
        gap: 10px;
    }

    .main-container {
        padding: 24px 20px 0;
    }

    .footer-copyright {
        margin-left: -20px;
        margin-right: -20px;
    }
}

@media (max-width: 640px) {
    .page-header {
        flex-direction: column;
    }

    .page-actions {
        align-items: flex-start;
    }

    .headline h1 {
        font-size: 1.4rem;
    }

    .notice-list li {
        flex-wrap: wrap;
    }

    .notice-date {
        width: 100%;
        padding-left: 23px;
    }

    .download-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .download-columns {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .download-columns::before {
        left: 0;
        right: 0;
        top: 50%;
        bottom: auto;
        width: auto;
        height: 1px;
        background: linear-gradient(90deg, transparent 0%, var(--panel-border) 20%, var(--panel-border) 80%, transparent 100%);
    }

    .dl-item {
        flex-wrap: wrap;
    }

    .dl-btn {
        min-width: 100px;
        padding: 0 16px;
    }
}
