:root {
    --ink: #1f2329;
    --ink-soft: #4e5560;
    --cinnabar: #ed3c2f;
    --cinnabar-deep: #d13227;
    --paper: #f4f6f8;
    --paper-white: #ffffff;
    --stage: #d7dee6;
    --line: #e3e6eb;
    --muted: #6b7380;
    --wps-blue: #3d8bff;
    --wps-blue-deep: #2f74e0;
    --wps-chrome: #eef2f6;
    --wps-red: #ed3c2f;
    --ok: #2f6f4e;
    --danger: #b42318;
    --shadow: 0 18px 40px rgba(26, 24, 20, 0.12);
    --radius: 14px;
    --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    --serif: "Songti SC", "STSong", "Noto Serif SC", serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
    font-family: var(--font);
    color: var(--ink);
    background: var(--paper);
    font-size: 16px;
    line-height: 1.55;
}
a { color: var(--cinnabar); text-decoration: none; }
a:hover { color: var(--cinnabar-deep); }
button, .btn, [role="button"] { cursor: pointer; }
:focus-visible {
    outline: 3px solid rgba(194, 58, 43, 0.45);
    outline-offset: 2px;
}
.muted { color: var(--muted); }
.hidden { display: none !important; }

.brand-seal {
    width: 48px; height: 48px;
    display: grid; place-items: center;
    background: var(--cinnabar);
    color: #fff;
    font-family: var(--serif);
    font-weight: 700;
    border-radius: 10px;
    box-shadow: inset 0 0 0 2px rgba(255,255,255,.18);
}
.brand-seal.sm { width: 36px; height: 36px; font-size: 18px; }
.brand-seal.xs { width: 28px; height: 28px; font-size: 14px; border-radius: 8px; }
.brand-lockup {
    display: flex; align-items: center; gap: 10px;
    color: var(--ink); font-weight: 700; letter-spacing: 0.04em;
}
.brand-lockup.light { color: #f6f1e8; }

.btn-ink {
    --bs-btn-bg: var(--cinnabar);
    --bs-btn-border-color: var(--cinnabar);
    --bs-btn-hover-bg: var(--cinnabar-deep);
    --bs-btn-hover-border-color: var(--cinnabar-deep);
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #86261c;
    --bs-btn-active-border-color: #86261c;
    --bs-btn-active-color: #fff;
    min-height: 44px;
    border-radius: 10px;
    font-weight: 600;
}
.form-control, .form-select {
    min-height: 44px;
    border-radius: 10px;
    border-color: var(--line);
    background: var(--paper-white);
}
.form-control:focus, .form-select:focus {
    border-color: var(--cinnabar);
    box-shadow: 0 0 0 3px rgba(194, 58, 43, 0.15);
}
.form-error { color: var(--danger); font-size: 14px; }
.yunmo-modal { border: 0; border-radius: 16px; }
.yunmo-modal .modal-title { font-size: 18px; font-weight: 700; }

.auth-body { background: #2b211c; }
.auth-shell {
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(280px, 42%) 1fr;
}
.auth-panel {
    padding: 48px 40px;
    background:
        radial-gradient(circle at 20% 10%, rgba(194,58,43,.35), transparent 40%),
        linear-gradient(160deg, #3a2a24, #1c1613);
    color: #f6f1e8;
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-panel .wps-logo { width: 48px; height: 48px; font-size: 22px; }
.brand-name { font-family: var(--serif); font-size: 28px; }
.brand-en { font-size: 12px; letter-spacing: 0.28em; opacity: 0.7; }
.auth-lead { font-size: 22px; line-height: 1.4; max-width: 16em; }
.auth-points { margin: 0; padding-left: 18px; color: #d8cfc3; }
.auth-demo {
    margin-top: auto;
    padding: 16px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 12px;
    font-size: 13px;
}
.auth-demo code { display: block; color: #ffd7cf; }
.auth-form-wrap {
    display: grid;
    place-items: center;
    background: var(--paper);
    padding: 32px 16px;
}
.auth-form {
    width: min(420px, 100%);
    background: var(--paper-white);
    padding: 36px 32px;
    border-radius: 20px;
    box-shadow: var(--shadow);
}
.auth-form h1 { font-size: 26px; margin-bottom: 8px; }
.auth-sub { color: var(--muted); margin-bottom: 24px; }
.auth-switch { margin-top: 18px; text-align: center; color: var(--muted); }

.app-topbar, .editor-top {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 20px;
    background: var(--paper-white);
    border-bottom: 1px solid var(--line);
    min-height: 56px;
}
.topbar-search {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--paper);
    border-radius: 999px;
    padding: 0 14px;
    max-width: 420px;
}
.topbar-search input {
    border: 0; background: transparent; width: 100%; height: 40px; outline: none;
}
.topbar-user, .editor-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.ghost-link { color: var(--ink-soft); font-size: 14px; }
.user-chip {
    background: #f0e7db;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}

.home-layout { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100dvh - 56px); }
.home-side {
    padding: 20px 12px;
    border-right: 1px solid var(--line);
    background: #f3ece2;
}
.side-item {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 12px 14px;
    border-radius: 10px;
    color: var(--ink-soft);
    display: flex;
    gap: 10px;
    align-items: center;
    min-height: 44px;
}
.side-item.active, .side-item:hover { background: #fff; color: var(--ink); }
.home-main { padding: 28px 32px 48px; }
.home-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 20px; }
.home-head h1 { font-size: 28px; margin: 0; }
.template-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 22px 18px;
    margin-bottom: 32px;
}
.grid-heading {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 14px;
    color: var(--ink-soft);
}
.grid-tile, .doc-card {
    border: 0;
    background: transparent;
    padding: 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.paper-thumb {
    aspect-ratio: 3 / 4;
    display: block;
    background-color: #fff;
    background-image:
        linear-gradient(rgba(194, 58, 43, 0.14) 1px, transparent 1px),
        linear-gradient(90deg, rgba(194, 58, 43, 0.14) 1px, transparent 1px);
    background-size: 16px 20px;
    background-position: 12px 14px;
    border: 1px solid #e7ddd0;
    border-radius: 10px;
    box-shadow: 0 10px 22px rgba(40, 30, 20, 0.08);
    padding: 14px 12px;
    overflow: hidden;
    position: relative;
    transition: transform 180ms ease, box-shadow 180ms ease;
}
.thumb-link {
    position: absolute;
    inset: 0;
    z-index: 1;
}
.grid-tile:hover .paper-thumb,
.doc-card:hover .paper-thumb {
    transform: translateY(-3px);
    box-shadow: 0 16px 28px rgba(40, 30, 20, 0.14);
}
.thumb-mark {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-family: var(--serif);
    font-size: 36px;
    color: var(--cinnabar);
}
.thumb-preview {
    font-size: 11px;
    line-height: 1.7;
    color: var(--ink-soft);
    display: -webkit-box;
    -webkit-line-clamp: 10;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}
.grid-tile strong, .doc-card h3 {
    display: block;
    margin: 10px 2px 2px;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.doc-card h3 a { color: var(--ink); }
.tile-sub, .doc-meta {
    margin: 0 2px;
    color: var(--muted);
    font-size: 12px;
}
.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 22px 18px;
}
.doc-actions {
    position: absolute;
    right: 8px;
    bottom: 8px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 160ms ease;
    z-index: 2;
}
.doc-card:hover .doc-actions,
.doc-card:focus-within .doc-actions { opacity: 1; }
.icon-btn {
    width: 36px; height: 36px;
    border: 0;
    background: rgba(255, 252, 247, 0.94);
    border-radius: 8px;
    color: var(--ink-soft);
    box-shadow: 0 2px 8px rgba(40, 30, 20, 0.12);
}
.icon-btn:hover { background: #eadfd0; color: var(--ink); }
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 16px;
    color: var(--muted);
}

.editor-body { background: var(--stage); }
.back-home {
    display: flex; align-items: center; gap: 6px; color: var(--ink);
}
.doc-title {
    border: 0; background: transparent;
    font-size: 16px; font-weight: 600;
    width: min(420px, 40vw);
    outline: none;
}
.save-state { font-size: 13px; color: var(--ok); }
.save-state.busy { color: var(--muted); }
.save-state.err { color: var(--danger); }
.tool-btn {
    width: 40px; height: 40px; border: 0; background: #f3ece2; border-radius: 10px;
}
.share-wrap { position: relative; z-index: 80; }
.share-pop {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: min(340px, 92vw);
    background: #f5f6f8;
    border: 1px solid #eceff3;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(31, 35, 41, 0.16);
    padding: 12px;
    z-index: 80;
}
.share-pop h3 { font-size: 16px; margin: 0; font-weight: 700; color: var(--ink); }
.share-url-row { display: flex; gap: 8px; margin: 12px 0; }
.share-url-row input {
    flex: 1;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0 10px;
    background: var(--paper);
}
.share-code-input {
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    letter-spacing: 0.18em;
    font-weight: 700;
    text-transform: uppercase;
}
.share-link-input {
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0;
    text-transform: none;
}
.share-pop-actions { display: flex; gap: 8px; }
.collab-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 2px 4px 10px;
}
.collab-online-btn {
    border: 0;
    background: #e8f1ff;
    color: #3d8bff;
    min-height: 28px;
    padding: 0 12px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 600;
}
.collab-card {
    background: #fff;
    border: 1px solid #eef1f4;
    border-radius: 12px;
    padding: 4px 10px;
}
.collab-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 44px;
    color: var(--ink);
    font-size: 14px;
}
.collab-toggle-row { cursor: pointer; margin: 0; }
.collab-row-left {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.collab-ico {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    color: #6b7380;
}
.collab-switch { position: relative; width: 40px; height: 22px; flex: 0 0 40px; }
.collab-switch input {
    position: absolute;
    opacity: 0;
    width: 40px;
    height: 22px;
    margin: 0;
    cursor: pointer;
}
.collab-switch-ui {
    display: block;
    width: 40px;
    height: 22px;
    border-radius: 11px;
    background: #d5dbe3;
    position: relative;
    transition: background .15s ease;
}
.collab-switch-ui::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(31, 35, 41, .2);
    transition: left .15s ease;
}
.collab-switch input:checked + .collab-switch-ui { background: #3d8bff; }
.collab-switch input:checked + .collab-switch-ui::after { left: 20px; }
.collab-on { border-top: 1px solid #f0f2f5; padding-bottom: 8px; }
.collab-perm {
    color: #6b7380;
    font-size: 13px;
    white-space: nowrap;
}
.collab-perm::after { content: " ▾"; font-size: 10px; }
.collab-link-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    color: #6b7380;
}
.collab-link {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    color: #4e5560;
    font-size: 13px;
    outline: none;
}
.collab-copy {
    border: 0;
    background: #e8f1ff;
    color: #3d8bff;
    min-height: 28px;
    padding: 0 12px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.collab-quick {
    display: flex;
    gap: 12px;
    padding: 4px 2px 8px;
}
.collab-dot {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 16px;
}
.collab-dot.mint { background: #6ed3c2; }
.collab-dot.cyan { background: #4ec4e8; }
.collab-dot.blue { background: #4aa3f0; }
.collab-dot.purple { background: #8b7cf6; }
.collab-send-label {
    margin: 12px 4px 8px;
    font-size: 14px;
    font-weight: 700;
}
.collab-send {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 8px;
    padding: 10px 8px 12px;
}
.collab-send-item {
    border: 0;
    background: transparent;
    min-height: 64px;
    border-radius: 8px;
    color: var(--ink);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
    font-size: 13px;
    text-align: left;
}
.collab-send-item:hover { background: #f7f8fa; }
.collab-send-item i { font-size: 20px; color: #5b6470; }
.share-title {
    flex: 1;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.btn-ink.btn-sm { min-height: 36px; padding: 0 14px; }
.ribbon { background: var(--paper-white); border-bottom: 1px solid var(--line); }
.ribbon-tabs { display: flex; gap: 4px; padding: 8px 16px 0; }
.ribbon-tab {
    border: 0; background: transparent;
    padding: 8px 14px;
    border-radius: 10px 10px 0 0;
    color: var(--ink-soft);
}
.ribbon-tab.active { background: #f6f1e8; color: var(--cinnabar); font-weight: 700; }
.ribbon-body {
    display: flex; flex-wrap: wrap; gap: 8px;
    padding: 8px 16px 10px;
    background: #f6f1e8;
}
.ribbon-group {
    display: flex; align-items: center; gap: 4px;
    padding-right: 10px;
    border-right: 1px solid var(--line);
}
.ribbon-group.grow { flex: 1; }
.rbtn {
    min-width: 36px; min-height: 36px;
    border: 0; background: transparent;
    border-radius: 8px;
    color: var(--ink);
}
.rbtn:hover, .rbtn.active { background: #fff; }
.rbtn.wide { padding: 0 12px; display: inline-flex; gap: 6px; align-items: center; min-height: 40px; }
.rselect {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 8px;
    height: 36px;
    padding: 0 8px;
}
.rselect.sm { width: 84px; }
.color-lab { position: relative; overflow: hidden; }
.color-lab input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ribbon-hint { font-size: 13px; color: var(--muted); padding: 0 8px; }

.paper-stage {
    padding: 28px 16px 72px;
    display: flex;
    justify-content: center;
}
.paper {
    width: min(820px, 100%);
    min-height: 1123px;
    background: #fff;
    box-shadow: 0 12px 40px rgba(40, 30, 20, 0.18);
    padding: 72px 80px;
    outline: none;
}
.paper.compact { padding: 40px 48px; }
.paper h1 { font-size: 28px; line-height: 1.3; }
.paper h2 { font-size: 22px; }
.paper table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.paper table td, .paper table th {
    border: 1px solid #cfc6b8;
    padding: 8px 10px;
}
.paper img { max-width: 100%; height: auto; }
.editor-status {
    position: fixed; left: 0; right: 0; bottom: 0;
    height: 36px;
    background: var(--paper-white);
    border-top: 1px solid var(--line);
    display: flex; justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    font-size: 12px;
    color: var(--muted);
}

.admin-body { background: #efe8dc; }
.admin-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100dvh; }
.admin-side {
    background: #241c18;
    color: #f6f1e8;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.admin-link {
    display: flex; align-items: center; gap: 10px;
    color: #d8cfc3;
    padding: 12px 12px;
    border-radius: 10px;
    min-height: 44px;
}
.admin-link.active, .admin-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-side-foot { margin-top: auto; font-size: 13px; color: #b7aea3; }
.admin-side-foot a { color: #ffd7cf; }
.admin-main { padding: 32px; }
.admin-head { display: flex; justify-content: space-between; align-items: end; margin-bottom: 16px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 20px 0 28px; }
.stat-card, .admin-panel {
    background: var(--paper-white);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--line);
}
.stat-card span { color: var(--muted); font-size: 13px; }
.stat-card strong { display: block; font-size: 32px; margin-top: 8px; }
.table-wrap {
    background: var(--paper-white);
    border-radius: 16px;
    border: 1px solid var(--line);
    overflow: auto;
}
.table { margin: 0; }
.toolbar-row { max-width: 360px; margin-bottom: 16px; }
.quick-row { display: flex; gap: 10px; flex-wrap: wrap; }

.toast-wrap {
    position: fixed;
    right: 16px;
    bottom: 48px;
    z-index: 1080;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast-item {
    background: var(--ink);
    color: #fff;
    padding: 10px 14px;
    border-radius: 10px;
    min-width: 180px;
    animation: rise 180ms ease;
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 900px) {
    .auth-shell, .home-layout, .admin-shell { grid-template-columns: 1fr; }
    .auth-panel { display: none; }
    .home-side { display: flex; gap: 8px; overflow: auto; border-right: 0; border-bottom: 1px solid var(--line); }
    .side-item { width: auto; white-space: nowrap; }
    .paper { padding: 32px 20px; min-height: 80vh; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .doc-title { width: 40%; }
}

@media (hover: none) {
    .doc-actions { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}

@media print {
    .editor-top, .ribbon, .editor-status, .toast-wrap, .share-pop { display: none !important; }
    .paper-stage { padding: 0; }
    .paper { box-shadow: none; width: auto; min-height: auto; }
    .wps-editor-chrome, .style-panel, .find-bar, .page-ruler { display: none !important; }
}

.wps-app, .wps-editor { background: var(--paper); color: var(--ink); }
.wps-topbar, .wps-titlebar {
    display: flex; align-items: center; gap: 12px;
    min-height: 48px; padding: 0 16px;
    background: var(--wps-chrome);
    border-bottom: 1px solid var(--line);
}
.wps-brand { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 700; }
.wps-brand.compact .wps-brand-name { font-size: 13px; }
.wps-logo {
    width: 28px; height: 28px; border-radius: 6px;
    display: grid; place-items: center;
    background: var(--wps-red); color: #fff;
    font-family: var(--serif); font-weight: 700; font-size: 15px;
}
.wps-logo.sm { width: 22px; height: 22px; font-size: 12px; border-radius: 5px; }
.wps-search {
    flex: 1; max-width: 420px; min-height: 36px;
    display: flex; align-items: center; gap: 8px;
    background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 0 12px;
}
.wps-search input { border: 0; outline: none; width: 100%; height: 34px; background: transparent; }
.wps-top-actions, .wps-title-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.wps-text-btn, .wps-ghost-btn {
    border: 0; background: transparent; color: var(--ink-soft); font-size: 13px;
    min-height: 32px; padding: 0 8px; border-radius: 6px;
}
.wps-text-btn:hover, .wps-ghost-btn:hover { background: rgba(0,0,0,.05); color: var(--ink); }
.wps-ghost-btn { border: 1px solid var(--line); background: #fff; }
.wps-ghost-btn.sm, .wps-primary-btn.sm { min-height: 32px; padding: 0 10px; font-size: 13px; }
.wps-user {
    width: 28px; height: 28px; border-radius: 50%;
    display: grid; place-items: center;
    background: #5b8def; color: #fff; font-size: 13px; font-weight: 700;
}
.wps-user.sm { width: 24px; height: 24px; font-size: 12px; }
.wps-shell { display: grid; grid-template-columns: 168px 1fr; min-height: calc(100dvh - 48px); }
.wps-nav { padding: 12px 8px; background: #f7f8fa; border-right: 1px solid var(--line); }
.wps-nav-item {
    width: 100%; border: 0; background: transparent; text-align: left;
    display: flex; align-items: center; gap: 10px;
    min-height: 40px; padding: 0 12px; border-radius: 8px; color: var(--ink-soft);
}
.wps-nav-item.active, .wps-nav-item:hover { background: #fff; color: var(--ink); box-shadow: 0 1px 0 var(--line); }
.wps-main { padding: 28px 36px 48px; overflow: auto; }
.wps-sec-title { font-size: 14px; font-weight: 700; margin: 8px 0 16px; color: var(--ink); }
.wps-app-grid { display: flex; flex-wrap: wrap; gap: 28px 36px; margin-bottom: 36px; }
.wps-app-tile {
    width: 84px; border: 0; background: transparent;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    color: var(--ink); font-size: 13px; padding: 8px; border-radius: 12px;
}
.wps-app-tile:hover, .wps-app-tile:focus-visible { background: #eef3fb; }
.wps-app-icon {
    width: 52px; height: 52px; border-radius: 12px;
    display: grid; place-items: center;
    color: #fff; font-size: 26px; font-weight: 800;
    box-shadow: 0 8px 16px rgba(31,35,41,.12);
}
.tone-word { background: #4b89f7; }
.tone-slides, .tone-aippt { background: #f5a623; }
.tone-sheet { background: #2ecc71; }
.tone-pdf { background: #e74c3c; font-size: 22px; }
.tone-smart { background: #1abc9c; }
.tone-smartsheet { background: #27ae60; }
.tone-form { background: #3498db; }
.tone-grid { background: #16a085; }
.tone-mind { background: #2ecc71; }
.tone-flow { background: #4b7bec; }
.tone-poster { background: #45aaf2; }
.tone-voice { background: #a55eea; }
.tone-note { background: #26de81; }
.wps-docs-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 16px; }
.wps-docs-head h2 { margin: 0; font-size: 18px; }
.wps-primary-btn {
    border: 0; background: var(--wps-blue); color: #fff;
    min-height: 36px; padding: 0 14px; border-radius: 6px; font-weight: 600;
}
.wps-primary-btn:hover { background: var(--wps-blue-deep); }
.wps-doc-list { display: flex; flex-direction: column; gap: 2px; }
.wps-doc-row {
    display: grid; grid-template-columns: 36px 1fr auto auto;
    align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 8px; color: inherit;
}
.wps-doc-row:hover { background: #eef3fb; }
.wps-doc-name { color: var(--ink); font-weight: 600; text-decoration: none; }
.wps-doc-meta, .wps-doc-date { color: var(--muted); font-size: 12px; }
.wps-doc-actions { display: flex; gap: 4px; }
.wps-editor { display: flex; flex-direction: column; min-height: 100dvh; background: var(--stage); }
.wps-editor-chrome { position: sticky; top: 0; z-index: 20; background: var(--wps-chrome); }
.wps-quick, .wps-tabs { display: flex; align-items: center; gap: 4px; }
.wps-tabs { flex: 1; min-width: 0; }
.wps-tab {
    display: flex; align-items: center; gap: 8px;
    background: #fff; border: 1px solid var(--line); border-bottom: 0;
    border-radius: 8px 8px 0 0; padding: 4px 8px; min-height: 34px;
}
.wps-tab.current { box-shadow: inset 0 2px 0 var(--wps-blue); }
.wps-tab-badge {
    width: 18px; height: 18px; border-radius: 4px; color: #fff;
    display: grid; place-items: center; font-size: 11px; font-weight: 800;
}
.wps-tab .doc-title { width: min(240px, 28vw); font-size: 13px; font-weight: 600; }
.wps-tab-add { width: 28px; height: 28px; border: 0; border-radius: 6px; background: transparent; font-size: 18px; }
.wps-tab-add:hover { background: #fff; }
.wps-icon-btn { width: 32px; height: 32px; border: 0; background: transparent; border-radius: 6px; color: var(--ink-soft); }
.wps-icon-btn:hover, .wps-icon-btn.active { background: #fff; color: var(--ink); }
.wps-share-btn {
    border: 0; background: var(--wps-blue); color: #fff;
    min-height: 30px; padding: 0 14px; border-radius: 6px; font-weight: 600;
}
.wps-file-menu { position: relative; }
.wps-menu-btn { border: 0; background: transparent; min-height: 32px; padding: 0 10px; border-radius: 6px; }
.wps-menu-btn:hover { background: #fff; }
.wps-file-pop {
    position: absolute; left: 0; top: 100%;
    background: #fff; border: 1px solid var(--line); border-radius: 8px;
    box-shadow: var(--shadow); min-width: 160px; padding: 6px; z-index: 30;
}
.wps-file-pop button {
    width: 100%; border: 0; background: transparent; text-align: left;
    padding: 8px 10px; border-radius: 6px; min-height: 36px;
}
.wps-file-pop button:hover { background: #eef3fb; }
.wps-editor .ribbon { background: #f7f8fa; border-bottom: 1px solid var(--line); }
.wps-editor .ribbon-tabs { padding: 0 12px; gap: 2px; background: var(--wps-chrome); }
.wps-editor .ribbon-tab { padding: 8px 12px; border-radius: 0; position: relative; }
.wps-editor .ribbon-tab.active { background: transparent; color: var(--wps-blue); font-weight: 700; }
.wps-editor .ribbon-tab.active::after {
    content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px; background: var(--wps-blue);
}
.wps-editor .ribbon-body { background: #fff; padding: 6px 10px 8px; align-items: stretch; }
.wps-editor .ribbon-group { border-right: 1px solid var(--line); padding: 0 8px; gap: 6px; }
.rbtn.tall { min-width: 52px; min-height: 56px; flex-direction: column; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; gap: 2px; }
.rbtn-col { display: flex; flex-direction: column; }
.font-group, .para-group { flex-direction: column; align-items: flex-start; justify-content: center; }
.font-row { display: flex; align-items: center; gap: 2px; }
.rselect.xs { width: 64px; }
.style-chip {
    min-width: 64px; min-height: 52px; border: 1px solid var(--line); background: #fff;
    border-radius: 6px; padding: 4px 8px; font-size: 13px;
}
.style-chip.active { border-color: var(--wps-blue); box-shadow: 0 0 0 1px var(--wps-blue); }
.style-chip.h { font-weight: 700; }
.color-ico { font-weight: 800; border-bottom: 3px solid currentColor; line-height: 1; }
.wps-workspace { display: grid; grid-template-columns: 1fr 260px; min-height: 0; flex: 1; }
.wps-editor .paper-stage { padding: 24px 20px 64px; overflow: auto; display: flex; flex-direction: column; align-items: center; }
.page-ruler { width: min(794px, 100%); height: 18px; margin-bottom: 6px; }
.ruler-track { height: 100%; background: repeating-linear-gradient(90deg, #8b93a0 0 1px, transparent 1px 20px); opacity: .45; border-radius: 2px; }
.wps-editor .paper {
    width: min(794px, 100%); min-height: 1123px; background: #fff;
    box-shadow: 0 2px 8px rgba(31,35,41,.12), 0 18px 40px rgba(31,35,41,.08);
    padding: 72px 90px; font-size: 14px; line-height: 1.75;
    font-family: "SimSun", "Songti SC", serif;
}
.wps-editor .paper.compact { padding: 42px 48px; }
.wps-editor .paper.wide { padding: 90px 120px; }
.wps-editor .paper h1 { font-size: 26px; font-weight: 700; margin: 0 0 16px; }
.wps-editor .paper h2 { font-size: 20px; font-weight: 700; margin: 18px 0 10px; }
.wps-editor .paper h3 { font-size: 16px; font-weight: 700; margin: 14px 0 8px; }
.wps-editor .paper h4 { font-size: 14px; font-weight: 700; }
.style-panel { background: #fff; border-left: 1px solid var(--line); padding: 12px; overflow: auto; }
.wps-workspace.no-panel { grid-template-columns: 1fr; }
.style-panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.style-field { display: grid; gap: 6px; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.style-field select { min-height: 34px; border: 1px solid var(--line); border-radius: 6px; padding: 0 8px; }
.style-caption { font-size: 12px; color: var(--muted); margin: 14px 0 8px; }
.style-list { display: grid; gap: 6px; }
.style-list button { border: 1px solid var(--line); background: #fff; text-align: left; padding: 10px 12px; border-radius: 8px; }
.style-list button.active, .style-list button:hover { background: #f3f5f8; }
.style-list .preview.h1 { font-size: 22px; font-weight: 700; }
.style-list .preview.h2 { font-size: 18px; font-weight: 700; }
.style-list .preview.h3 { font-size: 16px; font-weight: 700; }
.style-list .preview.h4 { font-size: 14px; font-weight: 700; }
.find-bar { display: flex; gap: 8px; align-items: center; padding: 8px 16px; background: #fff8e6; border-bottom: 1px solid #f0e0b2; }
.find-bar input { min-height: 32px; border: 1px solid var(--line); border-radius: 6px; padding: 0 8px; }
.wps-editor .editor-status { background: #f3f5f8; justify-content: flex-start; gap: 18px; }
.status-zoom { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.status-zoom button { width: 22px; height: 22px; border: 0; background: transparent; }
.status-zoom input { width: 90px; }
.save-state { font-size: 12px; color: var(--ok); white-space: nowrap; }
.mode-sheet .paper, .mode-grid .paper, .mode-form .paper { width: min(1100px, 100%); padding: 16px; font-family: var(--font); }
.sheet-grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
.sheet-grid td, .sheet-grid th { border: 1px solid #cfd6de; min-width: 88px; height: 28px; padding: 4px 6px; font-size: 13px; }
.mode-slides .paper { width: min(960px, 100%); min-height: 540px; padding: 48px 56px; }
.slide-deck { min-height: 100%; }
.slide { min-height: 420px; }
.mode-poster .paper { display: flex; flex-direction: column; justify-content: center; }
.wps-editor:not(.mode-slides):not(.mode-aippt) #btn-add-slide { display: none; }
.wps-title-right .share-wrap { position: relative; }
.wps-app-tile, .wps-nav-item, .wps-primary-btn, .wps-share-btn, .rbtn, .style-chip { cursor: pointer; }
@media (max-width: 960px) {
    .wps-shell { grid-template-columns: 1fr; }
    .wps-nav { display: flex; gap: 6px; overflow: auto; border-right: 0; border-bottom: 1px solid var(--line); }
    .wps-nav-item { width: auto; white-space: nowrap; }
    .wps-workspace { grid-template-columns: 1fr; }
    .style-panel { display: none; }
    .wps-editor .paper { padding: 28px 18px; min-height: 80vh; }
    .wps-brand-name { display: none; }
}

.smart-app {
    min-height: 100dvh;
    background: #fff;
}
.smart-toolbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2px;
    min-height: 48px;
    padding: 6px 160px 6px 16px;
    background: #fff;
    border-bottom: 1px solid #eceff3;
    box-shadow: 0 1px 0 rgba(31, 35, 41, 0.04);
}
.st-btn {
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    border-radius: 6px;
    color: #4e5560;
    display: inline-grid;
    place-items: center;
    position: relative;
}
.st-btn:hover, .st-btn.active { background: #f3f5f8; color: var(--ink); }
.st-split {
    width: 1px;
    height: 18px;
    background: #e5e7eb;
    margin: 0 6px;
}
.st-select {
    border: 0;
    background: transparent;
    min-height: 32px;
    border-radius: 6px;
    color: #4e5560;
    padding: 0 4px;
}
.st-select.sm { width: 56px; }
.st-insert {
    border: 0;
    background: transparent;
    color: #22c55e;
    font-weight: 600;
    min-height: 32px;
    padding: 0 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.st-insert:hover { background: #f0fdf4; }
.smart-toolbar-right {
    position: absolute;
    right: 16px;
    top: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.smart-page {
    width: min(760px, 100%);
    margin: 56px auto 96px;
    padding: 0 32px;
    position: relative;
}
.smart-title {
    width: 100%;
    border: 0;
    outline: none;
    background: transparent;
    font-size: 40px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--ink);
}
.smart-title::placeholder { color: #c5c9cf; }
.smart-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #8b9199;
    font-size: 13px;
    margin: 10px 0 28px;
}
.smart-body {
    min-height: 46vh;
    outline: none;
    font-size: 16px;
    line-height: 1.85;
    position: relative;
}
.smart-body h1 { font-size: 28px; font-weight: 700; margin: 0 0 14px; }
.smart-body h2 { font-size: 22px; font-weight: 700; margin: 22px 0 10px; }
.smart-body h3 { font-size: 18px; font-weight: 700; margin: 16px 0 8px; }
.smart-body p { margin: 0 0 12px; }
.smart-body img { max-width: 100%; height: auto; }
.smart-body table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.smart-body td, .smart-body th { border: 1px solid #e5e7eb; padding: 6px 8px; }
.smart-body:has(> p:only-child:empty)::before,
.smart-body:has(> br:only-child)::before {
    content: attr(data-placeholder);
    color: #b4b9c0;
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
}
.slash-menu {
    position: absolute;
    left: 32px;
    top: 180px;
    width: 220px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 6px;
    z-index: 30;
}
.slash-menu button {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 8px 10px;
    border-radius: 6px;
    min-height: 36px;
}
.slash-menu button:hover { background: #f3f5f8; }

.sheet-app {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: #f3f5f8;
    overflow: hidden;
}
.xls-chrome { background: var(--wps-chrome); border-bottom: 1px solid var(--line); }
.xls-menubar {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 10px;
    position: relative;
}
.xls-home, .xls-file {
    border: 0;
    background: transparent;
    min-height: 28px;
    padding: 0 8px;
    border-radius: 4px;
    color: var(--ink);
    text-decoration: none;
}
.xls-home:hover, .xls-file:hover { background: #fff; color: var(--ink); }
.xls-tabs { display: flex; align-items: center; gap: 2px; margin-left: 8px; }
.xls-tab {
    border: 0;
    background: transparent;
    min-height: 32px;
    padding: 0 12px;
    color: var(--ink-soft);
    position: relative;
}
.xls-tab.active { color: #1aad19; font-weight: 700; }
.xls-tab.active::after {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 0;
    height: 2px;
    background: #1aad19;
}
.xls-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.xls-share {
    border: 0;
    background: #1aad19;
    color: #fff;
    min-height: 28px;
    padding: 0 14px;
    border-radius: 6px;
    font-weight: 600;
}
.xls-share:hover { background: #159314; }
.xls-ribbon {
    display: flex;
    align-items: stretch;
    gap: 8px;
    padding: 6px 10px 8px;
    background: #fff;
    min-height: 72px;
}
.xls-title {
    margin-left: auto;
    border: 0;
    background: transparent;
    font-weight: 600;
    outline: none;
    min-width: 160px;
    text-align: right;
}
.xls-formula {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 4px 8px;
    background: #fff;
    border-bottom: 1px solid var(--line);
}
.xls-cell-name {
    width: 72px;
    height: 26px;
    border: 1px solid var(--line);
    border-radius: 4px;
    text-align: center;
    font-size: 13px;
}
.xls-fx { color: var(--muted); font-style: italic; font-weight: 700; }
.xls-fx-input {
    flex: 1;
    height: 26px;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 0 8px;
}
.xls-board {
    flex: 1;
    overflow: auto;
    background: #fff;
}
.xls-grid {
    display: grid;
    grid-template-columns: 46px repeat(var(--cols, 26), 100px);
    min-width: max-content;
}
.xls-corner, .xls-colh, .xls-rowh, .xls-cell {
    border-right: 1px solid #d7dee6;
    border-bottom: 1px solid #d7dee6;
    box-sizing: border-box;
}
.xls-corner, .xls-colh, .xls-rowh {
    background: #f3f5f8;
    color: #6b7380;
    font-size: 12px;
    display: grid;
    place-items: center;
    position: sticky;
    z-index: 2;
}
.xls-corner { top: 0; left: 0; z-index: 3; height: 24px; }
.xls-colh { top: 0; height: 24px; }
.xls-colh.on, .xls-rowh.on { background: #e8f6e8; color: #1aad19; font-weight: 700; }
.xls-rowh { left: 0; min-height: 24px; }
.xls-cell {
    min-height: 24px;
    padding: 1px 6px;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    position: relative;
}
.xls-cell.sel { background: #e8f6e8; }
.xls-cell.active {
    outline: 2px solid #1aad19;
    outline-offset: -2px;
    background: #fff;
    z-index: 1;
}
.xls-edit {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    outline: none;
    padding: 0 6px;
    font: inherit;
}
.xls-sheetbar {
    display: flex;
    align-items: center;
    min-height: 28px;
    padding: 0 8px;
    background: #f3f5f8;
    border-top: 1px solid var(--line);
}
.xls-sheets { display: flex; align-items: center; gap: 4px; }
.xls-sheet-tab {
    border: 1px solid transparent;
    background: transparent;
    min-height: 22px;
    padding: 0 12px;
    border-radius: 4px 4px 0 0;
    font-size: 12px;
}
.xls-sheet-tab.active {
    background: #fff;
    border-color: var(--line);
    border-bottom-color: #fff;
}
.xls-sheet-add {
    width: 22px;
    height: 22px;
    border: 0;
    background: transparent;
    border-radius: 4px;
}
.xls-sheet-add:hover { background: #fff; }

.share-app {
    min-height: 100dvh;
    background: #f7f8fa;
    color: var(--ink);
}
.share-chrome {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 16px;
    background: #f3f5f8;
    border-bottom: 1px solid var(--line);
}
.share-home, .share-icon-btn {
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    border-radius: 6px;
    color: var(--ink-soft);
    display: grid;
    place-items: center;
    text-decoration: none;
}
.share-home:hover, .share-icon-btn:hover { background: #fff; color: var(--ink); }
.share-head-title {
    font-weight: 600;
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.share-view-badge {
    font-size: 12px;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 2px 8px;
    background: #fff;
}
.share-chrome-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}
.share-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    min-height: calc(100dvh - 48px);
}
.share-toc {
    background: #fff;
    border-right: 1px solid var(--line);
    padding: 16px 12px;
}
.toc-tabs { display: flex; gap: 16px; padding: 0 8px 12px; }
.toc-tab { border: 0; background: transparent; color: var(--muted); padding: 0; }
.toc-tab.active {
    color: var(--ink);
    font-weight: 700;
    box-shadow: inset 0 -2px 0 var(--wps-blue);
}
.toc-empty { color: #c5c9cf; font-size: 13px; padding: 48px 8px; text-align: center; }
.toc-item {
    display: block;
    color: var(--ink-soft);
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 13px;
}
.toc-item:hover { background: #f3f5f8; color: var(--ink); }
.toc-item.lv-h1 { font-weight: 700; }
.toc-item.lv-h2 { padding-left: 18px; }
.toc-item.lv-h3 { padding-left: 28px; font-size: 12px; }
.share-article {
    overflow: auto;
    padding: 36px 8vw 80px;
}
.article-title {
    font-size: 36px;
    font-weight: 800;
    margin: 0 0 12px;
    max-width: 760px;
}
.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: #8b9199;
    font-size: 13px;
    margin-bottom: 24px;
}
.share-body {
    max-width: 760px;
    font-size: 16px;
    line-height: 1.85;
}
.share-body h1, .share-body h2, .share-body h3 { scroll-margin-top: 72px; }
.share-body img { max-width: 100%; height: auto; }
.share-body.sheet-read { max-width: none; overflow: auto; background: #fff; padding: 0; }
.share-sheet .share-layout { grid-template-columns: 1fr; }
.share-sheet .share-article { padding: 0; }
.share-sheet .sheet-grid td, .share-sheet .sheet-grid th {
    border: 1px solid #d7dee6;
    min-width: 88px;
    height: 24px;
    padding: 2px 6px;
    font-size: 13px;
}

@media (max-width: 900px) {
    .smart-toolbar { justify-content: flex-start; padding-right: 16px; }
    .smart-toolbar-right { position: static; width: 100%; justify-content: flex-end; }
    .smart-title { font-size: 28px; }
    .share-layout { grid-template-columns: 1fr; }
    .share-toc { display: none; }
    .article-title { font-size: 26px; }
    .xls-title { display: none; }
}
@media print {
    .smart-toolbar, .xls-chrome, .xls-formula, .xls-sheetbar, .share-chrome, .share-toc, .slash-menu { display: none !important; }
    .smart-page, .share-article { margin: 0; padding: 0; }
}
