/* ThaiTan Web Portal - Google Material Design 3 (M3) Design System */

:root {
    --md-sys-color-primary: #1a73e8;
    --md-sys-color-primary-hover: #1557b0;
    --md-sys-color-primary-active: #0d47a1;
    --md-sys-color-on-primary: #ffffff;
    --md-sys-color-primary-container: #e8f0fe;
    --md-sys-color-on-primary-container: #174ea6;

    --md-sys-color-surface: #ffffff;
    --md-sys-color-surface-dim: #f8f9fa;
    --md-sys-color-surface-container: #ffffff;
    --md-sys-color-surface-container-high: #f1f3f4;
    --md-sys-color-outline: #dadce0;
    --md-sys-color-outline-variant: #e8eaed;

    --md-sys-color-text-primary: #202124;
    --md-sys-color-text-secondary: #5f6368;
    --md-sys-color-text-tertiary: #80868b;

    --md-sys-color-success: #137333;
    --md-sys-color-success-container: #e6f4ea;
    --md-sys-color-on-success-container: #0d652d;

    --md-sys-color-magenta: #c71585;
    --md-sys-color-magenta-container: #fce4ec;

    --font-family: "Pretendard Variable", Pretendard, "Sarabun", -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
    --font-thai: "Sarabun", "Pretendard Variable", Pretendard, sans-serif;
    --nav-height: 94px;
    --max-width: 1120px;

    --shadow-sm: 0 1px 2px rgba(60,64,67,0.1), 0 1px 3px 1px rgba(60,64,67,0.06);
    --shadow-md: 0 2px 6px 2px rgba(60,64,67,0.12), 0 1px 2px rgba(60,64,67,0.2);
    --shadow-lg: 0 4px 12px 4px rgba(60,64,67,0.15), 0 1px 3px rgba(60,64,67,0.3);
}

@media (prefers-color-scheme: dark) {
    :root {
        --md-sys-color-primary: #8ab4f8;
        --md-sys-color-primary-hover: #aecbfa;
        --md-sys-color-primary-active: #d2e3fc;
        --md-sys-color-on-primary: #041e49;
        --md-sys-color-primary-container: #1e3a5f;
        --md-sys-color-on-primary-container: #d2e3fc;

        --md-sys-color-surface: #1e1f20;
        --md-sys-color-surface-dim: #131314;
        --md-sys-color-surface-container: #282a2c;
        --md-sys-color-surface-container-high: #333538;
        --md-sys-color-outline: #3c4043;
        --md-sys-color-outline-variant: #494c50;

        --md-sys-color-text-primary: #e8eaed;
        --md-sys-color-text-secondary: #9aa0a6;
        --md-sys-color-text-tertiary: #80868b;

        --md-sys-color-success: #81c995;
        --md-sys-color-success-container: #133820;
        --md-sys-color-on-success-container: #ceead6;

        --shadow-sm: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
        --shadow-md: 0 2px 6px rgba(0,0,0,0.5), 0 1px 2px rgba(0,0,0,0.4);
        --shadow-lg: 0 4px 16px rgba(0,0,0,0.6);
    }
}

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

