/* 新建项目、报价模板、历史报价：只调整页面排版，不改变原系统主题与功能。 */

#newProjectPane,
#templatesPane,
#historyPane {
  background: rgba(234, 244, 255, 0.72);
}

#newProjectPane .workspace-page-head,
#templatesPane .workspace-page-head,
#historyPane .workspace-page-head {
  min-height: 116px;
  padding: 20px 24px;
  border-bottom-color: rgba(47, 128, 255, 0.16);
  background: rgba(241, 248, 255, 0.96);
}

#newProjectPane .workspace-page-head > div:first-child,
#templatesPane .workspace-page-head > div:first-child,
#historyPane .workspace-page-head > div:first-child {
  min-width: 0;
}

.workspace-page-kicker {
  display: block;
  margin-bottom: 7px;
  color: #4470a8;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  line-height: 1.2;
}

#newProjectPane .workspace-page-head h2,
#templatesPane .workspace-page-head h2,
#historyPane .workspace-page-head h2 {
  margin: 0 0 7px;
  color: #173b70;
  font-size: 25px;
  line-height: 1.12;
}

.workspace-head-note {
  display: grid;
  gap: 4px;
  min-width: 210px;
  padding: 13px 16px;
  border: 1px solid rgba(47, 128, 255, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
}

.workspace-head-note span {
  color: var(--muted);
  font-size: 11px;
}

.workspace-head-note strong {
  color: #173b70;
  font-size: 14px;
}

#newProjectPane .project-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  width: min(1180px, calc(100% - 40px));
  margin: 22px auto 30px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.project-form-section {
  display: grid;
  align-content: start;
  gap: 18px;
  min-width: 0;
  padding: 20px;
  border: 1px solid rgba(47, 128, 255, 0.14);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 28px rgba(42, 97, 154, 0.08);
}

.project-form-section-wide {
  grid-column: 1 / -1;
}

.project-form-section-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.project-form-section-head > span {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: #e5f1ff;
  color: #256ddc;
  font-size: 12px;
  font-weight: 800;
}

.project-form-section-head h3 {
  margin: 0 0 4px;
  color: #173b70;
  font-size: 17px;
}

.project-form-section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}

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

#newProjectPane .project-form label {
  gap: 7px;
  color: #31527b;
  font-size: 12px;
}

#newProjectPane .project-form label em {
  margin-left: 5px;
  color: var(--danger);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}

#newProjectPane .project-form input,
#newProjectPane .project-form textarea {
  min-height: 42px;
  border-color: rgba(55, 103, 160, 0.17);
  border-radius: 13px;
  background: rgba(247, 251, 255, 0.96);
}

#newProjectPane .project-form textarea {
  min-height: 116px;
  resize: vertical;
}

#newProjectPane .project-form input:focus,
#newProjectPane .project-form textarea:focus {
  border-color: rgba(47, 128, 255, 0.58);
  box-shadow: 0 0 0 3px rgba(47, 128, 255, 0.11);
  outline: none;
}

.project-requirements-field {
  max-width: none;
}

.project-closing-grid {
  grid-template-columns: minmax(0, 1fr);
}

.project-relationship-field input {
  max-width: 100%;
}

#newProjectPane .project-form-actions {
  position: sticky;
  bottom: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 16px;
  border: 1px solid rgba(47, 128, 255, 0.15);
  border-radius: 18px;
  background: rgba(250, 253, 255, 0.94);
  box-shadow: 0 12px 30px rgba(29, 92, 153, 0.12);
  backdrop-filter: blur(14px);
}

#newProjectPane .project-form-actions p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

#newProjectPane .project-form-actions > div {
  display: flex;
  flex: 0 0 auto;
  gap: 9px;
}

#newProjectPane .project-form-actions button {
  min-height: 38px;
  padding-inline: 16px;
}

#templatesPane .template-actions,
#historyPane .template-actions {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  align-items: center;
  gap: 24px;
}

#templatesPane .template-save-box {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(47, 128, 255, 0.13);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 10px 24px rgba(42, 97, 154, 0.08);
}

#templatesPane .template-save-box input,
#historyPane .history-search-box input {
  min-height: 40px;
  border: 0;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: none;
}

#templatesPane .template-save-box button {
  min-height: 40px;
  white-space: nowrap;
}

#historyPane .history-search-box {
  width: 100%;
  padding: 6px;
  border: 1px solid rgba(47, 128, 255, 0.13);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 10px 24px rgba(42, 97, 154, 0.08);
}

#templatesPane .new-template-panel {
  position: relative;
  grid-template-columns: minmax(170px, 0.8fr) minmax(190px, 1fr) minmax(190px, 1fr) auto auto;
  gap: 10px;
  margin: 16px 20px 0;
  padding: 15px;
  border: 1px solid rgba(47, 128, 255, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 28px rgba(42, 97, 154, 0.08);
}

.new-template-intro {
  display: grid;
  gap: 4px;
}

.new-template-intro strong {
  color: #173b70;
}

.new-template-intro span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.workspace-overview-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) repeat(3, minmax(170px, 0.75fr));
  gap: 12px;
  padding: 18px 20px 0;
}

.workspace-overview-card {
  display: grid;
  align-content: space-between;
  min-width: 0;
  min-height: 116px;
  padding: 17px 18px;
  border: 1px solid rgba(47, 128, 255, 0.13);
  border-radius: 21px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 26px rgba(42, 97, 154, 0.07);
}

.workspace-overview-card > span {
  color: #54749b;
  font-size: 11px;
  font-weight: 700;
}

