:root {
  color-scheme: light;
  --ink: #17172a;
  --muted: #6f7180;
  --line: #e8e7ef;
  --soft: #f7f7fb;
  --surface: #ffffff;
  --violet: #5b4cf0;
  --violet-dark: #4939d7;
  --violet-soft: #eeecff;
  --shadow: 0 24px 70px rgba(54, 46, 115, .12);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-width: 320px; min-height: 100%; }
body {
  color: var(--ink);
  background: #fbfbfd;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; }
button { color: inherit; }

.site-header {
  height: 70px;
  padding: 0 clamp(22px, 4vw, 64px);
  display: flex;
  align-items: center;
  gap: clamp(28px, 5vw, 74px);
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 40;
  backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); font-size: 19px; font-weight: 760; letter-spacing: -.035em; white-space: nowrap; }
.brand b { color: var(--violet); }
.brand-mark { width: 35px; height: 35px; border-radius: 11px; background: var(--violet); display: grid; place-items: center; box-shadow: 0 7px 18px rgba(91,76,240,.24); }
.brand-mark::before { content: ""; width: 16px; height: 20px; border-radius: 3px; background: white; transform: rotate(-4deg); }
.brand-mark::after { content: ""; position: absolute; width: 7px; height: 2px; background: var(--violet); box-shadow: 0 4px 0 var(--violet), 0 8px 0 var(--violet); }
.main-nav { display: flex; align-items: stretch; align-self: stretch; gap: 3px; }
.main-nav button { position: relative; padding: 0 14px; border: 0; background: transparent; color: #5f6170; font-size: 13px; font-weight: 650; cursor: pointer; }
.main-nav button:hover, .main-nav button.active { color: var(--ink); }
.main-nav button.active::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 3px; background: var(--violet); border-radius: 4px 4px 0 0; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.privacy-badge { padding: 8px 11px; border-radius: 99px; background: #eff9f3; color: #337653; font-size: 12px; font-weight: 650; }
.privacy-badge span { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-right: 4px; border-radius: 50%; color: white; background: #45a371; font-size: 9px; }
.header-button, .secondary-button { padding: 9px 15px; border: 1px solid #d9d8e2; border-radius: 9px; background: white; font-weight: 700; font-size: 12px; cursor: pointer; }
.header-button:hover, .secondary-button:hover { border-color: #b6b1e8; color: var(--violet); }

.landing-view { min-height: calc(100vh - 70px); overflow: hidden; background: radial-gradient(circle at 78% 20%, rgba(109,92,255,.09), transparent 28%), linear-gradient(180deg, #fff 0%, #fafaff 100%); }
.hero { width: min(1180px, calc(100% - 48px)); min-height: 620px; margin: 0 auto; padding: 74px 0 62px; display: grid; grid-template-columns: minmax(0, .9fr) minmax(450px, 1fr); align-items: center; gap: clamp(60px, 9vw, 130px); }
.eyebrow { display: flex; align-items: center; gap: 8px; color: var(--violet); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.eyebrow span { width: 7px; height: 7px; border-radius: 50%; background: var(--violet); box-shadow: 0 0 0 5px var(--violet-soft); }
.hero h1 { margin: 19px 0 24px; font-size: clamp(48px, 5vw, 72px); line-height: 1.05; letter-spacing: -.065em; font-weight: 850; }
.hero h1 em { color: var(--violet); font-style: normal; }
.hero-copy > p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.85; }
.trust-row { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 19px; color: #525463; font-size: 12px; font-weight: 650; }
.trust-row b { display: inline-grid; place-items: center; width: 17px; height: 17px; margin-right: 4px; border-radius: 50%; color: #3c9665; background: #e8f8ef; font-size: 10px; }

.upload-card { min-height: 470px; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 42px; border: 1px solid #e5e2f5; border-radius: 26px; background: rgba(255,255,255,.86); box-shadow: var(--shadow); text-align: center; transition: .22s ease; }
.upload-card::before { content: ""; position: absolute; inset: 13px; border: 1.5px dashed #cbc7ea; border-radius: 19px; pointer-events: none; }
.upload-card.dragover { transform: translateY(-4px); border-color: var(--violet); box-shadow: 0 28px 80px rgba(77,63,190,.2); }
.upload-card.dragover::before { border-color: var(--violet); background: rgba(91,76,240,.03); }
.paper-stack { width: 110px; height: 116px; position: relative; margin-bottom: 22px; }
.paper-back, .paper-front { position: absolute; width: 69px; height: 86px; left: 20px; top: 8px; border-radius: 8px; }
.paper-back { background: #e7e3ff; transform: rotate(-10deg); }
.paper-front { z-index: 2; background: white; border: 1px solid #ddd9f7; box-shadow: 0 12px 30px rgba(62,49,145,.13); }
.paper-front b { position: absolute; left: 11px; bottom: 11px; color: var(--violet); font-size: 12px; }
.paper-fold { position: absolute; right: -1px; top: -1px; width: 21px; height: 21px; background: linear-gradient(225deg, transparent 49%, #e4e1f8 50%); border-top-right-radius: 7px; }
.paper-line { position: absolute; left: 12px; height: 3px; border-radius: 2px; background: #dedbe9; }
.paper-line.one { top: 28px; width: 38px; }.paper-line.two { top: 36px; width: 44px; }.paper-line.three { top: 44px; width: 29px; }
.upload-arrow { position: absolute; right: 5px; bottom: 8px; z-index: 3; width: 45px; height: 45px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--violet); border: 5px solid white; font-size: 22px; font-weight: 700; box-shadow: 0 8px 20px rgba(91,76,240,.28); }
.upload-card h2 { margin: 0 0 7px; font-size: 24px; letter-spacing: -.035em; }
.upload-card > p { margin: 0 0 22px; color: var(--muted); font-size: 13px; }
.primary-button { min-height: 43px; padding: 0 20px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 0; border-radius: 10px; color: white; background: var(--violet); box-shadow: 0 8px 18px rgba(91,76,240,.2); font-weight: 750; font-size: 13px; cursor: pointer; transition: .16s ease; }
.primary-button:hover { background: var(--violet-dark); transform: translateY(-1px); }
.primary-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.upload-button { width: 210px; }
.sample-link { position: relative; margin: 16px 0 14px; border: 0; background: transparent; color: var(--violet); font-size: 12px; font-weight: 700; cursor: pointer; }
.sample-link span { transition: margin .2s; }.sample-link:hover span { margin-left: 4px; }
.upload-card small { color: #a0a1ad; font-size: 10px; }

.feature-strip { width: min(1180px, calc(100% - 48px)); margin: 0 auto 54px; padding: 26px 32px; display: grid; grid-template-columns: repeat(4,1fr); gap: 22px; border: 1px solid #eeedf4; border-radius: 18px; background: rgba(255,255,255,.72); }
.feature-strip article { display: flex; align-items: center; gap: 13px; }
.feature-icon { flex: 0 0 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; font-size: 18px; font-weight: 700; }
.feature-icon.purple { color: #6956ec; background: #eeebff; }.feature-icon.amber { color: #d18b23; background: #fff3dc; }.feature-icon.green { color: #318765; background: #e6f7ee; }.feature-icon.blue { color: #3d79d8; background: #e8f2ff; }
.feature-strip b { display: block; margin-bottom: 4px; font-size: 13px; }.feature-strip p { margin: 0; color: var(--muted); font-size: 11px; }

/* Editor */
body.editor-open { overflow: hidden; background: #f3f3f7; }
body.editor-open .site-header { display: none; }
.editor-view { height: 100vh; background: #f3f3f7; }
.editor-bar { height: 66px; padding: 0 18px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; background: white; border-bottom: 1px solid var(--line); position: relative; z-index: 30; }
.file-block { min-width: 0; display: flex; align-items: center; gap: 10px; }
.file-block > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.file-block b { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.file-block small { color: var(--muted); font-size: 10px; }
.pdf-chip { padding: 5px 6px; border-radius: 5px; color: #df4e58; background: #ffedef; font-size: 9px; font-weight: 850; }
.icon-button { min-width: 34px; height: 34px; padding: 0; border: 1px solid transparent; border-radius: 8px; background: transparent; cursor: pointer; font-weight: 650; }
.icon-button:hover:not(:disabled) { background: var(--soft); border-color: var(--line); }
.icon-button:disabled { opacity: .35; cursor: not-allowed; }
.history-actions { display: flex; gap: 4px; }
.icon-button.labeled { width: auto; padding: 0 10px; color: #595b68; font-size: 11px; }
.icon-button.labeled span { font-size: 18px; vertical-align: -2px; }
.editor-actions { justify-self: end; display: flex; gap: 9px; }
.primary-button.compact { min-height: 37px; padding-inline: 15px; }

.editor-shell { height: calc(100vh - 66px); display: grid; grid-template-columns: 74px 176px minmax(320px,1fr) 270px; min-width: 960px; }
.tool-rail, .pages-panel, .properties-panel { background: white; border-right: 1px solid var(--line); }
.tool-rail { padding: 12px 8px 10px; display: flex; flex-direction: column; align-items: stretch; gap: 3px; }
.tool { height: 58px; padding: 6px 2px; border: 0; border-radius: 10px; background: transparent; color: #595b69; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; }
.tool:hover { background: #f6f5fb; color: var(--ink); }.tool.active { background: var(--violet-soft); color: var(--violet); }
.tool-svg { height: 23px; min-width: 25px; display: grid; place-items: center; font-size: 20px; font-weight: 650; line-height: 1; }
.edit-tool { font-family: Georgia, serif; font-size: 15px; letter-spacing: -.08em; }.format-tool { width: 19px; height: 17px; min-width: 0; position: relative; border-radius: 4px 4px 8px 8px; color: transparent; background: #666876; font-size: 0; transform: rotate(-12deg); }.format-tool::after { content: ""; width: 4px; height: 10px; position: absolute; left: 8px; top: 16px; border-radius: 2px; background: #666876; }.tool.active .format-tool, .tool.active .format-tool::after { background: var(--violet); }.text-tool { font-family: Georgia, serif; }.signature-tool, .draw-tool { font-size: 27px; font-family: cursive; transform: rotate(-8deg); }.highlight-tool { color: #f0b82c; font-size: 19px; }.shape-tool { font-size: 24px; }.image-tool { font-size: 22px; }
.tool small { font-size: 9px; font-weight: 650; }.tool-spacer { flex: 1; }.danger-tool:hover { color: #d94a55; background: #fff1f2; }

.pages-panel { min-width: 0; overflow: hidden; }
.panel-title { height: 48px; padding: 0 15px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.panel-title b { font-size: 12px; }.panel-title span { color: var(--muted); font-size: 10px; }
.panel-title button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 20px; }
.thumbnail-list { height: calc(100% - 48px); padding: 14px 12px 30px; overflow-y: auto; }
.thumb-item { width: 100%; margin-bottom: 14px; padding: 7px 7px 8px; border: 1px solid transparent; border-radius: 9px; background: transparent; cursor: pointer; }
.thumb-item.active { background: var(--violet-soft); border-color: #cbc5ff; }
.thumb-canvas-wrap { min-height: 140px; display: grid; place-items: center; border-radius: 4px; background: #eeeef3; box-shadow: 0 2px 7px rgba(33,32,54,.11); overflow: hidden; }
.thumb-item canvas { display: block; max-width: 100%; max-height: 150px; background: white; }
.thumb-item span { display: block; margin-top: 7px; color: #777986; text-align: center; font-size: 10px; font-weight: 650; }

.document-stage { min-width: 0; display: flex; flex-direction: column; background: #ededf2; }
.stage-toolbar { flex: 0 0 48px; display: flex; justify-content: center; align-items: center; gap: 28px; background: rgba(255,255,255,.78); border-bottom: 1px solid #dfdfe6; backdrop-filter: blur(10px); }
.page-switcher, .zoom-switcher { display: flex; align-items: center; height: 30px; border: 1px solid #dedde7; border-radius: 8px; background: white; overflow: hidden; }
.page-switcher button, .zoom-switcher button { width: 30px; height: 100%; border: 0; background: white; color: #626471; cursor: pointer; font-size: 18px; }.page-switcher button:hover, .zoom-switcher button:hover { background: #f3f2f9; }
.page-switcher span, .zoom-switcher span { min-width: 66px; padding: 0 9px; text-align: center; color: #676976; font-size: 10px; font-weight: 650; }
.page-switcher input { width: 28px; padding: 2px; border: 0; border-radius: 3px; background: #f1f0f6; text-align: center; font-size: 10px; font-weight: 700; -moz-appearance: textfield; }.page-switcher input::-webkit-inner-spin-button { display: none; }
.page-scroll { flex: 1; min-height: 0; overflow: auto; padding: 38px 44px 80px; position: relative; }
.page-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; }
.page-loading span { width: 32px; height: 32px; border: 3px solid #dcd9f7; border-top-color: var(--violet); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.page-wrap { position: relative; width: max-content; margin: 0 auto; background: white; box-shadow: 0 7px 28px rgba(29,29,48,.18); line-height: 0; }
#pdfCanvas { display: block; }
.source-text-layer, .annotation-layer { position: absolute; inset: 0; overflow: hidden; }
.source-text-layer { z-index: 3; pointer-events: none; }
.source-text-item { position: absolute; padding: 0; border: 0; border-radius: 2px; background: transparent; color: transparent; text-align: left; white-space: pre; cursor: text; pointer-events: none; transform-origin: left top; }
.source-text-layer.active .source-text-item { pointer-events: auto; }
.source-text-layer.active .source-text-item:hover { color: rgba(91,76,240,.18); background: rgba(91,76,240,.14); outline: 1px solid rgba(91,76,240,.7); }
.source-text-item.edited { pointer-events: none !important; visibility: hidden; }
.annotation-layer { z-index: 2; touch-action: none; }
.annotation-layer[data-tool="edit"] { pointer-events: none; }
.annotation-layer[data-tool="edit"] .annotation { pointer-events: auto; }
.annotation-layer[data-tool="text"] { cursor: text; }.annotation-layer[data-tool="highlight"], .annotation-layer[data-tool="shape"] { cursor: crosshair; }.annotation-layer[data-tool="draw"] { cursor: crosshair; }
.annotation { position: absolute; line-height: normal; cursor: move; user-select: none; touch-action: none; }
.annotation.selected { outline: 1.5px solid var(--violet); outline-offset: 3px; }
.annotation.selected::after { content: ""; position: absolute; width: 7px; height: 7px; right: -7px; bottom: -7px; border: 1.5px solid white; border-radius: 50%; background: var(--violet); box-shadow: 0 0 0 1px var(--violet); }
.annotation-text { min-width: 48px; padding: 2px 4px; white-space: pre-wrap; color: #272532; background: rgba(255,255,255,.04); font-weight: 500; cursor: text; }
.annotation-text[contenteditable="true"] { user-select: text; }
.annotation-edit { min-width: 20px; padding: 0 2px; color: #171720; background: #fff; white-space: pre; cursor: text; }
.annotation-edit.deleted { min-width: 36px; min-height: 16px; background: repeating-linear-gradient(-45deg,#fff,#fff 4px,#fff0f1 4px,#fff0f1 8px); outline-color: #df4e58; }
.annotation-edit.deleted::before { content: "已删除"; position: absolute; left: 2px; top: 1px; color: #cf4854; font-size: 9px; font-weight: 700; white-space: nowrap; }
.annotation-highlight { border-radius: 2px; mix-blend-mode: multiply; }
.annotation-shape { border-style: solid; background: transparent; }
.annotation-draw { overflow: visible; }.annotation-draw svg { overflow: visible; display: block; width: 100%; height: 100%; }
.annotation-image img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; display: block; }

.properties-panel { border-right: 0; border-left: 1px solid var(--line); overflow-y: auto; }
.empty-properties { padding: 42px 26px; text-align: center; }
.empty-properties > div { width: 48px; height: 48px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 15px; color: var(--violet); background: var(--violet-soft); font-size: 22px; }
.empty-properties b { display: block; font-size: 13px; }.empty-properties p { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.property-form { padding: 17px 16px 20px; border-bottom: 1px solid var(--line); }
.selected-type { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; padding: 10px; border-radius: 9px; background: #f6f5fb; }
.selected-type > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: var(--violet); background: white; box-shadow: 0 2px 8px rgba(40,37,74,.08); font-weight: 750; }
.selected-type div { display: flex; flex-direction: column; gap: 2px; }.selected-type small { color: var(--muted); font-size: 9px; }.selected-type b { font-size: 12px; }
.field { display: flex; flex-direction: column; gap: 7px; margin: 0 0 15px; color: #6c6e7b; font-size: 10px; font-weight: 650; }
.field textarea { width: 100%; resize: vertical; padding: 9px; border: 1px solid #dddce5; border-radius: 8px; color: var(--ink); outline: 0; font-size: 12px; line-height: 1.45; }.field textarea:focus { border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-soft); }
.field select { width: 100%; height: 34px; padding: 0 9px; border: 1px solid #dddce5; border-radius: 8px; color: var(--ink); background: white; outline: 0; font-size: 11px; }
.field-row { display: grid; grid-template-columns: 65px 1fr; gap: 13px; }
.field input[type="color"] { width: 100%; height: 34px; padding: 3px; border: 1px solid #dddce5; border-radius: 7px; background: white; }
.range-with-value { display: flex; align-items: center; gap: 7px; }.range-with-value input { flex: 1; accent-color: var(--violet); }.range-with-value output { min-width: 31px; color: var(--ink); font-size: 10px; text-align: right; }
.position-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 16px; }.position-grid button { padding: 7px; border: 1px solid #e0dfe7; border-radius: 7px; background: white; color: #666875; font-size: 10px; cursor: pointer; }.position-grid button:hover { color: var(--violet); border-color: #bcb6f5; }
.delete-button { width: 100%; padding: 9px; border: 1px solid #f0cfd3; border-radius: 8px; color: #c74350; background: #fff7f7; font-size: 10px; font-weight: 700; cursor: pointer; }
.document-info { padding: 18px 16px; }.document-info > b { font-size: 11px; }.document-info p { display: flex; justify-content: space-between; margin: 13px 0 0; color: var(--muted); font-size: 10px; }.document-info strong { color: #4f515d; font-weight: 650; }.document-info .local-value { color: #35825b; }

.signature-dialog { width: min(500px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 18px; color: var(--ink); box-shadow: 0 30px 100px rgba(29,25,64,.28); }.signature-dialog::backdrop { background: rgba(25,23,42,.46); backdrop-filter: blur(3px); }
.signature-dialog form { padding: 24px; }.dialog-head { display: flex; justify-content: space-between; align-items: start; }.dialog-head span { color: var(--violet); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }.dialog-head h2 { margin: 5px 0 19px; font-size: 19px; }.dialog-head button { border: 0; background: transparent; color: var(--muted); font-size: 23px; cursor: pointer; }
.signature-pad-wrap { position: relative; border: 1.5px dashed #c8c5d8; border-radius: 12px; background: #faf9fd; overflow: hidden; }.signature-pad-wrap canvas { width: 100%; height: 156px; display: block; touch-action: none; position: relative; z-index: 2; }.signature-pad-wrap span { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); color: #bbb9c6; font-size: 12px; }
.dialog-actions { margin-top: 17px; display: flex; justify-content: flex-end; gap: 9px; }
.toast { position: fixed; left: 50%; bottom: 26px; z-index: 100; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; padding: 11px 16px; border-radius: 10px; color: white; background: #1e1d2d; box-shadow: 0 10px 30px rgba(0,0,0,.2); font-size: 12px; transition: .2s ease; }.toast.show { opacity: 1; transform: translate(-50%,0); }

@media (max-width: 1120px) {
  .main-nav button:nth-last-child(-n+2) { display: none; }
  .privacy-badge { display: none; }
  .hero { grid-template-columns: 1fr 440px; gap: 50px; }
  .feature-strip { grid-template-columns: 1fr 1fr; }
  .editor-shell { grid-template-columns: 70px 160px minmax(320px,1fr) 250px; }
}
@media (max-width: 820px) {
  .site-header { height: 62px; padding: 0 16px; }.main-nav { display: none; }.header-actions { margin-left: auto; }
  .hero { width: min(100% - 28px, 620px); padding: 52px 0 42px; grid-template-columns: 1fr; gap: 42px; text-align: center; }.eyebrow, .trust-row { justify-content: center; }.hero h1 { font-size: 46px; }.upload-card { min-height: 430px; }
  .feature-strip { width: min(100% - 28px,620px); grid-template-columns: 1fr 1fr; padding: 21px; }
}
@media (max-width: 520px) {
  .header-button { display: none; }.hero { padding-top: 38px; }.hero h1 { font-size: 39px; }.hero-copy > p br { display: none; }.trust-row { gap: 11px; }.upload-card { min-height: 410px; padding: 26px; }.feature-strip { grid-template-columns: 1fr; }.feature-strip article { padding-left: 18px; }
}