body {
    font-family: var(--font-family);
    background-color: var(--md-sys-color-surface-dim);
    color: var(--md-sys-color-text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Explicit Thai Font Application */
.thai-demo-text,
.word-thai,
.thai-badge,
.thai-quote,
.origin-thai,
.tier-thai,
.hl-segment,
[lang="th"] {
    font-family: var(--font-thai) !important;
}

a {
    color: var(--md-sys-color-primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--md-sys-color-primary-hover);
}

/* Navigation Bar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--nav-height);
    background-color: var(--md-sys-color-surface);
    border-bottom: 1px solid var(--md-sys-color-outline);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(8px);
}

.nav-container {
    width: 100%;
    max-width: var(--max-width);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-logo-img {
    height: 75px;
    width: auto;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 28px;
    list-style: none;
}

.nav-item a {
    color: var(--md-sys-color-text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: color 0.15s ease;
}

.nav-item a:hover,
.nav-item a.active {
    color: var(--md-sys-color-primary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Material Design Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 9999px;
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background-color: var(--md-sys-color-primary-hover);
    box-shadow: var(--shadow-md);
    color: var(--md-sys-color-on-primary);
}

.btn-tonal {
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
}

.btn-tonal:hover {
    background-color: #d7e4fd;
    color: var(--md-sys-color-on-primary-container);
}

.btn-outlined {
    background: transparent;
    border: 1px solid var(--md-sys-color-outline);
    color: var(--md-sys-color-text-primary);
}

.btn-outlined:hover {
    background-color: var(--md-sys-color-surface-container-high);
    border-color: var(--md-sys-color-outline);
}

.btn-sm {
    padding: 7px 16px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.svg-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
    flex-shrink: 0;
}

/* Hero Section */
.hero-section {
    padding: 64px 24px 72px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: linear-gradient(180deg, var(--md-sys-color-surface) 0%, var(--md-sys-color-surface-dim) 100%);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    font-size: 13px;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 9999px;
    margin-bottom: 24px;
}

.hero-title {
    font-size: 44px;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.8px;
    color: var(--md-sys-color-text-primary);
    max-width: 820px;
    margin-bottom: 20px;
}

.hero-title span.highlight {
    color: var(--md-sys-color-primary);
}

.hero-subtitle {
    font-size: 18px;
    color: var(--md-sys-color-text-secondary);
    max-width: 680px;
    line-height: 1.6;
    margin-bottom: 36px;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 40px;
}

.hero-stats-badge {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 12px 24px;
    background-color: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-num {
    font-size: 20px;
    font-weight: 700;
    color: var(--md-sys-color-primary);
}

.stat-desc {
    font-size: 12px;
    color: var(--md-sys-color-text-secondary);
}

.stat-divider {
    width: 1px;
    height: 28px;
    background-color: var(--md-sys-color-outline);
}

/* Live Demo Interactive Comparison Card */
.demo-section {
    padding: 72px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.section-header {
    text-align: center;
    max-width: 640px;
    margin-bottom: 48px;
}

.section-label {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--md-sys-color-primary);
    margin-bottom: 8px;
}

.section-title {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
}

.section-desc {
    font-size: 16px;
    color: var(--md-sys-color-text-secondary);
}

.demo-card-container {
    width: 100%;
    max-width: var(--max-width);
    background-color: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: 24px;
    padding: 32px;
    box-shadow: var(--shadow-md);
}

.demo-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--md-sys-color-outline);
    padding-bottom: 12px;
}

.demo-tab-btn {
    background: none;
    border: none;
    font-family: var(--font-family);
    font-size: 15px;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--md-sys-color-text-secondary);
    transition: all 0.15s ease;
}

.demo-tab-btn.active {
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
}

.demo-content-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}

.demo-col {
    background-color: var(--md-sys-color-surface-dim);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 16px;
    padding: 24px;
}

.demo-col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.demo-col-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--md-sys-color-text-primary);
}

.badge-tag {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 100px;
}

