:root {
    --bg: #f5f8fa;
    --surface: #ffffff;
    --surface-muted: #ecf4f3;
    --line: #d9e6e2;
    --text: #172426;
    --muted: #627474;
    --primary: #006b5f;
    --primary-soft: #14b8a6;
    --accent: #0f9d89;
    --danger: #b42318;
    --warning: #b54708;
    --success: #067647;
    --shadow: 0 18px 40px rgba(23, 36, 38, 0.06);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background: linear-gradient(180deg, #f7fbfb 0%, #f5f8fa 160px, #f5f8fa 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
}

.shell {
    width: min(1200px, calc(100% - 40px));
    margin: 0 auto;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid rgba(217, 230, 226, 0.8);
    backdrop-filter: blur(16px);
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 74px;
}

.brand,
.admin-brand {
    font-family: "Manrope", sans-serif;
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.04em;
}

.main-nav,
.topbar-actions,
.admin-menu {
    display: flex;
    align-items: center;
    gap: 14px;
}

.main-nav a,
.admin-menu a {
    padding: 10px 14px;
    border-radius: 999px;
    font-weight: 600;
    color: var(--muted);
    transition: 180ms ease;
}

.main-nav a:hover,
.admin-menu a:hover,
.main-nav a.is-active,
.admin-menu a.is-active {
    color: var(--primary);
    background: rgba(20, 184, 166, 0.1);
}

.admin-entry {
    border: 1px solid rgba(0, 107, 95, 0.15);
}

.button,
button,
input[type="submit"] {
    border: none;
    border-radius: 14px;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: 180ms ease;
}

.button.primary,
button.primary,
input[type="submit"].primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-soft) 100%);
    color: #fff;
    box-shadow: 0 10px 24px rgba(0, 107, 95, 0.2);
}

.button.ghost,
button.ghost {
    background: #fff;
    border: 1px solid var(--line);
    color: var(--text);
}

.button.warn,
button.warn {
    background: #fff6ed;
    color: var(--warning);
}

.button.danger,
button.danger {
    background: #fee4e2;
    color: var(--danger);
}

.button:hover,
button:hover,
input[type="submit"]:hover {
    transform: translateY(-1px);
}

.hero {
    padding: 64px 0 20px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 28px;
    align-items: stretch;
}

.panel,
.card,
.metric,
.form-panel,
.chart-card,
.empty-state {
    background: var(--surface);
    border: 1px solid rgba(217, 230, 226, 0.8);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
}

.hero-panel {
    position: relative;
    overflow: hidden;
    padding: 42px;
    min-height: 320px;
    background:
        radial-gradient(circle at top right, rgba(20, 184, 166, 0.18), transparent 40%),
        radial-gradient(circle at bottom left, rgba(0, 107, 95, 0.14), transparent 44%),
        var(--surface);
}

.eyebrow {
    display: inline-flex;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(20, 184, 166, 0.12);
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.headline {
    margin: 16px 0;
    font-family: "Manrope", sans-serif;
    font-size: clamp(34px, 4.5vw, 58px);
    line-height: 1.02;
    letter-spacing: -0.04em;
}

.subtext {
    max-width: 760px;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.8;
}

.search-row,
.toolbar,
.grid-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
}

.search-box,
.field,
select,
textarea,
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="file"] {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    color: var(--text);
    font-size: 14px;
}

textarea {
    min-height: 150px;
    resize: vertical;
    font-family: inherit;
}

.search-box {
    min-width: 260px;
    flex: 1;
}

.stats-grid,
.metrics-grid,
.dashboard-grid,
.admin-kpi-grid,
.profile-stats {
    display: grid;
    gap: 18px;
}

.stats-grid,
.metrics-grid,
.profile-stats,
.admin-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-grid {
    grid-template-columns: 2fr 1fr;
}

.metric {
    padding: 24px;
}

