:root {
  --ink: #142a22;
  --muted: #7b8982;
  --green: #0a9f58;
  --deep: #0e4b38;
  --line: #e3e9e5;
  --paper: #f4f7f5;
  font-family: Inter, "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.eyebrow { margin: 0 0 9px; color: #7ca68f; font-size: 10px; letter-spacing: 2px; font-weight: 700; }
.muted, small { color: var(--muted); }
.brand-mark { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; background: #dff2bd; color: var(--deep); font-size: 18px; font-weight: 800; }
.brand-mark.small { width: 42px; height: 42px; border-radius: 13px; }
.login-view { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; }
.login-brand { padding: 10vw 8vw; background: radial-gradient(circle at 80% 80%, #1f7255, transparent 42%), linear-gradient(145deg, #0d3c2f, #102b23); color: white; display: flex; flex-direction: column; justify-content: center; }
.login-brand h1 { margin: 30px 0 18px; font-size: clamp(40px, 5vw, 76px); line-height: 1.08; letter-spacing: -3px; }
.login-brand > p:last-child { max-width: 460px; color: #a9c4b7; line-height: 1.8; }
.login-card { width: min(460px, 82%); align-self: center; justify-self: center; padding: 48px; background: white; border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 30px 80px #143b2b16; }
.login-card h2 { margin: 16px 0 8px; font-size: 31px; }
label { display: block; margin-top: 22px; color: #65736c; font-size: 12px; }
input, select, textarea { width: 100%; margin-top: 8px; padding: 13px 14px; border: 1px solid #dbe4df; border-radius: 9px; background: #f8faf9; color: var(--ink); outline: none; }
textarea { resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus { border-color: #63aa83; box-shadow: 0 0 0 3px #e1f3e8; }
input:disabled, textarea:disabled { color: #8a9690; background: #f1f4f2; }
button { border: 0; border-radius: 9px; padding: 10px 15px; }
.primary { background: var(--green); color: white; font-weight: 700; }
.secondary { background: #edf2ef; color: #53635b; }
.danger-light { background: #fff0eb; color: #a6543f; }
.wide { width: 100%; margin-top: 24px; padding: 14px; }
.login-card small { display: block; margin-top: 25px; text-align: center; }
.error { min-height: 18px; margin: 10px 0 0; color: #bc5b42; font-size: 12px; }
.app-view { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 228px; padding: 25px 18px; background: white; border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 3; }
.brand { display: flex; align-items: center; gap: 13px; padding: 0 8px; }
.brand strong { display: block; font-size: 17px; letter-spacing: .5px; }
.brand small { display: block; margin-top: 4px; font-size: 9px; }
.side-label { margin: 42px 12px 12px; color: #a0aaa5; font-size: 9px; letter-spacing: 1.5px; }
nav { display: grid; gap: 6px; }
.nav { display: flex; align-items: center; gap: 12px; padding: 13px 14px; background: transparent; color: #718078; text-align: left; }
.nav b { width: 22px; font-size: 17px; }
.nav.active { background: #0e4b38; color: white; }
.sidebar-foot { margin-top: auto; padding: 18px; background: #f3f7f4; border-radius: 13px; font-size: 10px; }
.sidebar-foot span, .sidebar-foot small { display: block; }
.sidebar-foot strong { display: block; margin: 8px 0; font-size: 22px; }
.workspace { margin-left: 228px; min-height: 100vh; }
.topbar { min-height: 92px; padding: 18px 34px; background: white; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.topbar small { font-size: 9px; letter-spacing: 1px; }
.topbar h1 { margin: 5px 0 0; font-size: 23px; }
.account { display: flex; align-items: center; gap: 14px; font-size: 12px; }
.account a { color: #527363; text-decoration: none; }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #e6f2e9; color: #45745d; }
.link { padding: 0; background: transparent; color: #718078; font-size: 12px; }
.page { display: none; max-width: 1450px; margin: auto; padding: 30px 34px 48px; }
.page.active { display: block; }
.hero { padding: 34px; border-radius: 22px; background: linear-gradient(130deg, #0e4b38, #16734f); color: white; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.hero h2 { margin: 0 0 10px; font-size: 30px; }
.hero > div > p:last-child { margin: 0; color: #b8d2c5; }
.light { background: #e3f0bd; color: #164331; font-weight: 700; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin: 20px 0; }
.metrics article, .panel { padding: 23px; background: white; border: 1px solid var(--line); border-radius: 16px; }
.metrics span, .metrics small { display: block; color: var(--muted); font-size: 10px; }
.metrics strong { display: block; margin: 14px 0 6px; font-size: 34px; }
.metrics .status-word { color: var(--green); font-size: 24px; }
.grid-two { display: grid; grid-template-columns: 1.25fr .75fr; gap: 18px; }
.panel-head, .section-head, .modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.panel h3, .section-head h2 { margin: 0; }
.panel-head p, .section-head p { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.project-list { margin-top: 12px; }
.project-row { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 13px; padding: 15px 0; border-top: 1px solid #edf1ee; }
.project-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #e6f5eb; color: var(--green); font-weight: 700; }
.project-thumb { width: 42px; height: 48px; object-fit: cover; object-position: top center; border: 1px solid #dfe7e2; border-radius: 8px; background: #eef3f0; }
.project-row strong, .project-row small { display: block; }
.project-row small { margin-top: 4px; }
.pill { display: inline-flex; padding: 5px 9px; border-radius: 20px; background: #e8f6ed; color: #208152; font-size: 10px; }
.pill.off { background: #f0f1ef; color: #8d9691; }
.guide ol { margin: 18px 0 0; padding: 0; list-style: none; }
.guide li { display: flex; gap: 13px; padding: 13px 0; border-top: 1px solid #edf1ee; font-size: 12px; }
.guide li b { color: #91aa9d; }
.section-head { align-items: center; margin-bottom: 22px; }
.table-panel { padding: 0; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 14px 18px; background: #f6f8f7; color: #84918a; text-align: left; font-size: 10px; }
td { padding: 17px 18px; border-top: 1px solid #edf1ee; white-space: nowrap; }
.project-name strong, .project-name small { display: block; }
.project-name small { margin-top: 4px; }
.project-cell { display: flex; align-items: center; gap: 12px; }
.project-preview { width: 62px; height: 58px; object-fit: cover; object-position: top center; border: 1px solid #dce6e0; border-radius: 10px; background: #eef3f0; }
.table-actions { display: flex; gap: 11px; }
.empty { padding: 45px; color: #8d9892; text-align: center; }
.template-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.template-card { position: relative; padding: 25px; background: white; border: 1px solid var(--line); border-radius: 18px; }
.template-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 15px; background: #e3f3e8; color: #168150; font-size: 21px; font-weight: 800; }
.template-icon.blue { background: #e9f0fa; color: #4776ac; }
.template-icon.orange { background: #fff0e3; color: #c77631; }
.template-card h3 { margin: 18px 0 8px; }
.template-card p { min-height: 44px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.template-preview { margin-top: 18px; padding: 7px; border-radius: 13px; background: #f1f5f2; }
.template-preview img { display: block; width: 100%; height: 150px; object-fit: cover; object-position: top center; border-radius: 9px; }
.template-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; }
.template-card.unavailable { opacity: .64; }
.settings-card { max-width: 760px; }
.settings-form { padding-top: 10px; }
.settings-form .full { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; margin-top: 18px; }
.setting-row { display: flex; justify-content: space-between; gap: 20px; padding: 17px 0; border-top: 1px solid #edf1ee; font-size: 12px; }
.capability-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; padding-top: 18px; border-top: 1px solid #edf1ef; }
.capability-list span { padding: 6px 10px; border: 1px solid #dbe6df; border-radius: 999px; background: #f7faf8; color: #41574d; font-size: 11px; }
.notice { margin-top: 20px; padding: 16px; border-radius: 11px; background: #f3f8f5; color: #64746c; font-size: 11px; line-height: 1.8; }
.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: #10271f99; backdrop-filter: blur(3px); }
.modal-card { width: min(520px, 100%); padding: 29px; background: white; border-radius: 20px; box-shadow: 0 25px 80px #10271f40; }
.modal-card.wide-modal { width: min(860px, 100%); max-height: calc(100vh - 40px); overflow: auto; }
.modal-head h2 { margin: 0; }
.close { background: #eff3f0; font-size: 24px; line-height: 28px; }
.modal-card small { display: block; margin-top: 7px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.user-projects { margin-top: 22px; color: #65736c; font-size: 12px; }
.user-projects > span { display: block; }
.user-projects > div { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 9px; }
.project-option { display: flex; align-items: center; gap: 7px; margin: 0; padding: 9px 11px; border: 1px solid #dce5df; border-radius: 8px; background: #f8faf9; color: #43544b; }
.project-option input { width: auto; margin: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 11px; margin-top: 24px; }
.modal-actions.split { justify-content: space-between; flex-wrap: wrap; }
.actions-group { display: flex; flex-wrap: wrap; gap: 9px; }
.config-hint { margin: 0 0 5px; padding: 12px 14px; border-radius: 9px; background: #f1f8f4; color: #526a5e; font-size: 11px; line-height: 1.7; }
.config-summary { display: grid; gap: 7px; margin-top: 18px; padding: 15px; border: 1px solid #e2ebe5; border-radius: 10px; background: #f8faf9; color: #52655b; font-size: 11px; line-height: 1.65; }
.config-summary code { word-break: break-all; }
.toast { position: fixed; right: 25px; bottom: 25px; z-index: 30; padding: 12px 18px; border-radius: 10px; background: #173e30; color: white; font-size: 12px; box-shadow: 0 12px 40px #173e3040; }
@media (max-width: 980px) {
  .metrics, .template-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-two { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .login-view { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-card { width: calc(100% - 28px); padding: 29px 23px; }
  .sidebar { position: relative; width: auto; padding: 15px; }
  .sidebar .brand { margin-bottom: 10px; }
  .side-label, .sidebar-foot { display: none; }
  nav { display: flex; overflow-x: auto; }
  .nav { flex: 1 0 105px; padding: 10px; font-size: 11px; }
  .workspace { margin-left: 0; }
  .topbar { min-height: 70px; padding: 13px 17px; }
  .topbar h1 { font-size: 19px; }
  .account a { display: none; }
  .page { padding: 20px 15px 35px; }
  .hero { padding: 25px; align-items: flex-start; flex-direction: column; }
  .hero h2 { font-size: 24px; }
  .metrics, .template-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .settings-form .full { grid-column: auto; }
  .metrics { gap: 10px; }
  .metrics article { padding: 18px; }
}
