/* ThreeRice - White + Black Buttons + Orange Accents */
:root {
    --accent: #f97316;
    --accent-dark: #ea580c;
    --accent-glow: rgba(249, 115, 22, 0.2);
    --accent-light: rgba(249, 115, 22, 0.08);
    --accent-border: rgba(249, 115, 22, 0.3);
    --btn: #0a0a0a;
    --btn-hover: #262626;
    --text: #111827;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --bg: #ffffff;
    --bg-card: #ffffff;
    --bg-elevated: #f9fafb;
    --bg-subtle: #f3f4f6;
    --white: #ffffff;
    --black: #0a0a0a;
    --shadow: 0 1px 3px rgba(0,0,0,.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,.1);
    --radius: 8px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
}

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

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

.site-area {
    display: flex;
    max-width: 1600px;
    min-height: 360px;
    margin-left: auto;
    margin-right: auto;
    padding: 30px 30px 0;
    width: 100%;
}

.site-content {
    flex-direction: column;
    margin-top: 20px;
}

.site-header .site-area {
    min-height: auto;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 24px;
}

.site-footer .site-area {
    min-height: auto;
    flex-direction: column;
    padding-bottom: 30px;
}

.site-content.site-area {
    padding-top: 20px;
}

.site-content .container {
    max-width: 100%;
    margin: 0;
    padding: 0;
    width: 100%;
}

/* Header */
.site-header {
    background: var(--white);
    border-bottom: 1px solid #d1d5db;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
}

.header-inner {
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: inline-flex;
    align-items: center;
    line-height: 0;
}

.logo img {
    height: 38px;
    width: auto;
    display: block;
    border-radius: 6px;
}

.footer-logo {
    display: inline-block;
    margin-bottom: 12px;
    line-height: 0;
}

.footer-logo img {
    height: 32px;
    width: auto;
    display: block;
    border-radius: 6px;
}

.auth-logo {
    display: block;
    text-align: center;
    margin-bottom: 20px;
    line-height: 0;
}

.auth-logo img {
    height: 38px;
    width: auto;
    border-radius: 6px;
}

.nav-main { display: flex; align-items: center; gap: 24px; }

.nav-links { display: flex; align-items: center; gap: 20px; }

.nav-links a {
    color: var(--text);
    font-size: 16px;
    font-weight: 500;
}

.nav-links a:hover { color: var(--accent); }
.nav-links a.btn-accent,
.nav-links a.btn-accent:hover { color: var(--white); }

/* Explore dropdown */
.dropdown { position: relative; }
.dropdown-toggle {
    cursor: pointer;
    color: var(--text);
    font-size: 16px;
    font-weight: 500;
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 4px;
}
.dropdown-toggle:hover { color: var(--accent); }
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 8px 0;
    z-index: 200;
}
.dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu a {
    display: block;
    padding: 10px 16px;
    color: var(--text);
    font-size: 14px;
}
.dropdown-menu a:hover { background: var(--bg-elevated); color: var(--accent); }

.btn {
    display: inline-block;
    padding: 8px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all .2s;
}
.btn-primary { background: var(--btn); color: var(--white); }
.btn-primary:hover { background: var(--btn-hover); color: var(--white); }
.btn-accent { background: var(--accent); color: var(--white); }
.btn-accent:hover { background: var(--accent-dark); color: var(--white); }
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}
.btn-outline:hover { border-color: var(--black); color: var(--black); }
.btn-lg { padding: 12px 28px; font-size: 16px; }

.user-greeting { font-size: 14px; color: var(--text-muted); }

