:root {
    color-scheme: light;
    --bg: #eef3f6;
    --surface: #ffffff;
    --surface-soft: #f7faf9;
    --text: #18232f;
    --muted: #667685;
    --line: #d9e2e7;
    --line-strong: #c7d3da;
    --primary: #17785f;
    --primary-dark: #0f604c;
    --accent: #b86b2f;
    --danger: #b42318;
    --shadow: 0 18px 45px rgba(33, 53, 71, .12);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    min-height: 100%;
}

body {
    min-height: 100%;
    margin: 0;
    background:
        linear-gradient(180deg, rgba(23, 120, 95, .12), rgba(238, 243, 246, 0) 320px),
        var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    line-height: 1.5;
}

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

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

.page {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 34px 0 56px;
}

.form-page {
    display: grid;
    min-height: 100vh;
    align-items: start;
}

.form-shell,
.wizard-shell {
    width: min(680px, 100%);
    margin: 0 auto;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, .8);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.wizard-shell {
    padding: 0;
    min-height: calc(100vh - 68px);
}

.form-header {
    padding: 28px 28px 22px;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(13, 84, 70, .96), rgba(29, 121, 98, .94)),
        #155f4e;
}

.form-header h1 {
    margin: 8px 0 10px;
    font-size: clamp(26px, 6vw, 36px);
    font-weight: 800;
}

.form-header .muted {
    max-width: 34rem;
    margin: 0;
    color: rgba(255, 255, 255, .82);
}

.eyebrow {
    display: inline-block;
    color: rgba(255, 255, 255, .72);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

h1, h2 {
    margin: 0 0 12px;
    line-height: 1.2;
}

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

form {
    padding: 6px 28px 28px;
}

.wizard-form {
    padding: 0;
}

.wizard-form[hidden] {
    display: none;
}

.wizard-step {
    display: none;
    min-height: calc(100vh - 140px);
    padding: 28px;
}

.wizard-step.is-active {
    display: flex;
    flex-direction: column;
}

.intro-step {
    min-height: calc(100vh - 68px);
    color: #fff;
    background:
        linear-gradient(135deg, rgba(13, 84, 70, .96), rgba(29, 121, 98, .92)),
        #155f4e;
    flex-direction: column;
}

.intro-step h1 {
    margin: 12px 0 18px;
    font-size: clamp(28px, 7vw, 42px);
}

.notice-copy {
    flex: 1;
    min-height: 220px;
    margin: 18px 0 26px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 8px;
    padding: 16px;
    color: rgba(255, 255, 255, .9);
    background: rgba(255, 255, 255, .08);
}

.intro-step .primary-btn {
    margin-top: auto;
    background: #fff;
    color: var(--primary-dark);
    box-shadow: none;
}

.wizard-progress {
    display: flex;
    gap: 8px;
    padding: 22px 28px 0;
}

.progress-dot {
    display: block;
    width: 100%;
    height: 5px;
    border-radius: 999px;
    background: #dbe5e8;
}

.progress-dot.is-active {
    background: var(--primary);
}

.step-kicker {
    display: inline-flex;
    margin-bottom: 8px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 900;
}

.wizard-step h2 {
    margin-bottom: 8px;
    font-size: 24px;
}

.step-hint {
    margin: 0 0 18px;
    color: var(--muted);
}

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

.wizard-actions {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 12px;
    margin-top: auto;
    padding-top: 24px;
}

.wizard-actions .primary-btn {
    margin-top: 0;
}

.photo-capture {
    display: grid;
    gap: 14px;
}

.photo-capture input {
    border: 1px dashed var(--line-strong);
    background: var(--surface-soft);
}

.photo-preview-box {
    display: grid;
    min-height: 260px;
    place-items: center;
    border: 1px dashed var(--line-strong);
    border-radius: 8px;
    color: var(--muted);
    background-color: var(--surface-soft);
    background-position: center;
    background-size: cover;
    text-align: center;
}

.work-card {
    margin-top: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    background: var(--surface-soft);
}

.work-card h3 {
    margin: 0 0 4px;
    font-size: 17px;
}

.form-section {
    margin-top: 24px;
}

.form-section h2 {
    margin: 0 0 12px;
    padding-left: 10px;
    border-left: 4px solid var(--primary);
    color: #1f2d38;
    font-size: 18px;
}

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

.field {
    display: grid;
    gap: 8px;
    margin-top: 20px;
    font-weight: 650;
}

.field-label {
    display: inline-flex;
    gap: 4px;
    align-items: baseline;
    color: #26323d;
}

.field-label b {
    color: var(--accent);
}

.field small {
    color: var(--muted);
    font-weight: 400;
}

.age-auto-field output {
    display: flex;
    align-items: center;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 11px 13px;
    color: #40515f;
    background: #f3f7f7;
    font-weight: 700;
}

input, select, textarea {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 11px 13px;
    color: var(--text);
    font: inherit;
    background: #fff;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(23, 120, 95, .12);
}

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

.paper-table {
    display: grid;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    background: #fff;
}

.education-table,
.work-table {
    grid-template-columns: minmax(180px, 1.25fr) minmax(110px, .75fr) minmax(150px, 1fr) minmax(180px, 1.2fr);
}

.paper-head,
.paper-cell {
    min-width: 0;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 10px;
}

.paper-head:nth-child(4n),
.paper-cell:nth-child(4n) {
    border-right: 0;
}

.paper-cell:nth-last-child(-n+4) {
    border-bottom: 0;
}

.paper-head {
    color: #40515f;
    background: #f3f7f7;
    font-size: 13px;
    font-weight: 800;
    text-align: center;
}

.paper-cell input,
.paper-cell select,
.paper-cell textarea {
    min-height: 40px;
    border-radius: 5px;
    padding: 9px 10px;
}

.paper-cell textarea {
    min-height: 72px;
}

.date-range {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 8px;
    align-items: center;
}

.date-range span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.choice-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    font-weight: 500;
}

