:root {
  --blue: #1677ff;
  --blue-soft: #eaf3ff;
  --ink: #171a1f;
  --muted: #8a919e;
  --bg: #f5f6f7;
  --line: #edf0f3;
  --green: #19a974;
  --orange: #ff9d3d;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: var(--ink);
  background: #e9ebef;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #e9ebef; }
button, input, select { font: inherit; }
button { color: inherit; }
.app-shell { width: min(100%, 430px); min-height: 100vh; margin: 0 auto; background: var(--bg); box-shadow: 0 0 40px rgba(30,42,60,.12); position: relative; }
.ding-header { height: 52px; padding: env(safe-area-inset-top) 14px 0; display: grid; grid-template-columns: 42px 1fr 42px; align-items: center; position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.ding-header h1 { margin: 0; font-size: 17px; text-align: center; font-weight: 600; }
.icon-button { width: 36px; height: 36px; border: 0; background: transparent; font-size: 29px; line-height: 1; cursor: pointer; }
.icon-button.more { font-size: 17px; letter-spacing: 1px; }
.app-content { min-height: calc(100vh - 110px); padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.page { display: none; padding: 14px; animation: fade .08s ease; }
.page.active { display: block; }
@keyframes fade { from { opacity: .35; transform: translateY(3px); } }
.welcome-card { display: flex; align-items: center; justify-content: space-between; padding: 9px 2px 17px; }
.welcome-card h2 { margin: 5px 0 4px; font-size: 25px; letter-spacing: -.5px; }
.welcome-card p { margin: 0; color: var(--muted); font-size: 11px; max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag { color: var(--blue); font-size: 12px; font-weight: 600; }
.avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg,#4fa3ff,#166dff); color: white; font-weight: 700; box-shadow: 0 5px 14px rgba(22,119,255,.25); }
.month-row { background: white; border-radius: 13px; padding: 13px 15px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.month-row div span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 3px; }
.month-row strong { font-size: 14px; }
.status-dot { color: var(--green); font-size: 11px; }
.status-dot::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: var(--green); }
.summary-card { padding: 22px; border-radius: 18px; color: white; background: linear-gradient(145deg,#2587ff 0%,#1166ed 60%,#0d55d2 100%); box-shadow: 0 12px 28px rgba(22,119,255,.22); }
.summary-card p { margin: 0 0 8px; font-size: 12px; opacity: .8; }
.summary-card > strong { font-size: 38px; letter-spacing: -1px; }
.summary-card > span { margin-left: 5px; font-size: 12px; opacity: .75; }
.split-stats { margin-top: 19px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.2); display: grid; grid-template-columns: 1fr 1fr; }
.split-stats div + div { border-left: 1px solid rgba(255,255,255,.2); padding-left: 22px; }
.split-stats span { display: block; font-size: 11px; opacity: .72; }
.split-stats strong { display: block; margin-top: 4px; font-size: 19px; }
.section-card { margin-top: 12px; padding: 17px; background: white; border-radius: 15px; }
.section-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.section-title h3 { margin: 3px 0 0; font-size: 16px; }
.section-kicker { color: var(--muted); font-size: 10px; }
.blue-text, .text-button { color: var(--blue); font-size: 12px; }
.text-button { border: 0; background: transparent; cursor: pointer; padding: 4px 0; }
.donut-wrap { display: flex; align-items: center; justify-content: center; gap: 30px; padding: 18px 0 3px; }
.donut { width: 116px; height: 116px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--blue) 0 27%, #dcecff 27% 100%); position: relative; }
.donut::after { content: ""; position: absolute; inset: 15px; background: white; border-radius: 50%; }
.donut span { position: relative; z-index: 1; font-size: 18px; font-weight: 700; }
.legend p { margin: 12px 0; font-size: 11px; color: var(--muted); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 7px; }
.legend i.production { background: #dcecff; }
.legend i.research { background: var(--blue); }
.legend strong { color: var(--ink); margin-left: 7px; }
.rank-list { margin-top: 12px; }
.rank-item { display: grid; grid-template-columns: 24px 1fr auto; gap: 9px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.rank-number { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 6px; background: #f0f2f5; color: var(--muted); font-size: 10px; }
.rank-item:nth-child(-n+3) .rank-number { color: var(--blue); background: var(--blue-soft); }
.rank-main strong { display: block; font-size: 12px; }
.rank-main span { display: block; color: var(--muted); font-size: 9px; margin-top: 3px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 235px; }
.rank-hours { font-size: 12px; font-weight: 600; }
.sticky-tools { position: sticky; top: 52px; z-index: 10; margin: -14px -14px 0; padding: 12px 14px 10px; background: var(--bg); }
.search-box { height: 42px; display: flex; align-items: center; gap: 8px; padding: 0 12px; background: white; border-radius: 11px; }
.search-box span { color: var(--muted); font-size: 21px; }
.search-box input { width: 100%; border: 0; outline: 0; font-size: 13px; background: transparent; }
.filter-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 9px; }
.filter-row select { height: 35px; border: 0; padding: 0 9px; border-radius: 9px; background: white; color: #4a5260; font-size: 11px; min-width: 0; }
.list-summary { display: flex; justify-content: space-between; padding: 4px 2px 10px; color: var(--muted); font-size: 10px; }
.machine-list { display: grid; gap: 9px; }
.machine-card { width: 100%; border: 0; background: white; border-radius: 14px; padding: 15px; text-align: left; cursor: pointer; box-shadow: 0 0 0 rgba(22,119,255,0); transition: transform .15s, box-shadow .15s; }
.machine-card:active { transform: scale(.985); box-shadow: 0 5px 18px rgba(22,119,255,.1); }
.machine-head { display: flex; justify-content: space-between; gap: 12px; }
.machine-head h3 { margin: 0; font-size: 14px; line-height: 1.45; }
.machine-head p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.machine-total { color: var(--blue); font-size: 18px; font-weight: 700; white-space: nowrap; }
.machine-total small { display: block; color: var(--muted); font-size: 8px; text-align: right; font-weight: 400; }
.machine-stats { margin-top: 13px; display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.mini-stat { padding: 9px 11px; border-radius: 9px; background: #f7f8fa; }
.mini-stat span { display: block; color: var(--muted); font-size: 9px; }
.mini-stat strong { display: block; margin-top: 3px; font-size: 12px; }
.progress { height: 5px; margin-top: 12px; background: #eaf2ff; border-radius: 9px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--blue); border-radius: inherit; }
.machine-footer { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 14px; margin-top: 12px; }
.machine-footer .progress { margin-top: 0; }
.machine-footer span { color: var(--blue); font-size: 9px; white-space: nowrap; }
.detail-open .bottom-nav { display: none; }
.detail-open .app-content { padding-bottom: 18px; }
.detail-hero { padding: 22px; border-radius: 17px; background: linear-gradient(145deg,#1677ff,#0e5ed8); color: white; }
.detail-hero > span { font-size: 10px; opacity: .75; }
.detail-hero h2 { margin: 7px 0 5px; font-size: 21px; line-height: 1.4; }
.detail-hero p { margin: 0; font-size: 11px; opacity: .78; }
.detail-total { margin-top: 22px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.22); }
.detail-total span { display: block; font-size: 10px; opacity: .72; }
.detail-total strong { display: inline-block; margin-top: 4px; font-size: 32px; }
.detail-total small { margin-left: 5px; opacity: .72; }
.detail-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 10px; }
.detail-stats div { padding: 13px 10px; border-radius: 12px; background: white; }
.detail-stats span { display: block; color: var(--muted); font-size: 9px; }
.detail-stats strong { display: inline-block; margin-top: 5px; font-size: 17px; }
.detail-stats small { margin-left: 2px; color: var(--muted); font-size: 8px; }
.unit-label { color: var(--muted); font-size: 9px; }
.simulation-note { margin-top: 12px; padding: 8px 10px; border-radius: 8px; background: #fff8e8; color: #9a7329; font-size: 9px; line-height: 1.5; }
.detail-project-list { margin-top: 12px; }
.detail-project-item { padding: 14px 0; border-top: 1px solid var(--line); }
.detail-project-head { display: grid; grid-template-columns: 1fr auto; gap: 15px; align-items: start; }
.detail-project-head span { color: var(--blue); font-size: 10px; font-weight: 600; }
.detail-project-head h4 { margin: 4px 0 0; font-size: 12px; line-height: 1.5; font-weight: 600; }
.detail-project-head strong { color: var(--blue); font-size: 18px; }
.detail-project-item p { margin: 6px 0 0; color: var(--muted); font-size: 9px; }
.session-list { margin-top: 10px; padding: 4px 10px; border-radius: 9px; background: #f7f9fc; }
.session-row { min-height: 31px; display: grid; grid-template-columns: 78px 1fr auto; align-items: center; gap: 7px; border-bottom: 1px dashed #e3e8f0; font-size: 9px; }
.session-row:last-child { border-bottom: 0; }
.session-row span { color: var(--muted); }
.session-row strong { font-size: 10px; font-weight: 600; }
.session-row em { color: var(--blue); font-style: normal; font-weight: 600; }
.project-hero { padding: 22px 20px; border-radius: 16px; background: linear-gradient(145deg,#172c4e,#224a7c); color: white; }
.project-hero span { display: block; font-size: 11px; opacity: .72; }
.project-hero strong { display: inline-block; margin-top: 8px; font-size: 34px; }
.project-hero small { margin-left: 5px; opacity: .7; }
.project-list { display: grid; gap: 10px; margin-top: 12px; }
.project-card { background: white; border-radius: 14px; padding: 15px; }
.project-card .code { color: var(--blue); font-size: 11px; font-weight: 600; }
.project-card h3 { margin: 6px 0 12px; font-size: 13px; line-height: 1.55; font-weight: 600; }
.project-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; }
.project-meta strong { color: var(--ink); font-size: 15px; }
.upload-card { padding: 30px 22px; background: white; border-radius: 17px; text-align: center; }
.excel-icon { width: 58px; height: 58px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 17px; background: #e9f8f1; color: #128a5a; font-size: 24px; font-weight: 800; }
.upload-card h2 { margin: 0; font-size: 19px; }
.upload-card p { margin: 10px auto 18px; max-width: 290px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.primary-button { height: 44px; display: grid; place-items: center; border-radius: 11px; background: var(--blue); color: white; font-size: 13px; cursor: pointer; }
.primary-button input { display: none; }
.upload-card small { display: block; margin-top: 10px; color: #adb3bd; font-size: 9px; }
.data-info { padding: 5px 17px; }
.info-row { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); font-size: 12px; }
.info-row:last-child { border-bottom: 0; }
.info-row span { color: var(--muted); }
.info-row strong { max-width: 220px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.info-row .success { color: var(--green); }
.tip { margin-top: 12px; padding: 14px 15px; border-radius: 12px; background: #fff8e9; color: #8d6b2b; font-size: 10px; line-height: 1.6; }
.tip p { margin: 3px 0 0; }
.bottom-nav { position: fixed; z-index: 30; bottom: 0; left: 50%; transform: translateX(-50%); width: min(100%, 430px); min-height: 60px; padding: 7px 18px calc(7px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); background: rgba(255,255,255,.97); border-top: 1px solid var(--line); backdrop-filter: blur(14px); }
.bottom-nav.admin-nav { grid-template-columns: repeat(6,minmax(0,1fr)); }
.bottom-nav.employee-nav { grid-template-columns: repeat(3,minmax(0,1fr)); }
.bottom-nav button { width: 100%; min-width: 0; border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 3px; color: #9aa1ad; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.bottom-nav button span { font-size: 20px; line-height: 1; }
.bottom-nav button b { font-size: 10px; font-weight: 500; }
.bottom-nav button.active { color: var(--blue); }
.load-more { width: 100%; height: 42px; margin: 12px 0 4px; border: 0; border-radius: 10px; background: white; color: var(--blue); cursor: pointer; touch-action: manipulation; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: 86px; transform: translate(-50%,15px); width: max-content; max-width: 330px; padding: 10px 15px; border-radius: 9px; background: rgba(25,29,36,.92); color: white; font-size: 12px; opacity: 0; pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translate(-50%,0); }
.empty { padding: 45px 10px; text-align: center; color: var(--muted); font-size: 12px; }
.hidden { display: none !important; }
#login-screen { gap: 14px; }
#login-screen .login-card { margin-bottom: 0; }
.machine-card,.project-card { cursor: pointer; }
#admin-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  overflow: hidden;
  margin-bottom: 14px;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg,#1677ff,#0b5ed7);
  box-shadow: 0 10px 28px rgba(22,119,255,.24);
  color: #fff;
}
#admin-summary > div {
  min-width: 0;
  padding: 22px 12px;
  text-align: center;
  background: transparent;
}
#admin-summary > div + div {
  border-left: 1px solid rgba(255,255,255,.28);
}
#admin-summary span,
#admin-summary small {
  color: rgba(255,255,255,.82);
}
#admin-summary strong {
  display: block;
  margin: 7px 0 2px;
  color: #fff;
  font-size: 28px;
}
.employee-project-row {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.period-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  color: #64748b;
  font-size: 13px;
}
.period-toolbar select {
  min-width: 132px;
  border: 0;
  outline: 0;
  background: #eef6ff;
  color: #1168db;
  font-weight: 700;
}
.login-screen { width: min(100%,430px); min-height: 100vh; margin: 0 auto; padding: 54px 22px; background: linear-gradient(180deg,#eef6ff,#f7f8fa 42%); }
.login-brand { display: flex; align-items: center; gap: 12px; margin: 0 4px 28px; }
.login-brand > span { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; background: var(--blue); color: white; font-size: 22px; font-weight: 700; box-shadow: 0 8px 22px rgba(22,119,255,.28); }
.login-brand strong,.login-brand small { display: block; }
.login-brand strong { font-size: 19px; }
.login-brand small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.login-card,.form-card { padding: 24px 20px; border-radius: 18px; background: white; box-shadow: 0 12px 38px rgba(43,67,101,.09); }
.login-card h1,.form-card h2,.records-head h2 { margin: 0; font-size: 21px; }
.login-card > p,.form-card > p { margin: 8px 0 22px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.login-card label,.entry-form label { display: grid; gap: 7px; margin-top: 14px; color: #596170; font-size: 11px; }
.login-card input,.entry-form input,.entry-form select,.entry-form textarea { width: 100%; border: 1px solid #e2e7ed; border-radius: 10px; padding: 11px 12px; outline: 0; background: white; color: var(--ink); }
.login-card input:focus,.entry-form input:focus,.entry-form select:focus,.entry-form textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(22,119,255,.08); }
.login-card .primary-button,.entry-form .primary-button { width: 100%; border: 0; margin-top: 22px; }
.demo-accounts { display: grid; gap: 4px; margin-top: 18px; padding: 12px; border-radius: 10px; background: #f7f9fc; color: var(--muted); font-size: 9px; line-height: 1.5; }
.demo-accounts strong { color: #596170; }
.user-button { width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--blue-soft); color: var(--blue); font-weight: 700; cursor: pointer; }
.logout-button { border: 0; border-radius: 8px; padding: 7px 10px; background: #f0f2f5; color: #6e7683; font-size: 10px; cursor: pointer; }
.entry-form { margin-top: 12px; }
.time-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.records-head { display: flex; align-items: flex-end; justify-content: space-between; padding: 4px 2px 12px; }
.record-list { display: grid; gap: 9px; }
.record-card { padding: 14px 15px; border-radius: 13px; background: white; }
.record-top,.record-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.record-top { color: var(--muted); font-size: 9px; }
.record-status { padding: 3px 7px; border-radius: 8px; background: #e9f8f1; color: var(--green); font-weight: 500; }
.record-card h3 { margin: 9px 0 5px; font-size: 13px; }
.record-card p { margin: 0; color: #596170; font-size: 10px; }
.record-foot { margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.record-foot button { border: 0; background: transparent; color: #e35a5a; font-size: 10px; cursor: pointer; }
.muted-record { opacity: .58; }
.muted-record .record-status { background: #f1f2f4; color: #737b87; }
.empty.small { padding: 16px 5px; font-size: 9px; }
.bottom-nav { padding-left: 8px; padding-right: 8px; }
@media (min-width: 700px) { body { padding: 24px 0; } .app-shell { min-height: calc(100vh - 48px); border-radius: 24px; overflow: hidden; } .bottom-nav { bottom: 24px; border-radius: 0 0 24px 24px; } }
