:root {
  color-scheme: light;
  --blue: #2465f5;
  --blue-2: #4d8aff;
  --ink: #182238;
  --muted: #7b8496;
  --paper: #f4f7ff;
  --card: #ffffff;
  --line: #e5e9f2;
  --green: #15a877;
  --orange: #ed8c27;
  --red: #df4a55;
  --shadow: 0 16px 42px rgba(32, 56, 104, .10);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--paper); color: var(--ink); }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
body { min-height: 100svh; }

.app-shell {
  width: min(100%, 540px);
  min-height: 100svh;
  margin: 0 auto;
  padding: calc(18px + env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom));
  overflow-x: hidden;
}

.screen { animation: screenIn .34s cubic-bezier(.2,.75,.2,1); }
@keyframes screenIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.brand-row { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 8px 0 18px; }
.logo {
  width: 58px; height: 58px; border-radius: 17px; display: grid; place-items: center;
  color: white; background: linear-gradient(145deg, var(--blue-2), var(--blue));
  box-shadow: 0 12px 26px rgba(36, 101, 245, .24);
}
.logo svg { width: 30px; height: 30px; fill: currentColor; }
.brand-name { font-size: 34px; font-weight: 800; line-height: 1; letter-spacing: -.5px; }
.brand-tag { margin-top: 4px; color: var(--blue); font-size: 15px; font-weight: 700; }

.hero { text-align: center; margin-bottom: 22px; }
.hero h1 { margin: 0; font-size: clamp(26px, 7vw, 34px); line-height: 1.22; letter-spacing: -.6px; }
.hero p { margin: 10px 0 0; color: var(--muted); font-size: 15px; line-height: 1.5; }

