/* Maicht Global - Xiaomi MiMo inspired editorial theme */

:root {
    --bg-primary: #F9F6F3;
    --bg-secondary: #F3EEE8;
    --bg-card: #F3EEE8;
    --bg-elevated: #fffdfb;
    --text-primary: #1D0601;
    --text-secondary: rgba(29, 6, 1, 0.7);
    --text-muted: #888;
    --accent: #FF6700;
    --accent-hover: #e65d00;
    --border: #e0d9d0;
    --border-soft: #eee6dd;
    --success: #2f8f5b;
    --warning: #b7791f;
    --danger: #c2412d;
    --radius: 12px;
    --radius-sm: 8px;
    --article-width: 820px;
    --nav-height: 64px;
}

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

html {
    scroll-behavior: smooth;
    background: var(--bg-primary);
}

body {
    min-height: 100vh;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: "PT Serif", Georgia, serif;
    font-size: 18px;
    line-height: 1.75;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

body.nav-open { overflow: hidden; }

a {
    color: var(--text-primary);
    text-decoration-color: rgba(255, 103, 0, 0.35);
    text-underline-offset: 0.18em;
    transition: color 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

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

img, svg { max-width: 100%; display: block; }

button, input, textarea, select {
    font: inherit;
}

.container,
.container-narrow {
    width: min(var(--article-width), calc(100% - 40px));
    margin: 0 auto;
}

.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--nav-height);
    background: rgba(250, 247, 245, 0.8);
    border-bottom: 1px solid rgba(224, 217, 208, 0.72);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
}

.navbar .container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.nav-logo {
    display: inline-flex;
    align-items: center;
    color: var(--text-primary);
    font-family: "Ubuntu", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0;
    text-decoration: none;
    white-space: nowrap;
}

.logo-text {
    color: var(--text-primary);
}

.logo-text::before {
    content: "";
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-right: 10px;
    border-radius: 999px;
    background: var(--accent);
    vertical-align: 0.07em;
}

.nav-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    list-style: none;
    font-family: "Ubuntu", -apple-system, BlinkMacSystemFont, sans-serif;
}

.nav-links a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    color: rgba(29, 6, 1, 0.62);
    font-size: 0.86rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
    background: rgba(243, 238, 232, 0.9);
}

.nav-tools-btn {
    border: 1px solid var(--border);
}

.lang-switch {
    margin-left: 4px;
    display: flex;
    align-items: center;
    gap: 2px;
    color: var(--text-muted);
}

.lang-switch a {
    min-height: 30px;
    padding: 0 8px;
    font-size: 0.78rem;
}

.lang-switch a.active {
    color: var(--accent);
    background: transparent;
}

.lang-divider { color: var(--border); font-size: 0.8rem; }

.nav-toggle {
    display: none;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
    color: var(--text-primary);
    cursor: pointer;
    font-family: "Ubuntu", sans-serif;
    font-size: 1.1rem;
    line-height: 1;
}

main {
    min-height: calc(100vh - 210px);
}

.article-shell,
.page-header,
.hero-section,
.tools-page,
.profit-calc-page,
.table-tool-page,
.error-page {
    padding: 1.5rem 2rem 6rem;
}

.hero-section {
    min-height: calc(100vh - var(--nav-height));
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-content {
    width: min(var(--article-width), 100%);
    margin: 0 auto;
}

.hero-date,
.page-kicker {
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-family: "Ubuntu", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.8rem;
    line-height: 1.4;
}

.hero-title,
.hero h1,
.page-header h1,
.error-title {
    margin: 0 auto 1rem;
    color: var(--text-primary);
    font-family: "Ubuntu", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: 0;
}

.hero-title em,
.hero-title span,
.section-title span {
    color: var(--accent);
    font-family: "PT Serif", Georgia, serif;
    font-style: italic;
    font-weight: 700;
}

.hero-title .reveal-text,
.hero-title em,
.hero-title span {
    display: inline-block;
    animation: revealUp 800ms cubic-bezier(.16, 1, .3, 1) 120ms both;
}

@keyframes revealUp {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-subtitle,
.hero p,
.page-header p,
.section-desc,
.tools-subtitle,
.pc-subtitle,
.tt-subtitle,
.error-desc {
    width: min(680px, 100%);
    margin: 0 auto 2rem;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.75;
}

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

.btn,
.btn-primary,
.btn-outline,
.btn-primary-glow,
.btn-outline-light,
.btn-home,
.btn-back,
.tool-btn,
.apply-btn,
.form-submit,
.pc-calc-btn,
.tt-download-btn,
.btn-confirm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0.65rem 1.45rem;
    border: 1px solid transparent;
    border-radius: 100px;
    background: var(--text-primary);
    color: #fff;
    font-family: "Ubuntu", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.btn:hover,
.btn-primary:hover,
.btn-primary-glow:hover,
.btn-home:hover,
.tool-btn:hover,
.apply-btn:hover,
.form-submit:hover,
.pc-calc-btn:hover,
.tt-download-btn:hover,
.btn-confirm:hover {
    color: #fff;
    background: var(--accent);
    transform: translateY(-1px);
}

.btn-outline,
.btn-outline-light,
.btn-back,
.btn-back:hover {
    background: transparent;
    color: var(--text-primary);
    border-color: #ccc;
}

.btn-outline:hover,
.btn-outline-light:hover,
.btn-back:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-1px);
}

