:root {
    --brand-primary: #2f7d32;
    --brand-primary-dark: #215c24;
    --brand-secondary: #7abf45;
    --brand-accent: #edf7e8;
    --surface: #ffffff;
    --surface-soft: #f8fbf6;
    --surface-strong: #f1f6ef;
    --text-primary: #243024;
    --text-secondary: #5f6f5f;
    --border-color: #dbe6d5;
    --shadow-soft: 0 16px 40px rgba(30, 64, 36, 0.08);
    --shadow-strong: 0 20px 48px rgba(23, 56, 32, 0.14);
}

body.app-body {
    min-height: 100vh;
    color: var(--text-primary);
    background:
        radial-gradient(circle at top right, rgba(122, 191, 69, 0.18), transparent 24%),
        linear-gradient(180deg, #f4f9f1 0, #f8fbf6 220px, #f5f7fb 220px, #f5f7fb 100%);
    font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

a {
    text-decoration: none;
}

.app-navbar {
    background: linear-gradient(90deg, var(--brand-primary-dark), var(--brand-primary));
    box-shadow: 0 10px 28px rgba(28, 66, 35, 0.22);
}

.brand-mark {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.brand-title {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.78);
}

.navbar .nav-link {
    border-radius: 999px;
    padding: 0.6rem 1rem;
    color: rgba(255, 255, 255, 0.82);
    transition: all 0.2s ease;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.auth-actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.health-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    font-size: 0.92rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.health-indicator::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.9;
}

.health-indicator.is-loading {
    color: #fff7cc;
}

.health-indicator.is-good {
    color: #d9ffe0;
}

.health-indicator.is-warning {
    color: #fff3bf;
}

.health-indicator.is-bad {
    color: #ffd7d7;
}

.page-top {
    padding-top: 0.75rem;
}

.hero-card,
.page-banner,
.panel-card,
.metric-card,
.record-card,
.result-summary,
.overview-item {
    background: var(--surface);
    border: 1px solid rgba(219, 230, 213, 0.95);
    border-radius: 1.4rem;
    box-shadow: var(--shadow-soft);
}

.hero-card,
.page-banner {
    padding: 2rem;
}

.hero-card-soft {
    background: linear-gradient(180deg, #fbfdf9, #f3f9ef);
}

.hero-cover {
    background:
        radial-gradient(circle at top right, rgba(122, 191, 69, 0.22), transparent 28%),
        linear-gradient(180deg, #ffffff, #f5faf2);
}

.section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.9rem;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background: rgba(47, 125, 50, 0.1);
    color: var(--brand-primary);
    font-size: 0.86rem;
    font-weight: 700;
}

.hero-title {
    margin-bottom: 1rem;
    font-size: clamp(2rem, 4vw, 2.9rem);
    font-weight: 800;
    line-height: 1.18;
}

.hero-text,
.panel-subtitle,
.section-subtitle,
.footer-text,
.footer-meta,
.feature-item span,
.tip-item,
.selection-summary,
.preview-placeholder,
.metric-note {
    color: var(--text-secondary);
    line-height: 1.75;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-top: 1.5rem;
}

.hero-lead {
    max-width: 720px;
    font-size: 1.02rem;
}

.hero-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 1.2rem;
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.48rem 0.85rem;
    border-radius: 999px;
    background: rgba(47, 125, 50, 0.08);
    border: 1px solid rgba(47, 125, 50, 0.14);
    color: var(--brand-primary);
    font-size: 0.9rem;
    font-weight: 600;
}

.hero-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
    margin-top: 1.5rem;
}

.hero-summary-card {
    padding: 1rem 1.1rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(219, 230, 213, 0.92);
}

.hero-summary-label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.86rem;
}

.hero-summary-value {
    display: block;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.5;
}

.panel-eyebrow {
    margin-bottom: 0.65rem;
    color: var(--brand-primary);
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.showcase-list {
    display: grid;
    gap: 1rem;
    margin-top: 1.2rem;
}

.showcase-item {
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: 0.9rem;
    align-items: start;
    padding: 1rem 1rem 1rem 0.95rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(122, 191, 69, 0.18);
}

.showcase-index {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: linear-gradient(180deg, var(--brand-primary), var(--brand-secondary));
    color: #fff;
    font-size: 0.95rem;
    font-weight: 800;
}

.showcase-item strong {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--text-primary);
}

.showcase-item p {
    color: var(--text-secondary);
    line-height: 1.75;
}

.hero-note-card {
    margin-top: 1rem;
    padding: 1rem 1.1rem;
    border-radius: 1rem;
    background: rgba(47, 125, 50, 0.08);
    border: 1px dashed rgba(47, 125, 50, 0.24);
    color: var(--text-secondary);
    line-height: 1.75;
}

.hero-note-title {
    margin-bottom: 0.35rem;
    color: var(--text-primary);
    font-weight: 700;
}