.badge-legacy {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-thaitan {
    background-color: var(--md-sys-color-success-container);
    color: var(--md-sys-color-on-success-container);
}

.thai-demo-text {
    font-family: "Sarabun", var(--font-family);
    font-size: 20px;
    line-height: 1.8;
    color: #111;
    margin-bottom: 16px;
}

.thaitan-segmented-demo {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.word-chip {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    background: #ffffff;
    border: 1px solid #c71585;
    border-radius: 8px;
    padding: 6px 10px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.word-thai {
    font-family: "Sarabun", sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #c71585;
}

.word-meaning {
    font-size: 11px;
    font-weight: 600;
    color: #374151;
    margin-top: 2px;
}

.word-pron {
    font-size: 10px;
    color: #6b7280;
}

.korean-trans-text {
    font-size: 14px;
    color: #4b5563;
    padding: 12px;
    background: #ffffff;
    border-radius: 8px;
    border-left: 3px solid var(--md-sys-color-primary);
}

/* Features Grid */
.features-section {
    padding: 72px 24px;
    background-color: var(--md-sys-color-surface);
    border-top: 1px solid var(--md-sys-color-outline-variant);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    max-width: var(--max-width);
    margin: 0 auto;
}

.feature-card {
    background-color: var(--md-sys-color-surface-dim);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 20px;
    padding: 28px 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.feature-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}

.feature-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--md-sys-color-text-primary);
}

.feature-desc {
    font-size: 14px;
    color: var(--md-sys-color-text-secondary);
    line-height: 1.5;
}

/* Bottom CTA Banner */
.cta-section {
    padding: 80px 24px;
    text-align: center;
    background: linear-gradient(135deg, #1a73e8 0%, #1557b0 100%);
    color: #ffffff;
}

.cta-title {
    font-size: 34px;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.cta-subtitle {
    font-size: 17px;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 36px auto;
    line-height: 1.5;
}

.btn-white {
    background-color: #ffffff;
    color: #1a73e8;
    box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}

.btn-white:hover {
    background-color: #f8f9fa;
    color: #1557b0;
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

/* Footer */
.footer {
    background-color: var(--md-sys-color-surface);
    border-top: 1px solid var(--md-sys-color-outline);
    padding: 40px 24px;
    font-size: 13px;
    color: var(--md-sys-color-text-secondary);
}

.footer-container {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

@media (max-width: 768px) {
    .navbar { height: auto; padding: 10px 0; }
    .nav-logo-img { height: 52px; max-width: 220px; }
    .hero-title { font-size: 30px; }
    .hero-subtitle { font-size: 16px; }
    .demo-content-box { grid-template-columns: 1fr; }
    .nav-menu { display: none; }
    .community-grid { grid-template-columns: 1fr !important; }
    .timeline::before { left: 16px !important; }
    .timeline-marker { left: 9px !important; }
    .timeline-card { margin-left: 36px !important; }
    .admin-tier-grid { grid-template-columns: 1fr !important; }
    .case-grid { grid-template-columns: 1fr !important; }
}

/* ========================================================
   Knowledge Hub Styles
   ======================================================== */
.hub-hero, .changelog-hero {
    padding: 56px 24px 48px 24px;
    text-align: center;
    background: linear-gradient(180deg, var(--md-sys-color-surface) 0%, var(--md-sys-color-surface-dim) 100%);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.hub-hero-inner, .changelog-hero-inner {
    max-width: 760px;
    margin: 0 auto;
}

.hub-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    font-size: 13px;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 9999px;
    margin-bottom: 20px;
}

.hub-title {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -0.6px;
    color: var(--md-sys-color-text-primary);
    margin-bottom: 16px;
}

.hub-subtitle {
    font-size: 16px;
    color: var(--md-sys-color-text-secondary);
    line-height: 1.6;
}

.hub-container {
    max-width: var(--max-width);
    margin: 48px auto;
    padding: 0 24px;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 28px;
}

.article-card {
    background-color: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--md-sys-color-primary);
}

.article-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.article-cat-badge {
    font-size: 12px;
    font-weight: 700;
    color: var(--md-sys-color-primary);
    background-color: var(--md-sys-color-primary-container);
    padding: 4px 10px;
    border-radius: 6px;
}

.article-meta-info {
    font-size: 12px;
    color: var(--md-sys-color-text-tertiary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.meta-icon {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.article-card-title {
    font-size: 19px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 12px;
}

.article-card-title a {
    color: var(--md-sys-color-text-primary);
    transition: color 0.15s ease;
}

.article-card-title a:hover {
    color: var(--md-sys-color-primary);
}

.article-card-summary {
    font-size: 14px;
    color: var(--md-sys-color-text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
}

.article-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid var(--md-sys-color-outline-variant);
}

.article-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.tag-chip {
    font-size: 11px;
    background-color: var(--md-sys-color-surface-dim);
    color: var(--md-sys-color-text-secondary);
    padding: 2px 8px;
    border-radius: 4px;
}

.btn-read-more {
    font-size: 13px;
    font-weight: 600;
    color: var(--md-sys-color-primary);
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.svg-icon-arrow {
    width: 18px;
    height: 18px;
    fill: currentColor;
    transition: transform 0.15s ease;
}

.btn-read-more:hover .svg-icon-arrow {
    transform: translateX(4px);
}

.hub-cta-section {
    max-width: var(--max-width);
    margin: 48px auto 72px auto;
    padding: 0 24px;
}

.hub-cta-box {
    background: linear-gradient(135deg, var(--md-sys-color-surface) 0%, var(--md-sys-color-primary-container) 100%);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: 24px;
    padding: 40px;
    text-align: center;
}

.hub-cta-box h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.hub-cta-box p {
    font-size: 15px;
    color: var(--md-sys-color-text-secondary);
    max-width: 600px;
    margin: 0 auto 24px auto;
}

.hub-cta-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* ========================================================
   Article Detail Page Styles
   ======================================================== */
.article-page {
    padding: 40px 24px 80px 24px;
}

.article-container {
    max-width: 820px;
    margin: 0 auto;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--md-sys-color-text-tertiary);
    margin-bottom: 24px;
}

.bc-sep {
    color: var(--md-sys-color-outline);
}

.bc-current {
    color: var(--md-sys-color-text-primary);
    font-weight: 600;
}

.article-header {
    margin-bottom: 36px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.article-category-pill {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    color: var(--md-sys-color-primary);
    background-color: var(--md-sys-color-primary-container);
    padding: 4px 12px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.article-full-title {
    font-size: 34px;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: -0.6px;
    color: var(--md-sys-color-text-primary);
    margin-bottom: 20px;
}

.article-header-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.author-block {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar-chip {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--md-sys-color-primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.author-name {
    font-size: 14px;
    font-weight: 700;
}

.publish-date {
    font-size: 12px;
    color: var(--md-sys-color-text-tertiary);
}

/* Article Typography */
.article-body {
    font-size: 16px;
    line-height: 1.85;
    color: var(--md-sys-color-text-primary);
}

.article-body p {
    margin-bottom: 20px;
}

.article-body p.lead {
    font-size: 18px;
    font-weight: 500;
    line-height: 1.7;
    color: var(--md-sys-color-text-secondary);
    border-left: 4px solid var(--md-sys-color-primary);
    padding-left: 16px;
    margin-bottom: 32px;
}

.article-body h2 {
    font-size: 24px;
    font-weight: 800;
    margin: 44px 0 16px 0;
    letter-spacing: -0.4px;
    border-bottom: 2px solid var(--md-sys-color-outline-variant);
    padding-bottom: 8px;
}

.article-body h3 {
    font-size: 19px;
    font-weight: 700;
    margin: 28px 0 12px 0;
}

.article-body ul, .article-body ol {
    margin-bottom: 24px;
    padding-left: 24px;
}

.article-body li {
    margin-bottom: 8px;
}

.article-body code {
    background-color: var(--md-sys-color-surface-dim);
    color: var(--md-sys-color-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 14px;
    border: 1px solid var(--md-sys-color-outline-variant);
}

.info-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 24px 0;
}

.card-item {
    background-color: var(--md-sys-color-surface-dim);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 14px;
    padding: 20px;
}

.thai-badge {
    display: inline-block;
    font-family: "Sarabun", sans-serif;
    font-size: 18px;
    font-weight: 700;
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    padding: 2px 10px;
    border-radius: 6px;
    margin-bottom: 8px;
}

.badge-secondary {
    background-color: #fee2e2;
    color: #991b1b;
}

.m3-table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    background-color: var(--md-sys-color-surface);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--md-sys-color-outline);
}

.m3-table th, .m3-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    font-size: 14px;
}

.m3-table th {
    background-color: var(--md-sys-color-surface-dim);
    font-weight: 700;
    color: var(--md-sys-color-text-secondary);
}

.tip-box {
    background-color: #fef7e0;
    border: 1px solid #f9ab00;
    border-radius: 12px;
    padding: 16px 20px;
    font-size: 14px;
    color: #7a4600;
    margin: 20px 0;
}

.comparison-quote {
    background-color: var(--md-sys-color-surface-dim);
    border: 1px dashed var(--md-sys-color-primary);
    border-radius: 12px;
    padding: 16px;
    font-family: "Sarabun", var(--font-family);
    font-size: 18px;
    margin: 20px 0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.hl-segment {
    font-weight: 700;
    color: #c71585;
}

.admin-tier-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 24px 0;
}

.tier-card {
    background-color: var(--md-sys-color-surface-dim);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 14px;
    padding: 18px;
}

.tier-level {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--md-sys-color-primary);
    margin-bottom: 6px;
}

.tier-thai {
    font-family: "Sarabun", sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #111;
}

.tier-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--md-sys-color-text-secondary);
    margin-bottom: 10px;
}

.ambiguity-demo {
    background-color: var(--md-sys-color-surface-dim);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 16px;
    padding: 24px;
    margin: 24px 0;
    text-align: center;
}

.origin-thai {
    font-family: "Sarabun", sans-serif;
    font-size: 32px;
    font-weight: 800;
    color: #c71585;
    margin-bottom: 20px;
}

.case-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    text-align: left;
}

.case-card {
    background: #ffffff;
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 12px;
    padding: 16px;
}

.cut-point {
    display: block;
    font-family: "Sarabun", sans-serif;
    font-weight: 700;
    color: var(--md-sys-color-primary);
    margin-bottom: 6px;
}

.tech-pipeline-card {
    background: linear-gradient(135deg, var(--md-sys-color-surface) 0%, var(--md-sys-color-primary-container) 100%);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: 16px;
    padding: 24px;
    margin: 28px 0;
}

.article-tags-section {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 36px 0 24px 0;
    padding-top: 20px;
    border-top: 1px solid var(--md-sys-color-outline-variant);
}

.tags-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--md-sys-color-text-tertiary);
}

.article-thaitan-cta {
    background-color: var(--md-sys-color-surface-dim);
    border: 2px solid var(--md-sys-color-primary);
    border-radius: 20px;
    padding: 32px;
    margin: 40px 0;
}

.cta-inner-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.cta-text-col {
    max-width: 480px;
}

.cta-text-col .sub-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--md-sys-color-primary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.cta-text-col h3 {
    font-size: 20px;
    font-weight: 800;
    margin: 6px 0 8px 0;
}

.cta-text-col p {
    font-size: 14px;
    color: var(--md-sys-color-text-secondary);
}

.article-nav-footer {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

/* ========================================================
   Changelog Timeline Styles
   ======================================================== */
.changelog-page {
    padding-bottom: 80px;
}

.changelog-container {
    max-width: 860px;
    margin: 48px auto;
    padding: 0 24px;
}

.timeline {
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 20px;
    bottom: 20px;
    left: 20px;
    width: 2px;
    background-color: var(--md-sys-color-outline-variant);
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
}

.timeline-marker {
    position: absolute;
    top: 24px;
    left: 13px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--md-sys-color-primary);
    border: 4px solid var(--md-sys-color-surface-dim);
    box-shadow: 0 0 0 2px var(--md-sys-color-primary);
    z-index: 2;
}

.timeline-card {
    margin-left: 52px;
    background-color: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: 20px;
    padding: 28px;
    box-shadow: var(--shadow-sm);
}

.release-header {
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.release-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.version-tag {
    font-size: 20px;
    font-weight: 800;
    color: var(--md-sys-color-text-primary);
}

.release-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
}

.badge-primary {
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
}

.badge-success {
    background-color: var(--md-sys-color-success-container);
    color: var(--md-sys-color-on-success-container);
}

.badge-neutral {
    background-color: var(--md-sys-color-surface-dim);
    color: var(--md-sys-color-text-secondary);
}

.release-date {
    font-size: 13px;
    color: var(--md-sys-color-text-tertiary);
    margin-left: auto;
}

.release-main-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.release-summary {
    font-size: 14px;
    color: var(--md-sys-color-text-secondary);
    line-height: 1.6;
}

.release-changes-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.change-entry {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.change-tag {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
    margin-top: 2px;
}

.badge-new { background-color: #e8f0fe; color: #174ea6; }
.badge-feature { background-color: #e6f4ea; color: #137333; }
.badge-policy { background-color: #fce8e6; color: #c5221f; }
.badge-dict { background-color: #fef7e0; color: #b06000; }
.badge-engine { background-color: #f3e8fd; color: #7627bb; }
.badge-ui { background-color: #e0f2fe; color: #0369a1; }

.change-desc-box {
    flex-grow: 1;
}

.change-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 3px;
}

.change-desc {
    font-size: 13px;
    color: var(--md-sys-color-text-secondary);
    line-height: 1.5;
}

/* ========================================================
   Community / Feedback Styles
   ======================================================== */
.community-page {
    padding-bottom: 80px;
}

.community-container {
    max-width: var(--max-width);
    margin: 48px auto;
    padding: 0 24px;
}

.community-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 36px;
}

.feedback-card {
    background-color: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: 24px;
    padding: 36px;
    box-shadow: var(--shadow-sm);
}

.card-header-styled {
    display: flex;
    gap: 16px;
    margin-bottom: 28px;
    align-items: flex-start;
}

.svg-icon-colored {
    width: 32px;
    height: 32px;
    fill: var(--md-sys-color-primary);
    flex-shrink: 0;
}

.card-header-styled h2 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 6px;
}

.card-header-styled p {
    font-size: 14px;
    color: var(--md-sys-color-text-secondary);
}

.alert-success-box {
    display: flex;
    gap: 12px;
    background-color: var(--md-sys-color-success-container);
    color: var(--md-sys-color-on-success-container);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--md-sys-color-text-primary);
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 12px 16px;
    font-family: var(--font-family);
    font-size: 14px;
    color: var(--md-sys-color-text-primary);
    background-color: var(--md-sys-color-surface-dim);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: 10px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--md-sys-color-primary);
    box-shadow: 0 0 0 3px var(--md-sys-color-primary-container);
}

.btn-full {
    width: 100%;
    margin-top: 8px;
}

/* Community Logged-in User Badge */
.community-user-badge {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background-color: var(--md-sys-color-surface-dim);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: 14px;
    margin-bottom: 24px;
}

.user-badge-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--md-sys-color-primary) 0%, #0d47a1 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 15px;
}

.avatar-mini {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-fallback {
    text-transform: uppercase;
}

.user-badge-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.user-badge-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--md-sys-color-text-primary);
}

.user-badge-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--md-sys-color-success);
    font-weight: 600;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: var(--md-sys-color-success);
    box-shadow: 0 0 6px var(--md-sys-color-success);
}