.btn-sm { min-height: 34px; padding: 0.45rem 0.8rem; font-size: 0.78rem; }

.section {
    padding: 0 2rem;
    margin-bottom: 3.5rem;
}

.section-dark,
.section-darker {
    background: transparent;
}

.section-title,
.section h2,
.tools-header h1,
.pc-header h1,
.tt-header h1,
.contact-info h2 {
    width: min(var(--article-width), 100%);
    margin: 0 auto 0.85rem;
    color: var(--text-primary);
    font-family: "Ubuntu", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: left;
}

.tools-header,
.pc-header,
.tt-header,
.page-header {
    width: min(var(--article-width), 100%);
    margin: 0 auto;
    text-align: center;
}

.page-header {
    padding-top: 5rem;
}

.page-header h1,
.tools-header h1,
.pc-header h1,
.tt-header h1,
.error-title {
    text-align: center;
}

.section-desc { text-align: left; margin-left: auto; margin-right: auto; }

h1, h2, h3, h4, h5, h6,
.card h3,
.business-card h3,
.category-card h3,
.center-card h3,
.culture-card h3,
.job-title,
.tool-name,
.result-value {
    font-family: "Ubuntu", -apple-system, BlinkMacSystemFont, sans-serif;
    letter-spacing: 0;
}

h3,
.section h3,
.card h3,
.business-card h3,
.category-card h3,
.center-card h3,
.culture-card h3 {
    margin-top: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.35;
}

p,
.text-block,
.card p,
.business-card p,
.category-card p,
.center-card p,
.culture-card p,
.job-desc,
.tool-desc,
.contact-info > p,
.ic-body p,
.no-jobs,
.no-tools,
.tt-hint,
.tt-stats,
.result-label {
    color: var(--text-secondary);
}

.text-block {
    width: min(var(--article-width), 100%);
    margin: 0 auto;
    font-size: 1rem;
}

hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 3rem 0;
}

blockquote {
    margin: 2rem 0;
    padding: 1rem 1.25rem;
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-style: italic;
}

.grid-3,
.grid-4,
.business-grid,
.category-grid,
.center-grid,
.culture-grid,
.jobs-grid,
.tools-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    width: min(var(--article-width), 100%);
    margin: 2rem auto 0;
}

.grid-3,
.business-grid,
.category-grid,
.culture-grid,
.jobs-grid,
.tools-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
}

.card,
.business-card,
.category-card,
.center-card,
.culture-card,
.job-card,
.tool-card,
.contact-form-wrap,
.pc-inputs,
.pc-results,
.tt-input-section,
.tt-preview-section,
.result-card,
.stats-bar {
    background: var(--bg-card);
    border: 1px solid rgba(224, 217, 208, 0.8);
    border-radius: var(--radius);
    padding: 1.4rem;
    box-shadow: none;
}

.business-card,
.category-card,
.center-card,
.culture-card,
.tool-card {
    text-align: left;
}

.card:hover,
.business-card:hover,
.category-card:hover,
.center-card:hover,
.culture-card:hover,
.job-card:hover,
.tool-card:hover {
    border-color: rgba(255, 103, 0, 0.36);
}

.icon,
.card-icon,
.emoji-bg,
.tool-icon,
.ic-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-bottom: 0.85rem;
    border-radius: 999px;
    background: rgba(255, 103, 0, 0.09);
    color: var(--accent);
    font-size: 1.35rem;
    line-height: 1;
}