.section-label { margin: 0 0 12px; font-size: 18px; font-weight: 750; }
.action-stack { display: grid; gap: 12px; }
.material-button {
  width: 100%; min-height: 82px; border: 0; border-radius: 22px; padding: 15px 16px;
  display: grid; grid-template-columns: 52px 1fr 24px; align-items: center; gap: 14px;
  text-align: left; cursor: pointer; transition: transform .15s ease, box-shadow .2s ease;
}
.material-button:active { transform: scale(.985); }
.material-button.primary { color: white; background: linear-gradient(145deg, var(--blue-2), var(--blue)); box-shadow: 0 14px 30px rgba(36,101,245,.22); }
.material-button.secondary { color: var(--ink); background: var(--card); border: 1px solid var(--line); }
.action-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 25px; }
.primary .action-icon { background: rgba(255,255,255,.17); }
.secondary .action-icon { background: #edf3ff; color: var(--blue); }
.action-copy strong { display: block; font-size: 19px; line-height: 1.25; }
.action-copy small { display: block; margin-top: 5px; color: currentColor; opacity: .72; font-size: 13px; }
.chevron { font-size: 30px; font-weight: 300; opacity: .82; }

.demo-button {
  width: 100%; margin-top: 12px; border: 0; background: transparent; color: var(--blue);
  padding: 10px; font-weight: 700; cursor: pointer;
}

.capability-card { margin-top: 18px; padding: 17px; border: 1px solid var(--line); border-radius: 22px; background: var(--card); }
.capability-title { margin: 0 0 12px; font-size: 15px; font-weight: 750; }
.capability-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.capability { min-height: 55px; padding: 10px; border-radius: 14px; display: flex; align-items: center; gap: 9px; background: var(--paper); font-weight: 650; font-size: 14px; }
.capability span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; color: var(--blue); background: #e7efff; }
.privacy { margin: 18px 0 0; text-align: center; color: #8b93a2; font-size: 12px; }

.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 44px; margin-bottom: 10px; }
.topbar h1 { font-size: 22px; margin: 0; }
.icon-button { border: 0; background: transparent; color: var(--blue); padding: 9px 5px; font-weight: 700; cursor: pointer; }

.analysis-wrap { min-height: calc(100svh - 70px); display: grid; align-content: center; text-align: center; padding-bottom: 18vh; }
.analysis-orb { width: 92px; height: 92px; margin: 0 auto 28px; position: relative; display: grid; place-items: center; border-radius: 30px; color: white; background: linear-gradient(145deg,var(--blue-2),var(--blue)); box-shadow: var(--shadow); font-size: 38px; }
.analysis-orb::after { content: ""; position: absolute; inset: -9px; border: 2px solid rgba(36,101,245,.2); border-top-color: var(--blue); border-radius: 36px; animation: spin 1.05s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.analysis-wrap h1 { margin: 0; font-size: 25px; }
.analysis-sub { margin: 9px 0 30px; color: var(--muted); }
.analysis-steps { width: min(100%, 340px); margin: 0 auto; display: grid; gap: 11px; text-align: left; }
.analysis-step { padding: 13px 15px; border-radius: 14px; color: var(--muted); background: white; border: 1px solid var(--line); transition: .3s ease; }
.analysis-step.active { color: var(--ink); border-color: #bdd0ff; box-shadow: 0 8px 22px rgba(36,101,245,.1); }
.analysis-step.done { color: var(--green); }

.summary-card { border-radius: 20px; padding: 16px; color: white; background: linear-gradient(145deg,#376fe8,#2457d9); box-shadow: 0 12px 28px rgba(36,87,217,.18); }
.summary-card strong { display: block; font-size: 19px; }
.summary-card p { margin: 6px 0 0; font-size: 13px; opacity: .84; }
.summary-pills { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.summary-pill { padding: 6px 9px; border-radius: 999px; background: rgba(255,255,255,.15); font-size: 12px; font-weight: 650; }

.toolbar-card { margin: 14px 0; padding: 13px; background: white; border: 1px solid var(--line); border-radius: 18px; }
.toolbar-row { display: flex; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.toolbar-row + .toolbar-row { margin-top: 10px; }
.toolbar-label { min-width: 40px; color: var(--muted); font-size: 12px; font-weight: 700; }
.seg-button { flex: 0 0 auto; border: 0; border-radius: 10px; padding: 8px 11px; color: #596277; background: var(--paper); font-size: 12px; font-weight: 700; cursor: pointer; }
.seg-button.selected { color: white; background: var(--blue); }
.effect-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 13px 0 9px; }
.effect-heading strong { font-size: 13px; }
.effect-heading span { color: var(--muted); font-size: 11px; }
.effect-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.effect-grid .seg-button { width: 100%; padding: 10px 7px; }
.effect-awareness { margin: -2px 0 14px; padding: 11px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-radius: 14px; color: #375079; background: #eef3ff; font-size: 13px; }
.effect-awareness button { border: 0; background: transparent; color: var(--blue); padding: 6px; font-size: 12px; font-weight: 750; cursor: pointer; }

.restore-banner { margin: -2px 0 14px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid #bfd0ff; border-radius: 14px; color: #244d9f; background: #eaf0ff; font-size: 13px; font-weight: 650; }
.restore-banner button { flex: 0 0 auto; border: 0; border-radius: 10px; padding: 8px 11px; color: white; background: var(--blue); font-size: 12px; font-weight: 750; cursor: pointer; }

.page-list { display: grid; gap: 14px; padding-bottom: 92px; }
.page-card { background: white; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; box-shadow: 0 8px 24px rgba(40,55,90,.06); }
.page-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 14px; border-bottom: 1px solid var(--line); }
.page-number { font-weight: 750; }
.status { padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 750; }
.status.ready { color: #087a58; background: #dcf7ed; }
.status.adjusted { color: #1c59d6; background: #e5edff; }
.status.review { color: #a55605; background: #fff0d6; }
.paper-preview { aspect-ratio: 210 / 297; margin: 14px auto; width: min(76%, 300px); padding: 14px; display: grid; gap: 9px; background: #fff; border: 1px solid #d9dee8; box-shadow: 0 8px 24px rgba(25,33,52,.10); }
.paper-preview.landscape { aspect-ratio: 297 / 210; width: 88%; }
.paper-preview.grid { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.preview-item { position: relative; overflow: hidden; display: grid; place-items: center; min-height: 0; border-radius: 5px; background: #f0f2f6; cursor: pointer; }
.preview-item img { width: 100%; height: 100%; object-fit: contain; }
.preview-item .sample-sheet { width: 86%; height: 90%; padding: 9px; color: #536078; background: white; border: 1px solid #dfe3eb; font-size: 8px; line-height: 1.8; }
.sample-accent { display: block; width: 100%; height: 5px; margin: -2px 0 5px; border-radius: 4px; background: #3475e8; }
.sample-highlight { display: inline-block; margin: 2px 0; padding: 0 4px; border-radius: 3px; color: #7a5900; background: #fff0a6; font-style: normal; }
.effect-original .sample-sheet { color: #4d5260; background: #fffaf0; }
.effect-clean .sample-sheet { color: #23314a; background: #fff; filter: contrast(1.12); }
.effect-gray .preview-item > img, .effect-gray .sample-sheet { filter: grayscale(1); }
.effect-bw .preview-item > img, .effect-bw .sample-sheet { filter: grayscale(1) contrast(1.75); }
.preview-item.item-clean .sample-sheet { color: #23314a; background: #fff; filter: contrast(1.14); }
.preview-item.item-bw > img, .preview-item.item-bw .sample-sheet { filter: grayscale(1) contrast(1.8); }
.item-effect-badge { position: absolute; z-index: 2; top: 5px; left: 5px; padding: 3px 5px; border-radius: 6px; color: white; background: rgba(36,101,245,.9); font-size: 8px; font-weight: 750; }
.review-outline { position: absolute; inset: 5px; border: 2px dashed var(--orange); border-radius: 4px; pointer-events: none; }
.page-note { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 14px 14px; color: var(--muted); font-size: 12px; }
.link-button { border: 0; background: transparent; color: var(--blue); padding: 6px; font-size: 12px; font-weight: 750; cursor: pointer; }

.bottom-action { position: fixed; z-index: 8; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(calc(100% - 40px), 500px); }
.generate-button { width: 100%; min-height: 58px; border: 0; border-radius: 18px; color: white; background: linear-gradient(145deg,var(--blue-2),var(--blue)); box-shadow: 0 14px 34px rgba(36,101,245,.28); font-size: 17px; font-weight: 780; cursor: pointer; }
.generate-button:active { transform: scale(.99); }

.sheet-backdrop { position: fixed; z-index: 19; inset: 0; background: rgba(17,26,45,.34); animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; } }
.action-sheet { position: fixed; z-index: 20; left: 50%; bottom: 0; transform: translateX(-50%); width: min(100%,540px); padding: 10px 18px calc(18px + env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0; background: white; box-shadow: 0 -18px 50px rgba(21,31,52,.18); animation: sheetIn .28s cubic-bezier(.2,.8,.2,1); }
@keyframes sheetIn { from { transform: translate(-50%,100%); } }
.sheet-handle { width: 42px; height: 5px; margin: 0 auto 16px; border-radius: 99px; background: #d7dbe3; }
.sheet-title { margin: 0 0 14px; font-size: 18px; }
.sheet-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 9px; }
.sheet-action { border: 0; padding: 11px 4px; border-radius: 14px; color: var(--ink); background: var(--paper); font-size: 12px; font-weight: 650; cursor: pointer; }
.sheet-action span { width: 38px; height: 38px; margin: 0 auto 7px; border-radius: 12px; display: grid; place-items: center; color: var(--blue); background: #e5edff; font-size: 18px; }
.sheet-colors { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 12px; }
.sheet-colors button { border: 1px solid var(--line); border-radius: 12px; padding: 11px; background: white; font-weight: 650; cursor: pointer; }
.sheet-close { width: 100%; margin-top: 12px; padding: 12px; border: 0; border-radius: 13px; color: var(--muted); background: #f0f2f6; font-weight: 700; cursor: pointer; }

.toast { position: fixed; z-index: 30; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translate(-50%,14px); padding: 10px 15px; border-radius: 999px; color: white; background: rgba(18,27,44,.9); font-size: 13px; opacity: 0; pointer-events: none; transition: .25s ease; }
.toast.show { opacity: 1; transform: translate(-50%,0); }

.result { min-height: calc(100svh - 50px); display: grid; align-content: center; text-align: center; padding-bottom: 12vh; }
.result-icon { width: 92px; height: 92px; margin: 0 auto 20px; border-radius: 30px; display: grid; place-items: center; color: white; background: var(--green); box-shadow: 0 14px 34px rgba(21,168,119,.22); font-size: 42px; }
.result h1 { margin: 0; font-size: 27px; }
.result p { color: var(--muted); line-height: 1.6; }
.result-file { margin: 20px 0; padding: 16px; border-radius: 18px; display: flex; align-items: center; gap: 12px; text-align: left; background: white; border: 1px solid var(--line); }
.result-file span { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; color: var(--blue); background: #e8efff; font-size: 22px; }
.result-actions { display: grid; gap: 11px; }
.result-actions button { min-height: 54px; border-radius: 16px; font-weight: 750; cursor: pointer; }
.result-actions .primary { border: 0; color: white; background: var(--blue); }
.result-actions .secondary { color: var(--ink); background: white; border: 1px solid var(--line); }

@media (min-width: 700px) {
  body { background: #e9edf6; padding: 24px 0; }
  .app-shell { min-height: calc(100svh - 48px); border-radius: 34px; background: var(--paper); box-shadow: 0 22px 70px rgba(26,38,66,.16); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