/* Search */
.search-section {
    position: relative;
    padding: 40px 0 56px;
    border-radius: 20px;
    overflow: hidden;
}
.search-section-bg {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    overflow: hidden;
    z-index: 0;
}
.search-bg-slide {
    position: absolute;
    inset: 0;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1.4s ease-in-out;
}
.search-bg-slide.is-active {
    opacity: 1;
}
.search-section::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
    background:
        radial-gradient(ellipse 80% 60% at 50% 40%, rgba(0, 30, 45, 0.25) 0%, rgba(0, 15, 25, 0.55) 100%),
        linear-gradient(to bottom, rgba(0, 10, 20, 0.35) 0%, rgba(0, 20, 35, 0.5) 100%);
    pointer-events: none;
}
.search-section .container {
    position: relative;
    z-index: 2;
}
.search-section h1 {
    color: #fff;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}
.search-section .catalogue-tabs a,
.search-section .catalogue-tabs .catalogue-tab {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.22);
    color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.search-section .catalogue-tabs a:hover,
.search-section .catalogue-tabs .catalogue-tab:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}
.search-section .catalogue-tabs a.active,
.search-section .catalogue-tabs .catalogue-tab.active {
    background: rgba(255, 255, 255, 0.92);
    color: var(--text);
    border-color: transparent;
}
.search-section .search-form input {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}
.search-section .search-form button {
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    background: rgba(10, 10, 10, 0.88);
    color: #fff;
    letter-spacing: 0.04em;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    transition: background .2s, border-color .2s, box-shadow .2s, transform .15s;
}
.search-section .search-form button:hover {
    background: rgba(10, 10, 10, 0.96);
    border-color: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
}
@media (min-width: 641px) {
    .search-section .search-catalogue-tabs {
        max-width: 640px;
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 25px;
    }
    .search-section .search-catalogue-tabs .catalogue-tab {
        padding: 7px 16px;
        font-size: 14px;
    }
}
.search-form {
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    gap: 8px;
}
.search-form input {
    flex: 1;
    padding: 14px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    outline: none;
    background: var(--white);
    color: var(--text);
}
.search-form button {
    padding: 14px 28px;
    background: var(--btn);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
.search-form button:hover { background: var(--btn-hover); }

/* Catalogue tabs */
.search-catalogue-tabs {
    margin-bottom: 24px;
}
.catalogue-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 8px;
}
.catalogue-tabs a,
.catalogue-tabs .catalogue-tab {
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--white);
    border: 1px solid var(--border);
}
.catalogue-tabs .catalogue-tab {
    cursor: pointer;
    font-family: inherit;
    line-height: 1.4;
}
.catalogue-tabs a:hover,
.catalogue-tabs .catalogue-tab:hover { border-color: var(--accent); color: var(--accent); }
.catalogue-tabs a.active,
.catalogue-tabs .catalogue-tab.active {
    background: var(--btn);
    color: var(--white);
    border-color: var(--btn);
}
.search-section .search-catalogue-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    touch-action: pan-x;
    cursor: grab;
}
.search-section .search-catalogue-tabs.is-dragging {
    cursor: grabbing;
    user-select: none;
}
.search-section .search-catalogue-tabs::-webkit-scrollbar {
    display: none;
}
.search-section .search-catalogue-tabs .catalogue-tabs {
    display: inline-flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
    width: max-content;
    min-width: 100%;
    margin-bottom: 0;
    gap: 8px;
}
.search-section .search-catalogue-tabs .catalogue-tab,
.search-section .search-catalogue-tabs a {
    flex: 0 0 auto;
    white-space: nowrap;
}

/* Material grid */
.materials-section { padding: 24px 0 48px; }
.material-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}
.material-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .2s, box-shadow .2s, border-color .2s;
}
.material-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}
.material-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    background: var(--bg-subtle);
}
.material-card-body { padding: 14px; }
.material-card-body h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.4;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.material-card-body .price {
    font-size: 15px;
    font-weight: 700;
    color: var(--accent);
}
.material-card-body .meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Footer */
.site-footer {
    background: var(--bg-elevated);
    color: var(--text-muted);
    margin-top: 40px;
    border-top: 1px solid var(--border);
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 32px;
    margin-bottom: 32px;
}
.footer-grid h4 {
    color: var(--text);
    font-size: 14px;
    margin-bottom: 16px;
}
.footer-grid ul { list-style: none; }
.footer-grid li { margin-bottom: 8px; }
.footer-grid a { color: var(--text-muted); font-size: 14px; }
.footer-grid a:hover { color: var(--accent); }
.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 24px;
    text-align: center;
    font-size: 13px;
}