/* Community Login Required Box */
.login-required-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 44px 28px;
    background: linear-gradient(180deg, var(--md-sys-color-surface) 0%, var(--md-sys-color-surface-dim) 100%);
    border: 1.5px dashed var(--md-sys-color-outline);
    border-radius: 20px;
    margin-top: 8px;
}

.login-lock-icon {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.login-lock-icon svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

.login-required-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--md-sys-color-text-primary);
    margin-bottom: 12px;
    letter-spacing: -0.3px;
}

.login-required-desc {
    font-size: 14px;
    color: var(--md-sys-color-text-secondary);
    line-height: 1.6;
    max-width: 440px;
    margin-bottom: 26px;
    word-break: keep-all;
}

.login-required-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
}

.login-required-note {
    font-size: 12.5px;
    color: var(--md-sys-color-text-tertiary);
    line-height: 1.5;
    max-width: 420px;
}

.community-info-col {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.info-guide-card {
    background: linear-gradient(135deg, var(--md-sys-color-surface) 0%, var(--md-sys-color-primary-container) 100%);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: 20px;
    padding: 24px;
}

.info-guide-card h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 8px;
}

.info-guide-card p {
    font-size: 14px;
    color: var(--md-sys-color-text-secondary);
    line-height: 1.6;
}

