/* =========================================================================
   公司工作数据库 — 前台主题 (Fluent / Microsoft 风格)
   纯白背景、大留白、扁平卡片、细边框、克制主色
   ========================================================================= */

:root {
    /* 中性 */
    --cwd-ink: #1b1b1f;
    --cwd-text: #2b2b30;
    --cwd-muted: #61646b;
    --cwd-faint: #8a8d94;
    --cwd-border: #e6e8ee;
    --cwd-border-strong: #d3d7e0;
    --cwd-bg: #ffffff;
    --cwd-surface: #ffffff;
    --cwd-soft: #f5f6f9;

    /* 品牌（活力紫罗兰，独立于蓝/橙/绿竞品） */
    --cwd-brand: #7c5cff;
    --cwd-brand-deep: #5b3fd6;
    --cwd-brand-ink: #4326b0;
    --cwd-brand-soft: #efeaff;
    --cwd-brand-ring: rgba(124, 92, 255, .22);

    /* 语义：好 / 中 / 差 */
    --cwd-good: #0f7b4f;
    --cwd-good-soft: #e7f6ef;
    --cwd-warn: #b06a07;
    --cwd-warn-soft: #fbf1e0;
    --cwd-bad: #c8362a;
    --cwd-bad-soft: #fdecea;

    --cwd-radius: 8px;
    --cwd-radius-sm: 6px;
    --cwd-shadow-hover: 0 2px 10px rgba(20, 30, 60, .09);
}

* { box-sizing: border-box; }

body.cwd-body {
    margin: 0;
    background: var(--cwd-bg);
    color: var(--cwd-text);
    font-family: "Segoe UI", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--cwd-brand); text-decoration: none; }
a:hover { color: var(--cwd-brand-deep); text-decoration: underline; }

/* ---------- header ---------- */
.cwd-site-header {
    background: #fff;
    border-bottom: 1px solid var(--cwd-border);
}
.cwd-site-header__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 28px;
}
.cwd-site-header__brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 18px;
    color: var(--cwd-ink);
    letter-spacing: .2px;
}
.cwd-site-header__brand::before {
    content: "";
    width: 18px;
    height: 18px;
    border-radius: 3px;
    background: var(--cwd-brand);
    box-shadow: 4px 4px 0 var(--cwd-brand-deep);
}
.cwd-site-header__brand:hover { text-decoration: none; }
.cwd-site-header__nav { display: flex; gap: 4px; margin-left: auto; }
.cwd-site-header__nav a {
    color: var(--cwd-ink);
    font-size: 14.5px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: var(--cwd-radius-sm);
    transition: background .12s ease, color .12s ease;
}
.cwd-site-header__nav a:hover { color: var(--cwd-brand-deep); background: var(--cwd-soft); text-decoration: none; }

.cwd-main { max-width: 1200px; margin: 0 auto; padding: 40px 24px 64px; }

.cwd-site-footer {
    border-top: 1px solid var(--cwd-border);
    background: #fff;
}
.cwd-site-footer p {
    max-width: 1200px;
    margin: 0 auto;
    padding: 22px 24px 30px;
    color: var(--cwd-faint);
    font-size: 13px;
}

/* ---------- hero ---------- */
.cwd-hero {
    margin-bottom: 32px;
}
.cwd-hero h1 {
    margin: 0 0 12px;
    font-size: 34px;
    line-height: 1.2;
    font-weight: 700;
    color: var(--cwd-ink);
    letter-spacing: -.2px;
}
.cwd-hero p { margin: 0; color: var(--cwd-muted); font-size: 16px; max-width: 720px; }
.cwd-hero p strong { color: var(--cwd-brand-deep); font-weight: 700; }

/* ---------- filters ---------- */
.cwd-filters {
    background: var(--cwd-soft);
    border: 1px solid var(--cwd-border);
    border-radius: var(--cwd-radius);
    padding: 22px;
    margin-bottom: 24px;
}
.cwd-filters__row { display: flex; flex-wrap: wrap; gap: 14px; }
.cwd-field { display: flex; flex-direction: column; gap: 6px; min-width: 150px; flex: 1 1 150px; }
.cwd-field label { font-size: 12.5px; font-weight: 600; color: var(--cwd-muted); }
.cwd-field input,
.cwd-field select,
.cwd-field textarea {
    border: 1px solid var(--cwd-border-strong);
    border-radius: var(--cwd-radius-sm);
    padding: 9px 11px;
    font: inherit;
    font-size: 14px;
    background: #fff;
    color: inherit;
    transition: border-color .12s ease, box-shadow .12s ease;
}
.cwd-field select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 36px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%238a8d94' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
    background-size: 12px 12px;
}
.cwd-field select:hover,
.cwd-field select:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%237c5cff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.cwd-field select::-ms-expand { display: none; }
.cwd-field input:focus,
.cwd-field select:focus,
.cwd-field textarea:focus {
    outline: none;
    border-color: var(--cwd-brand);
    box-shadow: var(--cwd-brand-ring);
}
.cwd-search-row { display: flex; gap: 10px; align-items: flex-end; }
.cwd-search-row .cwd-field { flex: 1 1 auto; }