/* Detail page */
.detail-page { padding: 0 0 40px; }
.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 520px) minmax(0, 1fr);
    gap: 48px;
    align-items: start;
}
.detail-gallery-wrap {
    position: sticky;
    top: 100px;
}
.detail-gallery {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.detail-gallery-stage {
    position: relative;
    background: var(--bg-subtle);
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
}
.detail-gallery-main {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: var(--bg-subtle);
}
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    z-index: 2;
    transition: all .2s;
}
.gallery-nav:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
}
.gallery-nav:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.gallery-prev { left: 12px; }
.gallery-next { right: 12px; }
.detail-gallery-footer {
    padding: 12px 14px 14px;
    border-top: 1px solid var(--border);
    background: var(--white);
}
.gallery-counter {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-align: center;
}
.detail-gallery-thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
}
.gallery-thumb {
    flex: 0 0 auto;
    width: 72px;
    height: 54px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    background: var(--bg-subtle);
    transition: border-color .2s;
}
.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.gallery-thumb:hover { border-color: rgba(249, 115, 22, 0.45); }
.gallery-thumb.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.15);
}
.detail-cover {
    width: 100%;
    max-width: 320px;
    max-height: 240px;
    object-fit: cover;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: var(--bg-subtle);
}
.detail-info h1 { font-size: 28px; margin-bottom: 12px; }
.detail-info .category-tag {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(249, 115, 22, 0.15);
    color: var(--accent);
    border: 1px solid rgba(249, 115, 22, 0.3);
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 16px;
}
.detail-info .desc {
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.8;
}
.detail-meta {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
    font-size: 14px;
    color: var(--text-muted);
}
.detail-price {
    font-size: 32px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 24px;
}
.material-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--white);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
    line-height: 1;
}
button.action-btn { font-family: inherit; }
a.action-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.action-btn.is-active {
    border-color: var(--accent);
    background: rgba(249, 115, 22, 0.08);
    color: var(--accent);
}
.like-btn.is-active .action-icon { color: #ef4444; }
.favorite-btn.is-active .action-icon { color: var(--accent); }
.action-icon { font-size: 16px; line-height: 1; }
.action-count {
    min-width: 18px;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--bg-elevated);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}