.feature-list {
    display: grid;
    gap: 1rem;
}

.feature-item {
    padding: 1rem 1.1rem;
    background: rgba(47, 125, 50, 0.05);
    border: 1px solid rgba(122, 191, 69, 0.18);
    border-radius: 1rem;
}

.feature-item strong {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--text-primary);
}

.panel-card {
    padding: 1.6rem;
}

.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.panel-title,
.section-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.upload-tips {
    display: grid;
    gap: 0.8rem;
}

.tip-item {
    padding: 0.95rem 1rem;
    background: var(--surface-soft);
    border: 1px dashed var(--border-color);
    border-radius: 1rem;
}

.preview-frame {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 350px;
    border-radius: 1.2rem;
    border: 1px dashed var(--border-color);
    background: linear-gradient(180deg, #fbfdf9, #f4f8f1);
    overflow: hidden;
}

.preview-placeholder {
    max-width: 360px;
    text-align: center;
    padding: 1rem;
}

.preview-placeholder-title {
    margin-bottom: 0.65rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.preview-image,
.result-image,
.upload-preview-image,
.record-thumb {
    width: 100%;
    object-fit: contain;
    display: block;
}

.preview-image {
    max-height: 350px;
    padding: 1rem;
}

.preview-meta {
    padding: 0.9rem 1rem;
    border-radius: 1rem;
    background: var(--surface-soft);
    border: 1px solid var(--border-color);
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.metric-card {
    height: 100%;
    padding: 1.35rem;
}

.metric-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.92rem;
    margin-bottom: 0.6rem;
}

.metric-value {
    display: block;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-primary);
}

.metric-note {
    margin-top: 0.7rem;
    font-size: 0.92rem;
}

.loading-panel {
    padding: 2.2rem 1.2rem;
    text-align: center;
    color: var(--text-secondary);
    border: 1px dashed var(--border-color);
    border-radius: 1rem;
    background: var(--surface-soft);
}

.empty-state {
    padding: 2.4rem 1.3rem;
    text-align: center;
    border-radius: 1.2rem;
    border: 1px dashed var(--border-color);
    background: var(--surface-soft);
}

.empty-state h5 {
    color: var(--text-primary);
    font-weight: 700;
}

.result-image-box {
    background: var(--surface-soft);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1rem;
    height: 100%;
}

.result-image-label {
    margin-bottom: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
}

.result-image {
    height: 320px;
    border-radius: 0.85rem;
    background: #eef3eb;
}

.result-summary {
    padding: 1.5rem;
    height: 100%;
}

.summary-text {
    color: var(--text-secondary);
    line-height: 1.75;
}

.summary-grid {
    display: grid;
    gap: 0.9rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 1rem;
}

.summary-chip {
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    background: var(--surface-soft);
    border: 1px solid var(--border-color);
}

.summary-chip span {
    display: block;
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.summary-chip strong {
    font-size: 1.05rem;
    color: var(--text-primary);
}

.detection-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.detection-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.48rem 0.8rem;
    border-radius: 999px;
    background: rgba(47, 125, 50, 0.08);
    color: var(--brand-primary);
    font-size: 0.88rem;
    font-weight: 600;
}

.table-shell {
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    overflow: hidden;
}

.table-shell .table {
    margin-bottom: 0;
}

.table-shell thead th {
    background: #f3f8f1;
    color: var(--text-primary);
    border-bottom-color: var(--border-color);
}

.record-card {
    padding: 1rem;
    height: 100%;
}

.record-thumb {
    height: 170px;
    border-radius: 1rem;
    background: var(--surface-strong);
}

.record-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.record-title {
    margin: 0.85rem 0 0.5rem;
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--text-primary);
    word-break: break-word;
}

.record-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.intro-card,
.module-card,
.workflow-card {
    background: var(--surface);
    border: 1px solid rgba(219, 230, 213, 0.95);
    border-radius: 1.3rem;
    box-shadow: var(--shadow-soft);
}

.intro-card,
.module-card {
    padding: 1.45rem;
}

.intro-icon {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    border-radius: 16px;
    background: linear-gradient(180deg, var(--brand-primary), var(--brand-secondary));
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
}

.intro-title,
.module-title,
.workflow-title {
    margin-bottom: 0.7rem;
    font-size: 1.12rem;
    font-weight: 700;
    color: var(--text-primary);
}

.intro-text,
.module-text,
.workflow-text {
    color: var(--text-secondary);
    line-height: 1.75;
}

.module-label {
    margin-bottom: 0.7rem;
    color: var(--brand-primary);
    font-size: 0.84rem;
    font-weight: 700;
}

.workflow-card {
    padding: 1.5rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 250, 241, 0.96));
}

.workflow-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.workflow-step {
    position: relative;
    padding: 1.1rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(219, 230, 213, 0.92);
}