.cwd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--cwd-border-strong);
    background: #fff;
    color: var(--cwd-text);
    border-radius: var(--cwd-radius-sm);
    padding: 9px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .12s ease, color .12s ease, background .12s ease;
    white-space: nowrap;
}
.cwd-btn:hover { border-color: var(--cwd-brand); color: var(--cwd-brand-deep); }
.cwd-btn:active { transform: translateY(1px); }
.cwd-btn--primary {
    color: #fff;
    background: var(--cwd-brand);
    border-color: transparent;
}
.cwd-btn--primary:hover { color: #fff; background: var(--cwd-brand-deep); }

.cwd-fieldset { border: 0; padding: 0; margin: 20px 0 0; }
.cwd-fieldset legend {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--cwd-ink);
    padding: 0 0 10px;
    letter-spacing: .3px;
}
.cwd-checks {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 18px;
    margin-top: 8px;
    padding: 10px 0;
}
.cwd-checks + .cwd-checks { border-top: 1px solid var(--cwd-border); }
.cwd-checks__title { flex: 0 0 auto; min-width: 64px; font-size: 13px; font-weight: 600; color: var(--cwd-text); }
.cwd-check {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    cursor: pointer;
    padding: 6px 14px;
    border: 1px solid var(--cwd-border-strong);
    border-radius: var(--cwd-radius-sm);
    background: #fff;
    transition: border-color .12s ease, background .12s ease, color .12s ease;
    user-select: none;
}
.cwd-check:hover { border-color: var(--cwd-brand); }
.cwd-check input { margin: 0; accent-color: var(--cwd-brand); cursor: pointer; }
.cwd-check:has(input:checked) {
    border-color: var(--cwd-brand);
    background: var(--cwd-brand-soft);
    color: var(--cwd-brand-deep);
    font-weight: 600;
}
.cwd-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 22px 2px 10px;
    font-size: 14px;
    color: var(--cwd-muted);
}
.cwd-toolbar strong { color: var(--cwd-ink); }

/* ---------- cards ---------- */
.cwd-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px;
}
.cwd-card {
    display: flex;
    flex-direction: column;
    background: var(--cwd-surface);
    border: 1px solid var(--cwd-border);
    border-radius: var(--cwd-radius);
    padding: 20px;
    transition: border-color .14s ease, box-shadow .14s ease;
}
.cwd-card:hover {
    border-color: var(--cwd-border-strong);
    box-shadow: var(--cwd-shadow-hover);
}
.cwd-card__title { font-size: 17px; font-weight: 600; margin: 0 0 8px; line-height: 1.4; }
.cwd-card__title a { color: var(--cwd-ink); }
.cwd-card__title a:hover { color: var(--cwd-brand-deep); text-decoration: none; }
.cwd-card__meta { font-size: 13px; color: var(--cwd-muted); margin: 0 0 14px; }
.cwd-card__signals { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }

.cwd-tag {
    font-size: 12px;
    line-height: 1.6;
    padding: 2px 11px;
    border-radius: var(--cwd-radius-sm);
    background: var(--cwd-brand-soft);
    color: var(--cwd-brand-deep);
    font-weight: 600;
    white-space: nowrap;
}
.cwd-tag--muted { background: #eef0f4; color: var(--cwd-muted); }
.cwd-tag--good { background: var(--cwd-good-soft); color: var(--cwd-good); }
.cwd-tag--warn { background: var(--cwd-warn-soft); color: var(--cwd-warn); }
.cwd-tag--bad  { background: var(--cwd-bad-soft);  color: var(--cwd-bad); }

.cwd-card__count {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 11px;
    border-radius: var(--cwd-radius-sm);
    background: var(--cwd-ink);
    color: #fff;
}
.cwd-card__count.is-empty { background: #eef0f4; color: var(--cwd-faint); font-weight: 600; }

/* ---------- pagination ---------- */
.cwd-pagination { display: flex; gap: 8px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.cwd-pagination a,
.cwd-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 13px;
    border: 1px solid var(--cwd-border-strong);
    border-radius: var(--cwd-radius-sm);
    background: #fff;
    font-size: 14px;
    color: var(--cwd-text);
    transition: border-color .12s ease, color .12s ease;
}
.cwd-pagination a:hover { border-color: var(--cwd-brand); color: var(--cwd-brand-deep); text-decoration: none; }
.cwd-pagination .is-active { background: var(--cwd-brand); border-color: var(--cwd-brand); color: #fff; font-weight: 700; }

/* ---------- empty ---------- */
.cwd-empty {
    text-align: center;
    padding: 56px 24px;
    background: var(--cwd-soft);
    border: 1px solid var(--cwd-border);
    border-radius: var(--cwd-radius);
    color: var(--cwd-muted);
}

/* ---------- detail ---------- */
.cwd-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 18px; font-size: 14px; font-weight: 600; color: var(--cwd-brand); }
.cwd-back:hover { color: var(--cwd-brand-deep); text-decoration: none; }

.cwd-detail {
    background: var(--cwd-surface);
    border: 1px solid var(--cwd-border);
    border-radius: var(--cwd-radius);
    padding: 32px;
}
.cwd-detail__title {
    margin: 0 0 10px;
    font-size: 30px;
    font-weight: 700;
    color: var(--cwd-ink);
    letter-spacing: -.2px;
}
.cwd-detail__meta { color: var(--cwd-muted); font-size: 14px; margin-bottom: 6px; }
.cwd-detail > p { color: var(--cwd-text); }

.cwd-section { margin-top: 38px; }
.cwd-section > h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 16px;
    color: var(--cwd-ink);
}
.cwd-section > h2::after {
    content: "";
    display: block;
    width: 36px;
    height: 3px;
    margin-top: 10px;
    border-radius: 3px;
    background: var(--cwd-brand);
}

.cwd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.cwd-stat {
    border: 1px solid var(--cwd-border);
    border-radius: var(--cwd-radius);
    padding: 18px;
    background: #fff;
    transition: border-color .14s ease, box-shadow .14s ease;
}
.cwd-stat:hover { border-color: var(--cwd-border-strong); box-shadow: var(--cwd-shadow-hover); }
.cwd-stat__value { font-size: 28px; font-weight: 700; color: var(--cwd-ink); line-height: 1.1; }
.cwd-stat__value.is-good { color: var(--cwd-good); }
.cwd-stat__value.is-bad  { color: var(--cwd-bad); }
.cwd-stat__value.is-brand { color: var(--cwd-brand-deep); }
.cwd-stat__label { font-size: 13px; color: var(--cwd-muted); margin-top: 8px; }

.cwd-note {
    font-size: 13px;
    color: var(--cwd-muted);
    background: var(--cwd-soft);
    border: 1px solid var(--cwd-border);
    border-radius: var(--cwd-radius-sm);
    padding: 11px 14px;
    margin-top: 14px;
}

.cwd-feedback-list { display: grid; gap: 16px; }
.cwd-feedback {
    border: 1px solid var(--cwd-border);
    border-radius: var(--cwd-radius);
    padding: 18px;
    background: #fff;
    transition: border-color .14s ease;
}
.cwd-feedback:hover { border-color: var(--cwd-border-strong); }
.cwd-feedback__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.cwd-feedback__comment { margin: 0; white-space: pre-wrap; color: var(--cwd-text); font-size: 14.5px; }

/* ---------- forms ---------- */
.cwd-form { display: grid; gap: 18px; }
.cwd-form__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.cwd-form__actions { display: flex; gap: 12px; align-items: center; }
.cwd-alert { border-radius: var(--cwd-radius-sm); padding: 12px 15px; font-size: 14px; }
.cwd-alert--error { background: var(--cwd-bad-soft); color: var(--cwd-bad); border: 1px solid #f4c9c4; }
.cwd-alert--success { background: var(--cwd-good-soft); color: var(--cwd-good); border: 1px solid #b6e6d2; }
.cwd-error { color: var(--cwd-bad); font-size: 13px; }
.cwd-honeypot { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

dialog.cwd-dialog { border: 0; border-radius: var(--cwd-radius); padding: 0; width: min(640px, 94vw); box-shadow: 0 12px 40px rgba(20, 30, 60, .22); }
dialog.cwd-dialog::backdrop { background: rgba(20, 22, 30, .5); }
.cwd-dialog__inner { padding: 28px; }
.cwd-dialog__title { margin: 0 0 18px; font-size: 19px; font-weight: 700; color: var(--cwd-ink); }
.cwd-dialog__close { position: absolute; top: 14px; right: 18px; border: 0; background: transparent; font-size: 24px; line-height: 1; color: var(--cwd-faint); cursor: pointer; }

/* ---------- responsive ---------- */
@media (max-width: 640px) {
    .cwd-main { padding: 28px 16px 48px; }
    .cwd-hero h1 { font-size: 27px; }
    .cwd-detail { padding: 22px; }
    .cwd-detail__title { font-size: 25px; }
    .cwd-search-row { flex-direction: column; align-items: stretch; }
    .cwd-search-row .cwd-btn { width: 100%; }
    .cwd-cards { grid-template-columns: 1fr; }
    .cwd-site-header__nav a { padding: 8px 10px; }
}