.metric-value {
    margin-top: 14px;
    font-family: "Manrope", sans-serif;
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.metric-label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.section {
    padding: 24px 0;
}

.section-head,
.split-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.section-title {
    margin: 0;
    font-family: "Manrope", sans-serif;
    font-size: 30px;
    letter-spacing: -0.03em;
}

.muted {
    color: var(--muted);
}

.grid {
    display: grid;
    gap: 18px;
}

.skill-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.skill-card,
.table-card,
.list-card,
.upload-preview,
.detail-layout,
.admin-layout {
    display: grid;
    gap: 18px;
}

.skill-card {
    padding: 24px;
    grid-template-rows: auto auto auto 1fr auto;
}

.tag-row,
.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chip,
.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.pill.active {
    background: var(--primary);
    color: #fff;
}

.status {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.status.PUBLISHED {
    background: rgba(6, 118, 71, 0.12);
    color: var(--success);
}

.status.PENDING_REVIEW {
    background: rgba(181, 71, 8, 0.12);
    color: var(--warning);
}

.status.REJECTED,
.status.OFFLINE {
    background: rgba(180, 35, 24, 0.12);
    color: var(--danger);
}

.status.DRAFT {
    background: #eef2ff;
    color: #4338ca;
}

.detail-layout {
    grid-template-columns: 2fr 1fr;
    align-items: start;
}

.detail-side,
.detail-main,
.form-panel,
.chart-card,
.table-card,
.list-card {
    padding: 24px;
}

.mono {
    padding: 18px;
    border-radius: 18px;
    background: #0d1c1d;
    color: #b0f3ea;
    overflow: auto;
    font-family: "Fira Code", monospace;
    font-size: 13px;
    line-height: 1.75;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 14px 10px;
    border-bottom: 1px solid rgba(217, 230, 226, 0.8);
    text-align: left;
    vertical-align: top;
}

.table th {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.table-actions,
.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.form-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid .full {
    grid-column: 1 / -1;
}

.label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.stack {
    display: grid;
    gap: 14px;
}

.flash-stack {
    padding-top: 18px;
}

.alert {
    padding: 14px 18px;
    border-radius: 16px;
    font-weight: 700;
}

.alert.success {
    background: #ecfdf3;
    color: var(--success);
}

.alert.danger {
    background: #fef3f2;
    color: var(--danger);
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--surface-muted);
    font-weight: 700;
}

.avatar-sm {
    display: inline-flex;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
}

.admin-shell {
    width: min(1320px, calc(100% - 40px));
    margin: 28px auto 40px;
}

.admin-layout {
    grid-template-columns: 240px 1fr;
    align-items: start;
}

.admin-sidebar {
    position: sticky;
    top: 96px;
    padding: 22px;
    background: #fff;
    border: 1px solid rgba(217, 230, 226, 0.8);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
}

.admin-menu {
    margin-top: 18px;
    display: grid;
    gap: 8px;
}

.admin-main {
    display: grid;
    gap: 18px;
}

.progress-bar {
    height: 10px;
    border-radius: 999px;
    background: #e7f2ef;
    overflow: hidden;
}

.progress-bar > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-soft) 100%);
}

.auth-shell {
    width: min(480px, calc(100% - 40px));
    margin: 80px auto;
}

.auth-card {
    padding: 32px;
}

.footer {
    padding: 42px 0;
    color: var(--muted);
}

@media (max-width: 1080px) {
    .hero-grid,
    .dashboard-grid,
    .detail-layout,
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .skill-grid,
    .stats-grid,
    .metrics-grid,
    .profile-stats,
    .admin-kpi-grid,
    .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .shell,
    .admin-shell,
    .auth-shell {
        width: min(100% - 24px, 100%);
    }

    .topbar-inner,
    .section-head,
    .split-head,
    .toolbar,
    .grid-toolbar,
    .search-row {
        align-items: stretch;
        flex-direction: column;
    }

    .main-nav {
        overflow: auto;
        width: 100%;
    }

    .skill-grid,
    .stats-grid,
    .metrics-grid,
    .profile-stats,
    .admin-kpi-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .hero-panel,
    .detail-main,
    .detail-side,
    .form-panel,
    .chart-card,
    .table-card,
    .list-card,
    .skill-card {
        padding: 20px;
    }
}