.action-btn.is-active .action-count {
    background: rgba(249, 115, 22, 0.15);
    color: var(--accent);
}
.comments-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
.detail-info .comments-section {
    margin-top: 28px;
}
.detail-info .comments-title {
    font-size: 18px;
    margin-bottom: 16px;
}
.detail-info .comment-form {
    margin-bottom: 20px;
}
.detail-info .comment-list {
    max-height: 420px;
    overflow-y: auto;
    padding-right: 4px;
}
.detail-info .comment-empty {
    padding: 20px 0;
}
.comments-title {
    font-size: 22px;
    margin-bottom: 20px;
}
.comments-count {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-muted);
}
.comment-form {
    margin-bottom: 32px;
}
.comment-form textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 12px;
    outline: none;
    background: var(--white);
    color: var(--text);
}
.comment-form textarea:focus { border-color: var(--accent); }
.comment-login-hint {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
}
.comment-list { display: flex; flex-direction: column; gap: 16px; }
.comment-item {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
}
.comment-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
.comment-author { font-size: 14px; color: var(--text); }
.comment-time { font-size: 12px; color: var(--text-muted); }
.comment-body {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-muted);
    white-space: pre-wrap;
    word-break: break-word;
}
.comment-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    padding: 32px 0;
}
.pay-methods { display: flex; gap: 12px; flex-wrap: wrap; }
.pay-methods .btn { min-width: 140px; text-align: center; }
.btn-paypal { background: #0070ba; color: var(--white); }
.btn-paypal:hover { background: #005ea6; color: var(--white); }
.btn-airwallex { background: #612fff; color: var(--white); }
.btn-airwallex:hover { background: #4f25d4; color: var(--white); }

/* Invite & referral */
.invite-page { padding: 40px 0; }
.invite-page h1 { font-size: 28px; margin-bottom: 8px; }
.invite-desc { color: var(--text-muted); margin-bottom: 32px; }
.invite-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}
.points-balance-box {
    background: var(--white);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    color: var(--text);
    padding: 32px;
    border-radius: var(--radius);
    text-align: center;
    margin-bottom: 32px;
    box-shadow: var(--shadow);
}
.points-earn-hint {
    font-size: 14px;
    color: var(--accent);
    margin-bottom: 16px;
    padding: 8px 12px;
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid rgba(249, 115, 22, 0.25);
    border-radius: var(--radius);
    display: inline-block;
}
.invite-stat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.invite-share-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}
.share-input-group input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--white);
    color: var(--text);
}
.share-earn-box {
    margin-top: 24px;
    padding: 16px;
    background: rgba(249, 115, 22, 0.08);
    border: 1px solid rgba(249, 115, 22, 0.2);
    border-radius: var(--radius);
    font-size: 14px;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.data-table th { background: var(--bg-elevated); font-weight: 600; color: var(--text-muted); }
.legal-text {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    line-height: 1.8;
    font-size: 14px;
    margin-bottom: 24px;
    white-space: pre-wrap;
}
.legal-highlight-box {
    background: rgba(249, 115, 22, 0.08);
    border: 1px solid rgba(249, 115, 22, 0.25);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}
.legal-highlight-box h3 { margin-bottom: 12px; color: var(--accent); }
.license-badge-box {
    background: rgba(249, 115, 22, 0.06);
    border: 1px solid rgba(249, 115, 22, 0.25);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 20px;
}
.license-shield {
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
}
.license-highlights { font-size: 13px; padding-left: 20px; color: var(--accent-dark); margin-bottom: 8px; }
.license-accept {
    display: block;
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--bg-elevated);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    color: var(--text-muted);
}
.certificate-card {
    background: var(--bg-card);
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.cert-header {
    background: var(--bg-elevated);
    border-bottom: 3px solid var(--accent);
    color: var(--text);
    padding: 32px;
    text-align: center;
}
.cert-footer { background: var(--bg-elevated); padding: 16px; text-align: center; font-size: 13px; color: var(--text-muted); }
.my-rank-box {
    background: rgba(249, 115, 22, 0.08);
    border: 1px solid rgba(249, 115, 22, 0.25);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 24px;
    font-size: 15px;
}
.rank-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}
.rank-table th { background: var(--bg-elevated); font-weight: 600; color: var(--text-muted); }
.rank-table tr.rank-top { background: rgba(249, 115, 22, 0.1); }
.chain-valid-badge {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
    margin-left: 8px;
}
.chain-step-done:not(:last-child)::before { background: var(--accent); }
.chain-step-done .chain-marker { background: var(--accent); color: #fff; }
.chain-content {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 16px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.download-record {
    background: var(--bg-elevated);
    padding: 10px 12px;
    border-radius: 6px;
    margin-top: 8px;
    font-size: 13px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.chain-footer-box {
    background: rgba(249, 115, 22, 0.06);
    border: 1px solid rgba(249, 115, 22, 0.2);
    border-radius: var(--radius);
    padding: 20px;
    font-size: 14px;
    line-height: 1.7;
}
.chain-footer-box code {
    display: block;
    margin-top: 8px;
    padding: 8px;
    background: var(--bg-elevated);
    border-radius: 4px;
    font-size: 12px;
    word-break: break-all;
    color: var(--accent);
}
.verify-form input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--white);
    color: var(--text);
}
.verify-valid { background: rgba(249, 115, 22, 0.08); border: 1px solid rgba(249, 115, 22, 0.3); }
.verify-note { margin-top: 16px; font-size: 14px; color: var(--accent-dark); }
.auth-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
}
.form-group label { color: var(--text); }
.form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    outline: none;
    background: var(--white);
    color: var(--text);
}
.form-group input:focus { border-color: var(--accent); }
.pagination a, .pagination span {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 2px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 14px;
    color: var(--text);
    background: var(--bg-card);
}
.points-balance-box .label { display: block; font-size: 14px; opacity: 0.9; }
.points-balance-box .value { display: block; font-size: 48px; font-weight: 700; margin: 8px 0; color: var(--accent); }
.points-balance-box .hint { font-size: 13px; opacity: 0.85; }
.invite-stat .label { display: block; font-size: 13px; color: var(--text-muted); }
.invite-stat .value { display: block; font-size: 24px; font-weight: 700; color: var(--accent); margin-top: 4px; }
.invite-share-box h3 { margin-bottom: 16px; font-size: 18px; }
.share-input-group { display: flex; gap: 8px; }
.share-hint { margin-top: 12px; font-size: 13px; color: var(--text-muted); }
.invite-nav-links { display: flex; gap: 12px; flex-wrap: wrap; }
.share-earn-box p { margin-bottom: 12px; color: var(--text-muted); }
.data-table th, .data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.legal-page { padding: 40px 0; }
.legal-content { max-width: 800px; }
.legal-content h1 { font-size: 28px; margin-bottom: 8px; }
.legal-meta { color: var(--text-muted); margin-bottom: 24px; font-size: 14px; }
.legal-intro { color: var(--text-muted); margin-bottom: 24px; line-height: 1.8; }
.legal-highlight-box ul { padding-left: 20px; line-height: 2; }
.legal-steps { padding-left: 24px; line-height: 2; margin-bottom: 24px; }
.license-badge { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.license-summary { font-size: 14px; color: var(--text-muted); margin-bottom: 8px; }
.license-highlights li { margin-bottom: 4px; }
.license-links { font-size: 13px; }
.license-accept input { margin-right: 8px; vertical-align: top; margin-top: 3px; }
.purchase-form .pay-methods button { cursor: pointer; border: none; }
.cert-link { margin-top: 12px; font-size: 14px; }
.cert-header h1 { font-size: 24px; margin-bottom: 8px; }
.cert-no { font-size: 18px; font-family: monospace; letter-spacing: 1px; }
.cert-body { padding: 32px; }
.cert-table { width: 100%; margin: 20px 0; border-collapse: collapse; }
.cert-table th, .cert-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; font-size: 14px; }
.cert-table th { width: 180px; color: var(--text-muted); font-weight: 500; }
.cert-terms h3 { font-size: 16px; margin: 16px 0 8px; }
.cert-terms p { font-size: 14px; color: var(--text-muted); line-height: 1.7; }
.cert-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 20px 0; }
.rank-page { padding: 40px 0; }
.rank-page h1 { font-size: 28px; margin-bottom: 8px; }
.rank-desc { color: var(--text-muted); margin-bottom: 24px; line-height: 1.7; }
.rank-table th, .rank-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.rank-num { font-weight: 700; width: 60px; text-align: center; font-size: 16px; }
.rank-score { font-weight: 700; color: var(--accent); font-size: 16px; }
.rank-empty { text-align: center; color: var(--text-muted); padding: 32px !important; }
.rank-nav { display: flex; gap: 12px; flex-wrap: wrap; }
.cert-no-display { font-size: 16px; margin-bottom: 24px; }
.chain-hash { font-family: monospace; font-size: 12px; word-break: break-all; color: var(--accent); }
.legal-actions-bar { display: flex; gap: 12px; margin-bottom: 20px; }
.auth-chain { position: relative; padding-left: 8px; margin-bottom: 32px; }
.chain-step {
    display: flex;
    gap: 20px;
    margin-bottom: 0;
    padding-bottom: 28px;
    position: relative;
}
.chain-step:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 19px;
    top: 40px;
    bottom: 0;
    width: 2px;
    background: var(--border);
}
.chain-marker {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-elevated);
    color: var(--text-muted);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    z-index: 1;
}
.chain-content h3 { font-size: 16px; margin-bottom: 6px; }
.chain-content p { font-size: 14px; color: var(--text-muted); margin-bottom: 8px; }
.chain-meta { list-style: none; font-size: 13px; color: var(--text-muted); line-height: 1.8; }
.download-record strong { color: var(--accent); font-family: monospace; }
.chain-empty { font-size: 13px; color: var(--text-muted); font-style: italic; }
.verify-form { display: flex; gap: 8px; margin-bottom: 32px; max-width: 560px; }
.verify-result { padding: 24px; border-radius: var(--radius); margin-top: 16px; }
.verify-invalid { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); }
.verify-result h2 { font-size: 20px; margin-bottom: 16px; }
.auth-page {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}
.auth-box h2 { text-align: center; margin-bottom: 24px; font-size: 24px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.auth-box .btn { width: 100%; margin-top: 8px; }
.auth-link { text-align: center; margin-top: 16px; font-size: 14px; color: var(--text-muted); }
.pagination { text-align: center; padding: 24px 0; }
.search-form input { background: var(--white); color: var(--text); border: 1px solid var(--border); }

.pagination .current {
    background: var(--btn);
    color: var(--white);
    border-color: var(--btn);
}

/* Checkout */
.checkout-page { padding: 0 0 40px; }
.checkout-page h1 { font-size: 28px; margin-bottom: 8px; }
.checkout-desc { color: var(--text-muted); margin-bottom: 32px; }
.checkout-summary {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: var(--shadow);
}
.checkout-cover {
    width: 160px;
    height: 120px;
    object-fit: cover;
    border-radius: var(--radius);
    background: var(--bg-subtle);
    flex-shrink: 0;
}
.checkout-info h2 { font-size: 20px; margin-bottom: 12px; }
.checkout-form h3 { font-size: 16px; margin-bottom: 16px; }
.checkout-form .pay-methods { margin-bottom: 24px; }
.checkout-back { font-size: 14px; color: var(--text-muted); }

/* Message / redirect page */
.message-page {
    min-height: 360px;
    justify-content: center;
    align-items: center;
}
.message-box {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 48px 40px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}
.message-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
}
.message-success {
    background: rgba(249, 115, 22, 0.12);
    color: var(--accent);
    border: 2px solid rgba(249, 115, 22, 0.3);
}
.message-error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 2px solid rgba(239, 68, 68, 0.25);
}
.message-title {
    font-size: 24px;
    margin-bottom: 12px;
    color: var(--text);
}
.message-text {
    font-size: 16px;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 20px;
}
.message-jump {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
}
.message-box .btn {
    min-width: 160px;
}

/* Responsive */
@media (max-width: 1024px) {
    .material-grid { grid-template-columns: repeat(3, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .detail-layout { grid-template-columns: 1fr; }
    .detail-gallery-wrap { position: static; }
}
@media (max-width: 640px) {
    .site-area {
        padding: 10px 10px 0;
    }
    .material-grid { grid-template-columns: repeat(2, 1fr); }
    .invite-stats { grid-template-columns: repeat(2, 1fr); }
    .header-inner { flex-wrap: wrap; height: auto; padding: 12px 10px; }
    .nav-main { gap: 12px; }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-grid ul {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px 16px;
    }
    .footer-grid li { margin-bottom: 0; }
    .checkout-summary { flex-direction: column; }
    .checkout-cover { width: 100%; height: 180px; }
    .search-section .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    .site-content {
        margin-top: 12px;
    }
    .search-section {
        padding-top: 28px;
        padding-bottom: 40px;
    }
    .search-section .search-catalogue-tabs {
        margin-left: -15px;
        margin-right: -15px;
        padding-left: 15px;
        padding-right: 15px;
        margin-bottom: 0;
    }
    .search-section .search-form {
        margin-top: 15px;
    }
}
