:root {
  --ink: #121210;
  --paper: #f2f0e9;
  --panel: #e8e6de;
  --accent: #f04426;
  --line: rgba(18,18,16,.16);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--paper); color: var(--ink); font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif; }
button, input { font: inherit; }
button, a, label { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
.manager-header {
  position: sticky;
  z-index: 20;
  top: 0;
  height: 74px;
  display: grid;
  grid-template-columns: 220px 1fr auto;
  align-items: center;
  gap: 28px;
  padding: 0 26px;
  background: rgba(242,240,233,.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.manager-brand { font-size: 25px; font-weight: 800; letter-spacing: -.08em; }
.manager-brand sup { margin-left: 4px; font-size: 8px; vertical-align: top; }
.manager-title { display: flex; gap: 15px; align-items: baseline; }
.manager-header strong { font-size: 14px; }
.manager-header span { font-size: 10px; opacity: .5; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.header-actions button, .preview-link, .editor-actions a {
  padding: 10px 15px;
  border: 1px solid var(--ink);
  border-radius: 100px;
  background: transparent;
  cursor: pointer;
  font-size: 10px;
}
.header-actions .publish-button { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.header-actions .publish-button:disabled { cursor: wait; opacity: .55; }
.admin-gate {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(18,18,16,.92);
  backdrop-filter: blur(18px);
}
.admin-gate[hidden] { display: none; }
.admin-login-card {
  width: min(560px, 100%);
  padding: clamp(28px, 5vw, 62px);
  background: var(--paper);
  border: 1px solid rgba(255,255,255,.24);
}
.admin-login-card > span { color: var(--accent); font-size: 9px; letter-spacing: .14em; }
.admin-login-card h1 { margin: 24px 0; font-size: clamp(38px, 5vw, 68px); font-weight: 400; line-height: .94; letter-spacing: -.06em; }
.admin-login-card p { margin: 0 0 30px; max-width: 390px; color: #656560; font-size: 12px; line-height: 1.65; }
.admin-login-card label { display: grid; gap: 9px; font-size: 10px; }
.admin-login-card input { width: 100%; padding: 14px; border: 1px solid var(--ink); background: #fff; font-size: 16px; }
.admin-login-card button { width: 100%; margin-top: 12px; padding: 14px; border: 0; background: var(--accent); color: #fff; cursor: pointer; }
.admin-login-card small { display: block; min-height: 18px; margin-top: 12px; color: #b21d0b; font-size: 10px; }
.manager-layout { min-height: calc(100vh - 74px); display: grid; grid-template-columns: 300px 1fr; }
.project-panel {
  position: sticky;
  top: 74px;
  height: calc(100vh - 74px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--panel);
}
.search-box { display: grid; gap: 7px; padding: 20px; border-bottom: 1px solid var(--line); }
.search-box span, .section-kicker { font-size: 9px; letter-spacing: .1em; text-transform: uppercase; opacity: .55; }
.search-box input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--ink);
  padding: 8px 0;
  outline: 0;
  background: transparent;
  font-size: 14px;
}
.company-tabs { display: grid; grid-template-columns: repeat(2, 1fr); border-bottom: 1px solid var(--line); }
.company-tabs button {
  border: 0;
  border-right: 1px solid var(--line);
  padding: 13px 3px;
  background: transparent;
  cursor: pointer;
  font-size: 10px;
}
.company-tabs button:last-child { border-right: 0; }
.company-tabs button.active { background: var(--ink); color: white; }
.new-project-button {
  width: calc(100% - 28px);
  margin: 14px;
  padding: 12px;
  border: 0;
  border-radius: 100px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-size: 10px;
}
.project-list { overflow: auto; flex: 1; }
.project-list button {
  width: 100%;
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 8px;
  padding: 14px 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  background: transparent;
  cursor: pointer;
}
.project-list button:hover, .project-list button.active { background: var(--paper); }
.project-list small { color: var(--accent); font-size: 8px; letter-spacing: .06em; }
.project-list strong { font-size: 12px; font-weight: 500; line-height: 1.3; }
.deleted-projects { border-top: 1px solid var(--line); }
.deleted-projects summary { padding: 14px 18px; cursor: pointer; font-size: 10px; }
.deleted-projects summary span { float: right; }
.deleted-projects button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 18px;
  border: 0;
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,.25);
  cursor: pointer;
  text-align: left;
  font-size: 9px;
}
.deleted-projects button span { color: var(--accent); }
.editor-panel { min-width: 0; }
.empty-state { min-height: calc(100vh - 74px); display: grid; place-content: center; padding: 7vw; }
.empty-state span { font-size: 9px; letter-spacing: .12em; color: var(--accent); }
.empty-state h1 { margin: 18px 0 0; font-size: clamp(45px, 6vw, 95px); font-weight: 400; line-height: .94; letter-spacing: -.07em; }
.editor-content { padding: 46px clamp(24px, 4vw, 65px) 100px; }
.editor-title { display: flex; justify-content: space-between; align-items: end; gap: 30px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.editor-title span { color: var(--accent); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.editor-title h1 { margin: 10px 0 0; max-width: 12ch; font-size: clamp(42px, 5vw, 78px); font-weight: 400; line-height: .95; letter-spacing: -.06em; }
.editor-actions { display: flex; align-items: center; gap: 8px; }
.reset-button { padding: 10px 15px; border: 0; background: transparent; cursor: pointer; font-size: 10px; opacity: .55; }
.delete-project-button { padding: 10px 15px; border: 0; background: transparent; color: #b21d0b; cursor: pointer; font-size: 10px; }
.project-settings {
  display: grid;
  grid-template-columns: minmax(200px, .6fr) minmax(0, 1.4fr);
  gap: 45px;
  padding: 36px 0;
  border-bottom: 1px solid var(--line);
}
.project-settings p { margin: 12px 0 0; max-width: 270px; color: #686864; font-size: 11px; line-height: 1.55; }
.project-form { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.project-form label { display: grid; gap: 7px; color: #686864; font-size: 9px; }
.project-form input, .project-form select, .project-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 11px 12px;
  outline: 0;
  background: white;
  color: var(--ink);
  resize: vertical;
  font-size: 12px;
}
.project-form input:focus, .project-form select:focus, .project-form textarea:focus { border-color: var(--accent); }
.project-form .form-wide { grid-column: 1 / -1; }
.cover-editor {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, .7fr);
  gap: 45px;
  padding: 42px 0 62px;
  border-bottom: 1px solid var(--line);
}
.cover-preview { position: relative; overflow: hidden; aspect-ratio: 4 / 3; background: #1a1a18; }
.cover-preview img { width: 100%; height: 100%; display: block; object-fit: cover; transform: scale(var(--preview-scale, 1)); }
.cover-preview > span { position: absolute; left: 13px; top: 13px; padding: 7px 9px; background: var(--accent); color: #fff; font-size: 9px; }
.cover-controls { padding-top: 5px; }
.cover-controls p, .image-editor-head p { margin: 12px 0 28px; max-width: 430px; color: #686864; font-size: 12px; line-height: 1.55; }
.cover-controls label { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 22px 0; font-size: 11px; }
.cover-controls input { grid-column: 1 / -1; accent-color: var(--accent); }
.cover-controls output { color: var(--accent); }
.image-editor { padding-top: 55px; }
.image-editor-head { display: flex; justify-content: space-between; align-items: start; gap: 25px; }
.upload-button {
  flex: 0 0 auto;
  padding: 12px 18px;
  background: var(--accent);
  color: white;
  border-radius: 100px;
  cursor: pointer;
  font-size: 10px;
}
.upload-button input { display: none; }
.image-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.image-card { position: relative; min-width: 0; border: 1px solid var(--line); background: #fff; cursor: grab; }
.image-card.dragging { opacity: .35; }
.image-card.drop-target { outline: 2px solid var(--accent); outline-offset: 2px; }
.image-card.hidden-image .image-thumb { opacity: .2; filter: grayscale(1); }
.image-card.cover-image { border-color: var(--accent); }
.image-thumb { position: relative; overflow: hidden; aspect-ratio: 4 / 3; background: #ddd; }
.image-thumb img { width: 100%; height: 100%; display: block; object-fit: contain; transform: scale(var(--image-scale, 1)); }
.image-badges { position: absolute; left: 8px; top: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.image-badges span { padding: 5px 6px; background: rgba(18,18,16,.82); color: white; font-size: 8px; }
.image-badges .cover-badge { background: var(--accent); }
.image-info { padding: 10px; }
.image-info strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 500; }
.image-info small { display: block; margin-top: 5px; color: #777; font-size: 8px; }
.image-actions { display: flex; border-top: 1px solid var(--line); }
.image-actions button { flex: 1; }
.image-actions button { border: 0; border-right: 1px solid var(--line); padding: 9px 7px; background: transparent; cursor: pointer; font-size: 9px; }
.image-actions button:last-child { border-right: 0; }
.image-actions button:hover { background: var(--panel); }
.image-actions .delete-image { color: #b21d0b; }
.image-actions .crop-image { color: var(--accent); font-weight: 600; }
.image-scale {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
  padding: 9px 10px;
  border-top: 1px solid var(--line);
  color: #686864;
  font-size: 8px;
}
.image-scale input { grid-column: 1 / -1; width: 100%; accent-color: var(--accent); }
.typography-panel {
  position: fixed;
  z-index: 60;
  right: 0;
  top: 0;
  width: min(410px, 100%);
  height: 100vh;
  padding: 90px 35px 35px;
  background: var(--paper);
  border-left: 1px solid var(--line);
  box-shadow: -30px 0 80px rgba(0,0,0,.12);
  transform: translateX(105%);
  transition: transform .35s cubic-bezier(.2,.7,.2,1);
}
.typography-panel.open { transform: none; }
.about-panel {
  position: fixed;
  z-index: 80;
  right: 0;
  top: 0;
  width: min(620px, 100%);
  height: 100vh;
  overflow-y: auto;
  padding: 72px clamp(24px, 4vw, 52px) 42px;
  background: #f5f4ef;
  border-left: 1px solid var(--line);
  box-shadow: -24px 0 80px rgba(0,0,0,.14);
  transform: translateX(105%);
  transition: transform .45s cubic-bezier(.76,0,.24,1);
}
.about-panel.open { transform: none; }
.about-panel h2 { margin: 14px 0 10px; font-size: 42px; font-weight: 400; letter-spacing: -.055em; }
.about-panel > p { margin: 0 0 26px; color: #686864; font-size: 11px; line-height: 1.65; }
.about-type-size { display: grid; gap: 16px; margin-bottom: 28px; padding: 20px; border: 1px solid var(--line); }
.about-type-size > label { display: grid; grid-template-columns: 1fr auto; gap: 8px; font-size: 10px; }
.about-type-size input { grid-column: 1 / -1; width: 100%; accent-color: var(--accent); }
.about-type-size output { color: var(--accent); }
.about-type-size button { justify-self: start; padding: 9px 12px; border: 1px solid var(--line); background: transparent; cursor: pointer; font-size: 9px; }
.about-image-editor {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 20px;
  align-items: end;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}
.about-image-editor figure {
  position: relative;
  margin: 0;
  aspect-ratio: 1;
  overflow: hidden;
  background: #ddd;
}
.about-image-editor img { width: 100%; height: 100%; display: block; object-fit: cover; filter: grayscale(1); }
.about-image-editor .partner-preview-default img { position: absolute; width: 464%; height: auto; max-width: none; left: -15%; top: -79%; object-fit: initial; }
.about-image-editor > div { display: grid; gap: 9px; }
.about-image-editor .upload-button { display: block; text-align: center; }
.about-image-reset {
  padding: 10px 13px;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  font-size: 10px;
}
.about-form { display: grid; gap: 16px; margin-top: 28px; }
.about-form label {
  display: grid;
  gap: 7px;
  color: #575753;
  font-size: 10px;
}
.about-form input,
.about-form textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: white;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  line-height: 1.55;
  resize: vertical;
}
.about-detail-editor {
  display: grid;
  grid-template-columns: .72fr 1.6fr;
  gap: 12px;
  padding: 16px 0 0;
  border-top: 1px solid var(--line);
}
.about-person-divider { margin-top: 24px; padding-top: 30px; border-top: 2px solid var(--ink); }
.about-person-divider h3 { margin: 9px 0 22px; font-size: 28px; font-weight: 400; letter-spacing: -.04em; }
.about-form > .about-image-editor { margin-bottom: 8px; }
.about-panel-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.about-panel-actions a { color: var(--accent); font-size: 10px; text-decoration: none; }
.about-panel-actions button {
  padding: 10px 14px;
  border: 1px solid var(--ink);
  background: transparent;
  cursor: pointer;
  font-size: 10px;
}
.crop-panel {
  position: fixed;
  z-index: 70;
  right: 0;
  top: 0;
  width: min(540px, 100%);
  height: 100vh;
  overflow-y: auto;
  padding: 72px clamp(24px, 4vw, 50px) 40px;
  background: #f5f4ef;
  border-left: 1px solid var(--line);
  box-shadow: -20px 0 70px rgba(0,0,0,.12);
  transform: translateX(105%);
  transition: transform .45s cubic-bezier(.76,0,.24,1);
}
.crop-panel.open { transform: none; }
.crop-panel h2 { margin: 14px 0 10px; font-size: 34px; font-weight: 400; letter-spacing: -.05em; }
.crop-panel > p { margin: 0 0 24px; color: #686864; font-size: 11px; line-height: 1.6; }
.crop-preview-frame {
  position: relative;
  width: 100%;
  max-height: 52vh;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background:
    linear-gradient(45deg, #ddd 25%, transparent 25%),
    linear-gradient(-45deg, #ddd 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ddd 75%),
    linear-gradient(-45deg, transparent 75%, #ddd 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}
.crop-preview-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: var(--crop-x, 50%) var(--crop-y, 50%);
  transform: scale(var(--crop-scale, 1));
  transform-origin: center;
}
.crop-controls { margin-top: 24px; }
.crop-controls label {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin: 18px 0;
  font-size: 11px;
}
.crop-controls select,
.crop-controls input { grid-column: 1 / -1; width: 100%; }
.crop-controls select { padding: 10px; border: 1px solid var(--line); background: white; }
.crop-controls input { accent-color: var(--accent); }
.crop-controls output { color: var(--accent); }
.crop-reset {
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  font-size: 10px;
}
.panel-close { position: absolute; right: 22px; top: 20px; border: 0; background: transparent; cursor: pointer; font-size: 28px; }
.typography-panel h2 { margin: 16px 0 14px; font-size: 40px; font-weight: 400; letter-spacing: -.05em; }
.typography-panel p { margin: 0 0 45px; color: #686864; font-size: 12px; line-height: 1.6; }
.typography-panel label { display: grid; grid-template-columns: 1fr auto; gap: 12px; font-size: 11px; }
.typography-panel input { grid-column: 1 / -1; width: 100%; accent-color: var(--accent); }
.typography-panel output { color: var(--accent); }
.typography-reset { margin-top: 32px; padding: 11px 16px; border: 1px solid var(--ink); border-radius: 100px; background: transparent; cursor: pointer; font-size: 10px; }
.save-toast {
  position: fixed;
  z-index: 50;
  right: 22px;
  bottom: 22px;
  padding: 12px 17px;
  background: var(--ink);
  color: white;
  font-size: 10px;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .25s, transform .25s;
}
.save-toast.show { opacity: 1; transform: none; }
@media (max-width: 900px) {
  .manager-header { grid-template-columns: auto 1fr; height: 66px; padding: 0 18px; }
  .manager-title span { display: none; }
  .preview-link { display: none; }
  .manager-layout { grid-template-columns: 1fr; }
  .project-panel { position: static; height: auto; max-height: 48vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .project-list { min-height: 200px; }
  .editor-content { padding: 34px 18px 75px; }
  .editor-title, .image-editor-head { align-items: start; flex-direction: column; }
  .project-settings { grid-template-columns: 1fr; }
  .cover-editor { grid-template-columns: 1fr; }
  .image-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}
@media (max-width: 520px) {
  .manager-title strong { font-size: 12px; }
  .editor-title h1 { font-size: 13vw; }
  .editor-actions { width: 100%; justify-content: space-between; }
  .project-form { grid-template-columns: 1fr; }
  .project-form .form-wide { grid-column: auto; }
  .cover-editor { gap: 25px; padding-top: 30px; }
  .image-grid { grid-template-columns: 1fr; }
  .about-image-editor { grid-template-columns: 130px 1fr; }
  .about-detail-editor { grid-template-columns: 1fr; }
}