.stats-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    margin: 3rem auto 0;
    padding: 1.2rem;
}

.stat-item {
    padding: 0.6rem 1rem;
    text-align: center;
    border-right: 1px solid var(--border);
}

.stat-item:last-child { border-right: 0; }

.stat-number {
    color: var(--accent);
    font-family: "Ubuntu", sans-serif;
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.15;
}

.stat-label {
    margin-top: 0.2rem;
    color: var(--text-muted);
    font-family: "Ubuntu", sans-serif;
    font-size: 0.78rem;
}

.timeline {
    position: relative;
    width: min(var(--article-width), 100%);
    margin: 2rem auto 0;
    padding-left: 30px;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: 8px;
    width: 1px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    margin-bottom: 1rem;
}

.timeline-dot,
.timeline-item::before {
    content: "";
    position: absolute;
    left: -29px;
    top: 1.7rem;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid var(--bg-primary);
}

.timeline-dot { display: none; }

.timeline-content {
    padding: 1.25rem 1.35rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
}

.timeline-year {
    color: var(--accent);
    font-family: "Ubuntu", sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    width: min(var(--article-width), 100%);
    margin: 0 auto 2rem;
}

.filter-btn {
    min-height: 36px;
    padding: 0.45rem 1rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    font-family: "Ubuntu", sans-serif;
    font-size: 0.82rem;
    cursor: pointer;
}

.filter-btn:hover,
.filter-btn.active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(255, 103, 0, 0.06);
}

.job-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 0.8rem;
}

.job-title { margin: 0; font-size: 1.08rem; }

.job-badge,
.badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    background: rgba(255, 103, 0, 0.08);
    color: var(--accent);
    font-family: "Ubuntu", sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.job-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 0.7rem;
    color: var(--text-muted);
    font-family: "Ubuntu", sans-serif;
    font-size: 0.78rem;
}

.job-date { color: var(--text-muted); font-size: 0.75rem; }

.contact-layout,
.pc-layout,
.tt-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    width: min(1100px, 100%);
    margin: 0 auto;
}

.contact-info h2 { margin-bottom: 0.6rem; text-align: left; }

.info-card {
    display: flex;
    gap: 14px;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.info-card:last-child { border-bottom: 0; }

.ic-icon {
    flex: 0 0 auto;
    margin-bottom: 0;
}

.ic-body h4 {
    margin-bottom: 0.15rem;
    font-family: "Ubuntu", sans-serif;
    font-size: 0.96rem;
}

input,
textarea,
select {
    width: 100%;
    padding: 0.68rem 0.82rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.55);
    color: var(--text-primary);
    outline: none;
    transition: border-color 180ms ease, background-color 180ms ease;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent);
    background: #fff;
}

input::placeholder,
textarea::placeholder {
    color: rgba(29, 6, 1, 0.38);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

label,
.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--text-secondary);
    font-family: "Ubuntu", sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
}

.form-group { margin-bottom: 1rem; }

.form-success {
    display: none;
    padding: 1.5rem;
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.input-with-currency {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 130px;
    gap: 8px;
}

.result-card {
    margin-bottom: 0.8rem;
    padding: 1rem;
    background: var(--bg-elevated);
}

.result-card.highlight {
    border-left: 3px solid var(--accent);
}

.result-label {
    margin-bottom: 0.15rem;
    font-family: "Ubuntu", sans-serif;
    font-size: 0.78rem;
}

.result-value {
    color: var(--text-primary);
    font-size: 1.35rem;
    font-weight: 700;
}

.result-card.highlight .result-value { color: var(--accent); }

.tt-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 1rem 0;
}

.tt-opt {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    cursor: pointer;
}

.tt-opt input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

#csvInput {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.85rem;
    line-height: 1.55;
}

.tt-preview-area {
    min-height: 230px;
    overflow: auto;
}

.tt-placeholder,
.no-jobs,
.no-tools,
.empty-state {
    padding: 3rem 1rem;
    text-align: center;
    color: var(--text-muted);
}

.tt-download-btn:disabled {
    background: #cfc7be;
    color: rgba(29, 6, 1, 0.55);
    cursor: not-allowed;
    transform: none;
}

table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 10px;
    background: #fffdfb;
    font-family: "Ubuntu", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.82rem;
}