.choice-row label {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 10px 12px;
    background: var(--surface-soft);
}

.choice-row input {
    width: 16px;
    min-height: 16px;
    accent-color: var(--primary);
}

.file-input {
    border: 1px dashed var(--line-strong);
    border-radius: 7px;
    padding: 13px;
    background: var(--surface-soft);
}

.file-input input {
    min-height: auto;
    border: 0;
    padding: 0;
    background: transparent;
}

.primary-btn,
.secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    border: 0;
    border-radius: 7px;
    padding: 0 18px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}

.primary-btn {
    width: 100%;
    margin-top: 24px;
    color: #fff;
    background: var(--primary);
    box-shadow: 0 12px 22px rgba(23, 120, 95, .22);
}

.primary-btn:hover {
    background: var(--primary-dark);
}

.primary-btn:active,
.secondary-btn:active {
    transform: translateY(1px);
}

.primary-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
    box-shadow: none;
}

.secondary-btn {
    color: var(--text);
    background: #edf3f2;
}

.error-box,
.notice,
.geo-card {
    margin: 18px 28px 0;
    border-radius: 7px;
    padding: 12px 14px;
}

.error-box {
    color: var(--danger);
    background: #fff2ef;
    border: 1px solid #ffd3cc;
}

.notice,
.geo-card {
    color: #235544;
    background: #e8f6f0;
    border: 1px solid #b9e2d0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 26px;
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}

.brand {
    color: var(--text);
    font-size: 17px;
    font-weight: 900;
}

.topbar nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.topbar nav a {
    border-radius: 6px;
    padding: 8px 10px;
    color: #364553;
    font-weight: 650;
}

.topbar nav a:hover {
    background: #edf3f2;
    color: var(--primary-dark);
}

.panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 18px;
    box-shadow: 0 10px 26px rgba(33, 53, 71, .08);
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: end;
}

.toolbar label {
    display: grid;
    gap: 6px;
    min-width: 150px;
    color: #394854;
    font-size: 14px;
    font-weight: 700;
}

.table-wrap {
    overflow-x: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 26px rgba(33, 53, 71, .08);
}

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

th, td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    white-space: nowrap;
}

th {
    color: #53616e;
    background: #f4f7f8;
    font-size: 13px;
    font-weight: 800;
}

tr:hover td {
    background: #fbfcfc;
}

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

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.inline-form {
    display: inline;
    padding: 0;
}

.inline-form button {
    border: 0;
    padding: 0;
    color: var(--danger);
    background: transparent;
    font: inherit;
    cursor: pointer;
}

.photo-preview {
    max-width: 220px;
    border-radius: 7px;
    border: 1px solid var(--line);
}

.success {
    padding: 32px;
}

@media (max-width: 720px) {
    body {
        background:
            linear-gradient(180deg, rgba(23, 120, 95, .16), rgba(238, 243, 246, 0) 260px),
            var(--bg);
    }

    .page {
        width: min(100% - 18px, 1120px);
        padding-top: 12px;
        padding-bottom: 28px;
    }

    .form-shell {
        border-radius: 8px;
    }

    .form-header {
        padding: 24px 20px 20px;
    }

    form {
        padding: 4px 18px 22px;
    }

    .wizard-step {
        min-height: calc(100vh - 96px);
        padding: 22px 18px;
    }

    .wizard-progress {
        padding: 18px 18px 0;
    }

    .step-grid {
        grid-template-columns: 1fr;
    }

    .wizard-actions {
        grid-template-columns: 96px 1fr;
    }

    .photo-preview-box {
        min-height: 220px;
    }

    .basic-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .field {
        margin-top: 17px;
    }

    .education-table,
    .work-table {
        display: block;
        border: 0;
        background: transparent;
    }

    .paper-head {
        display: none;
    }

    .paper-cell {
        position: relative;
        border: 1px solid var(--line);
        border-radius: 7px;
        padding: 34px 10px 10px;
        margin-top: 10px;
        background: var(--surface-soft);
    }

    .paper-cell::before {
        position: absolute;
        top: 9px;
        left: 10px;
        color: #4c5b68;
        font-size: 13px;
        font-weight: 800;
    }

    .education-table .paper-cell:nth-child(5)::before,
    .work-table .paper-cell:nth-child(5)::before,
    .work-table .paper-cell:nth-child(9)::before,
    .work-table .paper-cell:nth-child(13)::before {
        content: "起止日期";
    }

    .education-table .paper-cell:nth-child(6)::before {
        content: "学历";
    }

    .education-table .paper-cell:nth-child(7)::before {
        content: "毕业院校";
    }

    .education-table .paper-cell:nth-child(8)::before {
        content: "专业/课程";
    }

    .work-table .paper-cell:nth-child(6)::before,
    .work-table .paper-cell:nth-child(10)::before,
    .work-table .paper-cell:nth-child(14)::before {
        content: "公司名称";
    }

    .work-table .paper-cell:nth-child(7)::before,
    .work-table .paper-cell:nth-child(11)::before,
    .work-table .paper-cell:nth-child(15)::before {
        content: "职位";
    }

    .work-table .paper-cell:nth-child(8)::before,
    .work-table .paper-cell:nth-child(12)::before,
    .work-table .paper-cell:nth-child(16)::before {
        content: "离职原因";
    }

    .choice-row {
        grid-template-columns: 1fr;
    }

    .error-box,
    .notice,
    .geo-card {
        margin-left: 18px;
        margin-right: 18px;
    }

    .panel {
        padding: 16px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
        padding: 12px 16px;
    }

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