.faq-list {
    background-color: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: 20px;
    padding: 24px;
}

.faq-list h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 16px;
}

.faq-item {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.faq-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.faq-q {
    font-size: 14px;
    font-weight: 700;
    color: var(--md-sys-color-text-primary);
    margin-bottom: 6px;
}

.faq-a {
    font-size: 13px;
    color: var(--md-sys-color-text-secondary);
    line-height: 1.5;
}

/* ==========================================================================
   Notice Modal (ThaiTan 2.0 Store Review)
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    padding: 20px;
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    position: relative;
    background-color: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: 28px;
    padding: 32px;
    max-width: 520px;
    width: 100%;
    box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.35);
    transform: translateY(16px) scale(0.96);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.active .modal-card {
    transform: translateY(0) scale(1);
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--md-sys-color-text-secondary);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.modal-close-btn:hover {
    background-color: var(--md-sys-color-surface-container-high);
    color: var(--md-sys-color-text-primary);
}

.modal-close-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.modal-header {
    text-align: center;
    margin-bottom: 20px;
}

.modal-icon-badge {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    background: linear-gradient(135deg, #1a73e8 0%, #4285f4 100%);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 16px rgba(26, 115, 232, 0.3);
}

.modal-icon-badge svg {
    width: 30px;
    height: 30px;
    fill: #ffffff;
}

.modal-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    margin-bottom: 8px;
}

.modal-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--md-sys-color-text-primary);
    letter-spacing: -0.02em;
}

.modal-body {
    margin-bottom: 24px;
}

.modal-lead {
    font-size: 15px;
    color: var(--md-sys-color-text-secondary);
    line-height: 1.6;
    text-align: center;
    margin-bottom: 20px;
}

.modal-info-box {
    background-color: var(--md-sys-color-surface-dim);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 18px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.info-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.info-icon {
    font-size: 18px;
    line-height: 1.3;
    flex-shrink: 0;
}

.info-item strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--md-sys-color-text-primary);
    margin-bottom: 3px;
}

.info-item p {
    font-size: 13px;
    color: var(--md-sys-color-text-secondary);
    line-height: 1.5;
    margin: 0;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-footer .btn {
    min-width: 100px;
    justify-content: center;
}

