:root {
  --p1-blue: #2563eb;
  --p1-blue-dark: #1748b5;
  --p1-blue-soft: #eef5ff;
  --p1-green: #16a56f;
  --p1-green-soft: #e7f7f0;
  --p1-yellow: #d99012;
  --p1-yellow-soft: #fff7df;
  --p1-red: #dc4c4c;
  --p1-ink: #17233a;
  --p1-muted: #6f7d92;
  --p1-line: #e2e8f2;
  --p1-bg: #f5f7fb;
}

body.phase1-clean { background: var(--p1-bg); color: var(--p1-ink); }
body.phase1-clean .workspace { font-family: "Microsoft YaHei", Inter, system-ui, sans-serif; }
.phase1-v2 { max-width: 1380px; margin: 0 auto; }
.phase1-button { min-height: 38px; padding: 8px 17px; border: 1px solid transparent; border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer; transition: .18s ease; }
.phase1-button:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(22, 52, 104, .11); }
.phase1-button.primary { background: var(--p1-blue); color: #fff; }
.phase1-button.secondary { border-color: #cdd9ea; background: #fff; color: #2b5cae; }
.phase1-button.success { background: var(--p1-green); color: #fff; }
.phase1-button.ghost-danger { border-color: #f0caca; background: #fff; color: var(--p1-red); }

.phase1-hr-strip { min-height: 64px; margin-bottom: 14px; padding: 10px 18px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid #dbe4f1; border-radius: 12px; background: #fff; box-shadow: 0 4px 16px rgba(31, 57, 101, .04); }
.phase1-hr-strip > div strong, .phase1-hr-strip > div span { display: block; }
.phase1-hr-strip > div span { margin-top: 2px; color: var(--p1-muted); font-size: 12px; }
.phase1-case-picker { display: flex; align-items: center; gap: 9px; color: #5a6880; font-size: 12px; }
.phase1-case-picker select { min-width: 230px; padding: 8px 35px 8px 11px; border: 1px solid #ccd7e8; border-radius: 8px; background: #fff; color: var(--p1-ink); }

.phase1-summary { min-height: 238px; padding: 30px 34px; display: grid; grid-template-columns: 150px minmax(350px, 1fr) minmax(275px, 350px); align-items: center; gap: 30px; position: relative; overflow: hidden; border: 1px solid #dce6f7; border-radius: 18px; background: linear-gradient(112deg, #edf5ff 0%, #fff 48%, #f8fbff 100%); box-shadow: 0 13px 34px rgba(34, 72, 134, .08); }
.phase1-summary::before, .phase1-summary::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.phase1-summary::before { width: 300px; height: 300px; left: -120px; top: -170px; background: rgba(66, 133, 244, .08); }
.phase1-summary::after { width: 170px; height: 170px; right: -70px; bottom: -100px; background: rgba(66, 133, 244, .05); }
.phase1-summary-icon { width: 126px; height: 144px; position: relative; display: grid; place-items: center; border-radius: 22px; background: linear-gradient(145deg, #6aa6ff, #2563eb); box-shadow: 0 20px 40px rgba(37, 99, 235, .24); }
.phase1-summary-icon > div { width: 84px; height: 102px; padding: 25px 15px 0; display: grid; align-content: start; gap: 17px; border-radius: 10px; background: #fff; box-shadow: inset 0 0 0 1px #e1eafa; }
.phase1-summary-icon i { height: 7px; margin-left: 21px; position: relative; border-radius: 10px; background: #cfdbef; }
.phase1-summary-icon i::before { content: "✓"; position: absolute; left: -22px; top: -8px; color: var(--p1-green); font-style: normal; font-size: 18px; font-weight: 900; }
.phase1-summary-icon > span { width: 45px; height: 45px; position: absolute; right: -13px; bottom: 7px; display: grid; place-items: center; border: 6px solid #eef5ff; border-radius: 50%; background: var(--p1-green); color: #fff; font-size: 22px; font-weight: 900; }
.phase1-kicker { color: var(--p1-blue); font-size: 11px; font-weight: 900; letter-spacing: .13em; }
.phase1-summary-title { margin-top: 4px; display: flex; align-items: center; gap: 14px; }
.phase1-summary-title h1 { margin: 0; font-size: 29px; line-height: 1.3; letter-spacing: -.02em; }
.phase1-summary-title > span { flex: 0 0 auto; padding: 5px 12px; border-radius: 999px; background: #dceaff; color: var(--p1-blue); font-size: 12px; font-weight: 800; }
.phase1-summary-copy > p { margin: 8px 0 18px; color: var(--p1-muted); }
.phase1-summary-copy dl { margin: 0; display: grid; gap: 9px; }
.phase1-summary-copy dl div { display: grid; grid-template-columns: 90px 1fr; align-items: center; }
.phase1-summary-copy dt { color: var(--p1-muted); }
.phase1-summary-copy dt::before { content: "▣"; margin-right: 8px; color: var(--p1-blue); }
.phase1-summary-copy dl div:last-child dt::before { content: "◷"; }
.phase1-summary-copy dd { margin: 0; color: #46556d; font-weight: 600; }
.phase1-summary-progress { position: relative; z-index: 1; }
.phase1-summary-progress > div:first-child { display: flex; align-items: baseline; gap: 8px; color: var(--p1-muted); }
.phase1-summary-progress strong { margin-left: auto; color: var(--p1-ink); font-size: 20px; }
.phase1-summary-progress strong small { color: var(--p1-muted); font-size: 12px; font-weight: 500; }
.phase1-summary-progress b { min-width: 45px; color: var(--p1-blue); font-size: 16px; text-align: right; }
.phase1-progress { height: 10px; margin: 10px 0 21px; overflow: hidden; border-radius: 99px; background: #e6ecf5; }
.phase1-progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #1d5ce2, #4d91fb); transition: width .25s; }
.phase1-next-task { padding: 14px 16px; border: 1px solid #d4e0f3; border-radius: 10px; background: rgba(255, 255, 255, .86); box-shadow: 0 5px 16px rgba(43, 76, 130, .06); }
.phase1-next-task span, .phase1-next-task strong { display: block; }
.phase1-next-task span { color: var(--p1-muted); font-size: 11px; }
.phase1-next-task strong { margin-top: 3px; color: #1e3c70; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.phase1-chain { margin-top: 18px; padding-left: 58px; position: relative; }
.phase1-chain::before { content: ""; position: absolute; left: 25px; top: -18px; bottom: 45px; border-left: 2px dashed #b7c9e8; }
.phase1-task, .phase1-exam-node { position: relative; margin-bottom: 14px; }
.phase1-chain-node { width: 58px; position: absolute; left: -58px; top: 29px; z-index: 2; display: flex; align-items: center; }
.phase1-chain-node::after { content: ""; height: 1px; flex: 1; background: #aebed5; }
.phase1-chain-node span { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border: 6px solid var(--p1-bg); border-radius: 50%; background: #9caabe; color: #fff; font-weight: 900; box-shadow: 0 0 0 1px #9caabe; }
.phase1-task.completed .phase1-chain-node span { background: var(--p1-green); box-shadow: 0 0 0 1px var(--p1-green); }
.phase1-task.pending .phase1-chain-node span { background: var(--p1-yellow); box-shadow: 0 0 0 1px var(--p1-yellow); }
.phase1-task.is-next.not-completed .phase1-chain-node span { border-color: #dceaff; background: #fff; color: var(--p1-blue); box-shadow: 0 0 0 5px var(--p1-blue); }
.phase1-task-card { min-height: 178px; padding: 19px 22px 17px; border: 1px solid var(--p1-line); border-radius: 13px; background: #fff; box-shadow: 0 5px 18px rgba(25, 52, 96, .045); }
.phase1-task.completed .phase1-task-card { border-color: #9bdcc1; }
.phase1-task.pending .phase1-task-card { border-color: #efcd78; }
.phase1-task.is-next.not-completed .phase1-task-card { border-color: #5d94f3; box-shadow: 0 9px 24px rgba(37, 99, 235, .1); }
.phase1-task-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.phase1-task-title { display: flex; align-items: center; gap: 11px; min-width: 0; }
.phase1-sequence { width: 29px; height: 29px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 7px; background: #98a6ba; color: #fff; font-weight: 900; }
.completed .phase1-sequence { background: var(--p1-green); }
.pending .phase1-sequence { background: var(--p1-yellow); }
.is-next .phase1-sequence { background: var(--p1-blue); }
.phase1-task-title h3 { margin: 0; font-size: 18px; }
.phase1-task-title p { margin: 1px 0 0; color: #8995a6; font-size: 11px; }
.phase1-status { padding: 5px 12px; flex: 0 0 auto; border-radius: 999px; font-size: 12px; font-weight: 800; }
.phase1-status.not-completed { background: #ffe9e9; color: #da3939; }
.phase1-status.pending { background: var(--p1-yellow-soft); color: #bb7410; }
.phase1-status.completed { background: var(--p1-green-soft); color: #0d9362; }
.phase1-task-time { margin: 9px 0 0 40px; color: #65748a; font-size: 12px; }
.phase1-task-time span { margin-right: 6px; color: var(--p1-blue); font-size: 15px; }
.phase1-task-description { margin: 9px 0 13px 40px; color: #637187; white-space: pre-wrap; }
.phase1-materials { min-height: 32px; margin-left: 40px; display: flex; align-items: flex-start; gap: 13px; }
.phase1-materials > strong { flex: 0 0 auto; padding-top: 5px; color: #55647a; font-size: 12px; }
.phase1-materials > div { display: flex; flex-wrap: wrap; gap: 7px; }
.phase1-file-chip, .phase1-all-files { min-height: 29px; padding: 4px 9px; border: 1px solid #dce4ef; border-radius: 7px; background: #fafcff; color: #356dc9; font-size: 12px; cursor: pointer; }
.phase1-file-chip { max-width: 235px; display: inline-flex; align-items: center; gap: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phase1-file-chip span { padding: 1px 4px; border-radius: 3px; background: #e7effd; color: #2f67c7; font-size: 9px; font-weight: 900; }
.phase1-all-files { border-color: transparent; background: transparent; font-weight: 700; }
.phase1-no-file { padding-top: 4px; color: #9aa5b4; font-size: 12px; }
.phase1-task-actions { min-height: 38px; margin-top: 13px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.phase1-waiting-copy { margin-right: auto; display: inline-flex; align-items: center; gap: 7px; color: #b7740d; font-size: 12px; }
.phase1-waiting-copy i { width: 7px; height: 7px; border-radius: 50%; background: var(--p1-yellow); }

.phase1-exam-node { margin-top: 17px; }
.phase1-chain-node.exam { top: 20px; }
.phase1-chain-node.exam span { width: 50px; height: 50px; background: var(--p1-blue); box-shadow: 0 0 0 1px var(--p1-blue); font-size: 20px; }
.phase1-exam-card { min-height: 104px; padding: 18px 22px; display: grid; grid-template-columns: minmax(260px, 1fr) auto auto; align-items: center; gap: 22px; border: 1px solid #8db5f7; border-radius: 13px; background: linear-gradient(90deg, #f1f6ff, #fff); box-shadow: 0 7px 20px rgba(37, 99, 235, .07); }
.phase1-exam-kicker { color: var(--p1-blue); font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.phase1-exam-card h3 { margin: 2px 0 0; font-size: 18px; color: #183769; }
.phase1-exam-card p { margin: 4px 0 0; color: var(--p1-muted); }
.phase1-exam-date small, .phase1-exam-date strong { display: block; }
.phase1-exam-date small { color: var(--p1-muted); font-size: 10px; }
.phase1-exam-date strong { margin-top: 3px; color: #43536c; }
.phase1-exam-scores { display: flex; gap: 7px; flex-wrap: wrap; }
.phase1-exam-scores span { min-width: 88px; padding: 8px 10px; border: 1px solid #dce6f5; border-radius: 8px; background: #fff; }
.phase1-exam-scores small, .phase1-exam-scores strong { display: block; }
.phase1-exam-scores small { color: var(--p1-muted); font-size: 10px; }
.phase1-exam-scores strong { margin-top: 2px; color: var(--p1-blue-dark); }
.phase1-exam-empty { padding: 7px 11px; border-radius: 99px; background: #e8eef7; color: #65748b; font-size: 12px; }
.phase1-exam-form { grid-column: 1 / -1; padding-top: 15px; display: flex; align-items: flex-end; justify-content: flex-end; gap: 9px; border-top: 1px solid #dfe7f4; }
.phase1-exam-form label { display: grid; gap: 4px; color: #68768a; font-size: 11px; }
.phase1-exam-form input { min-width: 165px; padding: 8px 10px; border: 1px solid #cbd7e8; border-radius: 7px; }

.phase1-zero, .phase1-loading { min-height: 330px; display: grid; place-content: center; justify-items: center; gap: 6px; border: 1px dashed #bac7da; border-radius: 14px; background: #fff; color: var(--p1-muted); text-align: center; }
.phase1-zero > span { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; background: var(--p1-blue-soft); color: var(--p1-blue); font-size: 26px; }
.phase1-zero h3, .phase1-loading strong { margin: 7px 0 0; color: var(--p1-ink); }
.phase1-zero p { margin: 0 0 10px; }
.phase1-zero.compact { min-height: 190px; grid-column: 1 / -1; }
.phase1-loading { min-height: 70vh; border: 0; background: transparent; }
.phase1-loading i { width: 31px; height: 31px; border: 3px solid #dce6f5; border-top-color: var(--p1-blue); border-radius: 50%; animation: p1spin .8s linear infinite; }
@keyframes p1spin { to { transform: rotate(360deg); } }

.phase1-drawer-layer { position: fixed; inset: 0; z-index: 10000; display: flex; justify-content: flex-end; }
.phase1-drawer-backdrop { position: absolute; inset: 0; border: 0; background: rgba(14, 25, 44, .42); cursor: default; }
.phase1-drawer { width: min(940px, 88vw); height: 100%; position: relative; display: flex; flex-direction: column; background: #fff; box-shadow: -18px 0 50px rgba(10, 27, 55, .2); animation: p1drawer .22s ease-out; }
@keyframes p1drawer { from { transform: translateX(30px); opacity: .4; } }
.phase1-drawer > header { min-height: 78px; padding: 15px 21px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--p1-line); }
.phase1-drawer > header span { color: var(--p1-blue); font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.phase1-drawer h2 { margin: 2px 0 0; font-size: 19px; }
.phase1-drawer-close { width: 38px; height: 38px; border: 0; border-radius: 50%; background: #f0f3f8; color: #48566a; font-size: 25px; cursor: pointer; }
.phase1-drawer-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 230px 1fr; }
.phase1-drawer-body nav { padding: 14px; overflow: auto; border-right: 1px solid var(--p1-line); background: #f8fafe; }
.phase1-drawer-body nav button { width: 100%; margin-bottom: 7px; padding: 10px; display: flex; align-items: center; gap: 8px; border: 1px solid transparent; border-radius: 8px; background: transparent; text-align: left; cursor: pointer; }
.phase1-drawer-body nav button:hover, .phase1-drawer-body nav button.active { border-color: #c9daf7; background: #fff; color: var(--p1-blue-dark); box-shadow: 0 4px 12px rgba(28, 65, 120, .06); }
.phase1-drawer-body nav button span { padding: 2px 5px; border-radius: 4px; background: #e7effc; color: var(--p1-blue); font-size: 9px; font-weight: 900; }
.phase1-drawer-body nav button strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.phase1-preview { min-width: 0; display: flex; flex-direction: column; background: #eef1f5; }
.phase1-preview-head { min-height: 48px; padding: 9px 13px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid #d8dee8; background: #fff; }
.phase1-preview-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phase1-preview-head a { flex: 0 0 auto; color: var(--p1-blue); text-decoration: none; font-size: 12px; font-weight: 700; }
.phase1-preview iframe { width: 100%; flex: 1; border: 0; background: #fff; }
.phase1-drawer-empty { flex: 1; display: grid; place-content: center; justify-items: center; gap: 5px; color: var(--p1-muted); }

.phase1-settings { max-width: 1280px; margin: 0 auto; color: var(--p1-ink); }
body:has(.phase1-settings) { background: var(--p1-bg); }
body:has(.phase1-settings) > .topbar { display: none; }
body:has(.phase1-settings) > .layout { display: block; min-height: 100vh; padding: 20px 24px 40px; background: var(--p1-bg); }
body:has(.phase1-settings) > .layout .workspace { max-width: none; width: 100%; min-height: calc(100vh - 40px); margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.phase1-settings-head { padding: 25px 27px; display: flex; justify-content: space-between; align-items: center; gap: 25px; border: 1px solid #dce6f5; border-radius: 15px; background: linear-gradient(105deg, #eef5ff, #fff); }
.phase1-settings-head > div:first-child > span { color: var(--p1-blue); font-size: 10px; font-weight: 900; letter-spacing: .13em; }
.phase1-settings-head h1 { margin: 3px 0; font-size: 25px; }
.phase1-settings-head p { margin: 0; color: var(--p1-muted); }
.phase1-year-badges { min-width: 210px; display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.phase1-year-badges small { width: 100%; color: var(--p1-muted); text-align: right; }
.phase1-year-badges b { padding: 5px 9px; border-radius: 7px; background: var(--p1-blue-soft); color: var(--p1-blue-dark); }
.phase1-year-badges em { color: var(--p1-red); font-style: normal; }
.phase1-inline-error { margin-top: 12px; padding: 10px 13px; border: 1px solid #efc5c5; border-radius: 9px; background: #fff1f1; color: #a43c3c; }
.phase1-settings-grid { margin-top: 15px; display: grid; grid-template-columns: minmax(320px, .72fr) minmax(500px, 1.28fr); gap: 14px; align-items: start; }
.phase1-config-form { padding: 20px; border: 1px solid var(--p1-line); border-radius: 13px; background: #fff; box-shadow: 0 5px 18px rgba(25, 52, 96, .04); }
.phase1-form-title { margin-bottom: 15px; display: flex; gap: 11px; }
.phase1-form-title > span { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; background: var(--p1-blue-soft); color: var(--p1-blue); font-weight: 900; }
.phase1-form-title h2 { margin: 0; font-size: 17px; }
.phase1-form-title p { margin: 3px 0 0; color: var(--p1-muted); font-size: 12px; }
.phase1-config-form .form-grid { gap: 10px; }
.phase1-config-list { margin-top: 15px; padding: 20px; border: 1px solid var(--p1-line); border-radius: 13px; background: #fff; }
.phase1-config-list > div:first-child { display: flex; justify-content: space-between; align-items: center; }
.phase1-config-list h2 { margin: 0; font-size: 18px; }
.phase1-config-list > div:first-child span { color: var(--p1-muted); }
.phase1-config-cards { margin-top: 13px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.phase1-config-card { padding: 16px; border: 1px solid var(--p1-line); border-radius: 10px; background: #fff; }
.phase1-config-card.disabled { opacity: .66; background: #f6f7f9; }
.phase1-config-card > div:first-child { display: flex; justify-content: space-between; gap: 10px; color: var(--p1-blue); font-size: 11px; font-weight: 800; }
.phase1-config-card em { color: var(--p1-green); font-style: normal; }
.phase1-config-card.disabled em { color: var(--p1-muted); }
.phase1-config-card h3 { margin: 6px 0 3px; font-size: 16px; }
.phase1-config-card > p { margin: 0; min-height: 42px; color: var(--p1-muted); }
.phase1-config-card dl { margin: 12px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid #e8edf4; border-radius: 8px; }
.phase1-config-card dl div { padding: 7px 8px; border-right: 1px solid #e8edf4; }
.phase1-config-card dl div:last-child { border: 0; }
.phase1-config-card dt { color: #929dab; font-size: 9px; }
.phase1-config-card dd { margin: 1px 0 0; color: #4c5a70; font-size: 12px; font-weight: 700; }

@media (max-width: 1050px) {
  .phase1-summary { grid-template-columns: 115px minmax(300px, 1fr); }
  .phase1-summary-icon { width: 105px; height: 124px; }
  .phase1-summary-progress { grid-column: 1 / -1; }
  .phase1-settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body.phase1-clean .layout.employee-page .workspace { padding: 11px; }
  .phase1-hr-strip, .phase1-settings-head { align-items: stretch; flex-direction: column; }
  .phase1-case-picker { align-items: stretch; flex-direction: column; }
  .phase1-case-picker select { min-width: 0; width: 100%; }
  .phase1-summary { padding: 20px; grid-template-columns: 1fr; gap: 16px; }
  .phase1-summary-icon { display: none; }
  .phase1-summary-title { align-items: flex-start; flex-direction: column; }
  .phase1-summary-title h1 { font-size: 24px; }
  .phase1-summary-copy dl div { grid-template-columns: 82px 1fr; }
  .phase1-chain { padding-left: 40px; }
  .phase1-chain::before { left: 18px; }
  .phase1-chain-node { left: -40px; width: 40px; }
  .phase1-task-card { padding: 15px; }
  .phase1-task-time, .phase1-task-description, .phase1-materials { margin-left: 0; }
  .phase1-task-heading, .phase1-task-actions { align-items: stretch; flex-direction: column; }
  .phase1-task-actions .phase1-button { width: 100%; }
  .phase1-waiting-copy { margin-bottom: 3px; }
  .phase1-exam-card { grid-template-columns: 1fr; }
  .phase1-exam-form { align-items: stretch; flex-direction: column; }
  .phase1-exam-form input { width: 100%; }
  .phase1-drawer { width: 100vw; }
  .phase1-drawer-body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .phase1-drawer-body nav { max-height: 150px; border-right: 0; border-bottom: 1px solid var(--p1-line); }
  .phase1-config-cards { grid-template-columns: 1fr; }
  .phase1-config-card dl { grid-template-columns: repeat(2, 1fr); }
  .phase1-config-card dl div:nth-child(2) { border-right: 0; }
  .phase1-year-badges small { text-align: left; }
}