.workspace-overview-card > strong {
  color: #173b70;
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.workspace-overview-card > p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.workspace-overview-primary {
  border-color: #2f80ff;
  background: #2f80ff;
  box-shadow: 0 16px 32px rgba(47, 128, 255, 0.22);
}

.workspace-overview-primary > span,
.workspace-overview-primary > strong,
.workspace-overview-primary > p {
  color: #fff;
}

.workspace-list-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 22px 0;
}

.workspace-list-head > div {
  display: grid;
  gap: 3px;
}

.workspace-list-head span {
  color: #54749b;
  font-size: 11px;
  font-weight: 700;
}

.workspace-list-head strong {
  color: #173b70;
  font-size: 17px;
}

.workspace-list-head p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

#templatesPane .template-list,
#historyPane .template-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 14px 20px 24px;
}

#templatesPane .template-list > .loading,
#historyPane .template-list > .loading {
  grid-column: 1 / -1;
  min-height: 160px;
  border: 1px dashed rgba(47, 128, 255, 0.24);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.7);
}

#templatesPane .template-card,
#historyPane .template-card {
  position: relative;
  grid-template-columns: minmax(0, 1fr);
  align-content: space-between;
  min-height: 240px;
  padding: 20px;
  overflow: hidden;
  border-color: rgba(47, 128, 255, 0.14);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.91);
  box-shadow: 0 14px 28px rgba(42, 97, 154, 0.08);
}

.template-card-main {
  min-width: 0;
}

.template-card-edit-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 14px;
}

.template-card-edit-form label {
  display: grid;
  gap: 5px;
  color: #54749b;
  font-size: 10px;
  font-weight: 700;
}

.template-card-edit-form input {
  min-width: 0;
  min-height: 36px;
}

.template-card-heading > span,
.history-card-heading span {
  display: block;
  margin-bottom: 7px;
  color: #4f79aa;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

#templatesPane .template-card h3,
#historyPane .template-card h3 {
  margin: 0;
  color: #173b70;
  font-size: 19px;
  line-height: 1.25;
}

.template-card-description {
  min-height: 40px;
  margin: 10px 0 14px !important;
}

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

.template-meta-grid > span {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(47, 128, 255, 0.12);
  border-radius: 13px;
  background: #f2f8ff;
}

.template-meta-grid small {
  color: var(--muted);
  font-size: 10px;
}

.template-meta-grid strong {
  color: #173b70;
  font-size: 13px;
}

.history-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.history-card-heading > div {
  min-width: 0;
}

.history-card-heading > p {
  flex: 0 0 auto;
  margin: 0 !important;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

#templatesPane .history-stat-grid,
#historyPane .history-stat-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

#historyPane .history-stat-grid span {
  min-height: 54px;
  padding: 9px 11px;
  background: #f2f8ff;
}

#templatesPane .template-card .card-actions,
#historyPane .template-card .card-actions {
  justify-content: flex-start;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(47, 128, 255, 0.11);
}

#templatesPane .template-card .card-actions button,
#historyPane .template-card .card-actions button {
  min-height: 36px;
  padding-inline: 14px;
}

@media (max-width: 1180px) {
  .workspace-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #templatesPane .new-template-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .new-template-intro {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  #newProjectPane .workspace-page-head,
  #templatesPane .workspace-page-head,
  #historyPane .workspace-page-head {
    position: static;
    min-height: 0;
    align-items: stretch;
    padding: 18px;
  }

  .workspace-head-note {
    min-width: 0;
  }

  #newProjectPane .project-form {
    grid-template-columns: minmax(0, 1fr);
    width: min(100% - 24px, 680px);
    margin: 14px auto 22px;
  }

  .project-form-section,
  .project-form-section-wide {
    grid-column: 1;
  }

  #templatesPane .template-actions,
  #historyPane .template-actions {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  #templatesPane .template-list,
  #historyPane .template-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  #newProjectPane .workspace-page-head h2,
  #templatesPane .workspace-page-head h2,
  #historyPane .workspace-page-head h2 {
    font-size: 22px;
  }

  .workspace-head-note {
    display: none;
  }

  .project-form-section {
    gap: 16px;
    padding: 17px 14px;
    border-radius: 18px;
  }

  .project-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  #newProjectPane .project-form-actions {
    position: static;
    align-items: stretch;
    flex-direction: column;
  }

  #newProjectPane .project-form-actions > div,
  #newProjectPane .project-form-actions button {
    width: 100%;
  }

  #templatesPane .template-save-box {
    grid-template-columns: minmax(0, 1fr);
  }

  #templatesPane .new-template-panel {
    grid-template-columns: minmax(0, 1fr);
    margin: 12px 12px 0;
  }

  .new-template-intro {
    grid-column: 1;
  }

  .workspace-overview-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 12px 12px 0;
  }

  .workspace-overview-card {
    min-height: 104px;
    padding: 15px;
    border-radius: 18px;
  }

  .workspace-list-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
    padding: 16px 14px 0;
  }

  #templatesPane .template-list,
  #historyPane .template-list {
    padding: 12px;
  }

  #templatesPane .template-card,
  #historyPane .template-card {
    min-height: 0;
    padding: 16px;
    border-radius: 18px;
  }

  .template-meta-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .template-card-edit-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .history-card-heading {
    display: grid;
    gap: 8px;
  }

  .history-card-heading > p {
    text-align: left;
  }

  #templatesPane .template-card .card-actions,
  #historyPane .template-card .card-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  #templatesPane .template-card .card-actions button,
  #historyPane .template-card .card-actions button {
    width: 100%;
  }
}

@media print {
  #newProjectPane,
  #historyPane {
    display: none !important;
  }
}