thead,
th {
    background: var(--bg-secondary);
}

th,
td {
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--border-soft);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--text-primary);
    font-weight: 700;
}

td { color: var(--text-secondary); }

tbody tr:hover td { background: rgba(255, 103, 0, 0.035); }

.modal,
.toolbox-overlay,
.pc-overlay,
.tt-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(29, 6, 1, 0.28);
    backdrop-filter: blur(8px);
}

.modal-content,
.toolbox-overlay-content,
.pc-overlay-content,
.tt-overlay-content {
    width: min(420px, 100%);
    padding: 2rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--bg-primary);
    text-align: center;
}

.modal-content h2,
.toolbox-overlay-content h2,
.pc-overlay-content h2,
.tt-overlay-content h2 {
    margin-bottom: 0.6rem;
    font-family: "Ubuntu", sans-serif;
    font-size: 1.25rem;
}

.toolbox-input-group,
.pc-input-group,
.tt-input-group {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    margin-top: 1rem;
}

.error-msg,
.toolbox-error,
.pc-error,
.tt-error {
    min-height: 20px;
    margin-top: 0.75rem;
    color: var(--danger);
    font-family: "Ubuntu", sans-serif;
    font-size: 0.82rem;
}

.embedded-tool-container {
    width: min(1100px, 100%);
    margin: 2rem auto 0;
}

.embedded-tool-header { margin-bottom: 1rem; }

#embeddedToolIframe {
    width: 100%;
    height: 80vh;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
}

.footer {
    border-top: 1px solid var(--border-soft);
    padding: 2rem 2rem 2.5rem;
    color: var(--text-muted);
}

.footer .container {
    text-align: center;
}

.footer-grid {
    display: block;
}

.footer-col:not(:first-child) {
    display: none;
}

.footer-col h4 {
    margin-bottom: 0.15rem;
    font-family: "Ubuntu", sans-serif;
    font-size: 0.92rem;
    color: var(--text-primary);
}

.footer-col p,
.footer-bottom {
    color: var(--text-muted);
    font-family: "Ubuntu", sans-serif;
    font-size: 0.78rem;
}

.footer-bottom {
    margin-top: 0.8rem;
}

.error-page {
    min-height: calc(100vh - var(--nav-height));
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.error-code {
    color: var(--accent);
    font-family: "Ubuntu", sans-serif;
    font-size: clamp(4rem, 16vw, 7rem);
    font-weight: 700;
    line-height: 1;
}

@media (max-width: 700px) {
    :root { --nav-height: 56px; }

    body {
        font-size: 16px;
        line-height: 1.7;
    }

    .container,
    .container-narrow {
        width: min(100% - 28px, var(--article-width));
    }

    .navbar .container { width: calc(100% - 24px); }

    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .nav-links {
        position: fixed;
        left: 12px;
        right: 12px;
        top: calc(var(--nav-height) + 8px);
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding: 10px;
        border: 1px solid var(--border);
        border-radius: 16px;
        background: rgba(250, 247, 245, 0.96);
        backdrop-filter: blur(12px) saturate(180%);
        -webkit-backdrop-filter: blur(12px) saturate(180%);
    }

    .nav-links.active { display: flex; }

    .nav-links a {
        justify-content: center;
        min-height: 42px;
    }

    .lang-switch {
        justify-content: center;
        margin-left: 0;
    }

    .article-shell,
    .page-header,
    .hero-section,
    .tools-page,
    .profit-calc-page,
    .table-tool-page,
    .error-page {
        padding: 1.25rem 1rem 4rem;
    }

    .hero-title,
    .hero h1,
    .page-header h1 {
        font-size: 2rem;
    }

    .section {
        padding: 0 1rem;
        margin-bottom: 3rem;
    }

    .section-title,
    .section h2,
    .tools-header h1,
    .pc-header h1,
    .tt-header h1,
    .contact-info h2 {
        font-size: 1.45rem;
    }

    .stats-bar {
        grid-template-columns: 1fr;
    }

    .stat-item {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .stat-item:last-child { border-bottom: 0; }

    .contact-layout,
    .pc-layout,
    .tt-layout {
        grid-template-columns: 1fr;
    }

    .toolbox-input-group,
    .pc-input-group,
    .tt-input-group,
    .input-with-currency {
        grid-template-columns: 1fr;
    }
}