.workflow-number {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.85rem;
    border-radius: 50%;
    background: var(--brand-primary);
    color: #fff;
    font-size: 0.96rem;
    font-weight: 800;
}

.selection-summary {
    padding: 0.95rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    background: var(--surface-soft);
}

.upload-preview-card {
    padding: 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    background: #fff;
    height: 100%;
}

.upload-preview-image {
    height: 150px;
    border-radius: 0.9rem;
    background: var(--surface-soft);
}

.preview-caption {
    margin-top: 0.8rem;
    font-size: 0.92rem;
    color: var(--text-secondary);
    word-break: break-word;
}

.overview-list {
    display: grid;
    gap: 0.9rem;
}

.overview-item {
    padding: 1rem 1.1rem;
}

.overview-label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.overview-value {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 700;
    word-break: break-word;
}

.stat-list {
    display: grid;
    gap: 1rem;
}

.stat-row {
    display: grid;
    gap: 0.55rem;
}

.stat-row-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.stat-bar {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: #e7f1e3;
    overflow: hidden;
}

.stat-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary));
}

.pagination-wrap {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.pagination-btn {
    min-width: 42px;
    height: 42px;
    padding: 0 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: #fff;
    color: var(--text-primary);
    font-weight: 600;
    transition: all 0.2s ease;
}

.pagination-btn:hover {
    border-color: rgba(47, 125, 50, 0.45);
    background: rgba(47, 125, 50, 0.06);
}

.pagination-btn.active {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
}

.pagination-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.record-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.app-footer {
    margin-top: 2rem;
    padding: 1.7rem 0 2rem;
    border-top: 1px solid rgba(219, 230, 213, 0.85);
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(8px);
}

.footer-title {
    margin-bottom: 0.35rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.footer-meta {
    font-size: 0.92rem;
    text-align: right;
}

.modal-content {
    border: none;
    border-radius: 1.4rem;
    box-shadow: var(--shadow-strong);
}

.modal-header {
    border-bottom-color: var(--border-color);
}

.badge-soft-success {
    background: rgba(47, 125, 50, 0.1);
    color: var(--brand-primary);
}

.badge-soft-warning {
    background: rgba(255, 193, 7, 0.18);
    color: #8a6500;
}

.badge-soft-danger {
    background: rgba(220, 53, 69, 0.12);
    color: #a32834;
}

.info-stack {
    display: grid;
    gap: 0.95rem;
}

.info-item {
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    background: var(--surface-soft);
}

.info-item-label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.info-item-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    word-break: break-word;
}

.result-note {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 1rem;
    background: rgba(255, 193, 7, 0.12);
    border: 1px solid rgba(255, 193, 7, 0.28);
    color: #745400;
}

@media (max-width: 991.98px) {
    .page-top {
        padding-top: 0.35rem;
    }

    .hero-card,
    .page-banner,
    .panel-card {
        padding: 1.4rem;
    }

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

    .preview-frame {
        min-height: 280px;
    }

    .result-image {
        height: 260px;
    }

    .footer-meta {
        text-align: left;
    }
}

@media (max-width: 767.98px) {
    .hero-summary-grid,
    .workflow-grid,
    .summary-grid {
        grid-template-columns: 1fr;
    }

    .hero-actions,
    .record-actions {
        flex-direction: column;
    }

    .hero-actions .btn,
    .record-actions .btn {
        width: 100%;
    }
}

.recommendation-list {
    display: grid;
    gap: 1rem;
}

.recommendation-card {
    padding: 1.15rem 1.2rem;
    border-radius: 1rem;
    background: linear-gradient(180deg, #fbfdf9, #f3f8f0);
    border: 1px solid rgba(122, 191, 69, 0.22);
}

.recommendation-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
}

.recommendation-title {
    margin-bottom: 0.35rem;
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--text-primary);
}

.recommendation-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.recommendation-group + .recommendation-group {
    margin-top: 0.85rem;
}

.recommendation-label {
    margin-bottom: 0.5rem;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--brand-primary-dark);
}

.recommendation-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.recommendation-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.42rem 0.8rem;
    border-radius: 999px;
    background: rgba(47, 125, 50, 0.08);
    border: 1px solid rgba(47, 125, 50, 0.14);
    color: var(--brand-primary-dark);
    font-size: 0.88rem;
    font-weight: 600;
}

.recommendation-bullets {
    margin: 0;
    padding-left: 1.2rem;
    color: var(--text-secondary);
    line-height: 1.75;
}

.recommendation-note {
    margin-top: 0.9rem;
    padding: 0.85rem 0.95rem;
    border-radius: 0.85rem;
    background: rgba(47, 125, 50, 0.08);
    border: 1px dashed rgba(47, 125, 50, 0.22);
    color: var(--text-secondary);
    line-height: 1.7;
}
