:root {
    --main-bg: #f5faff;
    --banner-gradient: linear-gradient(90deg, #2196f3 0%, #26d9b2 100%);
    --banner-txt: #fff;
    --main-txt: #222;
    --border: #ff9800;
    --search-bg: #fff;
    --search-focus: #f4faff;
    --sense-bg: #fffbe6;
    --sense-border: #ff9800;
    --btn-bg: #2196f3;
    --btn-hover: #1769aa;
    --help-btn-bg: #ff9800;
    --help-btn-txt: #fff;
    --modal-blur: rgba(33,150,243,0.07);
    --accent: #ff9800;
    --highlight-bg: #fffde7;
    --highlight-txt: #e53935;
    --dynasty-bg: linear-gradient(90deg, #e3f2fd 0%, #fffbe6 100%);
    --dynasty-txt: #1976d2;
    --dynasty-txt-count: #5e6e7e;
    --footer-bg: #f3f8fd;
    --footer-txt: #888;
    --shadow: 0 4px 24px rgba(33,150,243,0.13);
}
body {
    font-family: 'Noto Sans SC', 'Noto Sans', 'Helvetica Neue', Arial, 'Microsoft YaHei', sans-serif;
    background: var(--main-bg);
    margin: 0;
    padding: 0;
    color: var(--main-txt);
    min-width: 400px;
}
body::before {
    content: "公开测试版 \A" attr(date);
    text-align: center;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-25deg);
    font-size: 5rem;
    color: rgba(33, 150, 243, 0.18); /* Adjust alpha for transparency */
    pointer-events: none; /* Allow clicks through watermark */
    z-index: 0;
    white-space: pre-wrap;
    user-select: none;
}
@media (max-width: 600px) {
    body::before {
        font-size: 2.5rem;
    }
}
header {
    background: var(--banner-gradient);
    color: var(--banner-txt);
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(33,150,243,0.08);
}
.banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
    max-width: 900px;
    margin: 0 auto;
}
.corpus-logo {
    width: 1.8rem;
    height: 1.8rem;
    vertical-align: middle;
    margin-right: 0.3rem;
}
.corpus-name {
    vertical-align: middle;
    font-size: 1.6rem;
    font-weight: 500;
    letter-spacing: 5px;
    white-space: nowrap;
    flex-shrink: 0;
    text-shadow: 0 1px 8px rgba(0,0,0,0.14);
}
.corpus-name-abbr {
    vertical-align: middle;
    font-size: 1.4rem;
    font-weight: 400;
    letter-spacing: 1px;
    white-space: nowrap;
    flex-shrink: 0;
    text-shadow: 0 1px 8px rgba(0,0,0,0.14);
}
.corpus-name-small {
    display: flex;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0px;
    /* white-space: nowrap; */
    flex-shrink: 0;
    text-shadow: 0 1px 8px rgba(0,0,0,0.14);
}
.banner-actions {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    flex-wrap: wrap;
}
/* Search in header */
.header-search-form {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    background: var(--search-bg);
    border-radius: 30px;
    padding: 0.4rem 0.4rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 6px rgba(33,150,243,0.18);
}
.header-search-form input[type="text"] {
    flex: 1 1 120px;
    border: none;
    background: transparent;
    padding: 0.55rem 0.8rem;
    font-size: 1.1rem;
    border-radius: 20px;
    outline: none;
    transition: width 0.2s, background 0.2s;
    color: var(--main-txt);
}
.header-search-form input[type="text"]:focus {
    background: var(--search-focus);
}
.header-search-form button {
    background: var(--btn-bg);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 0.4rem 1.2rem;
    font-size: 1.1rem;
    cursor: pointer;
    margin-left: 0.4rem;
    font-weight: bold;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 6px rgba(33,150,243,0.13);
}
.header-search-form button:hover,
.header-search-form button:focus {
    background: var(--btn-hover);
}
/* Help button */
.help-btn {
    background: var(--help-btn-bg);
    border: none;
    color: var(--help-btn-txt);
    font-size: 1.08rem;
    font-weight: bold;
    cursor: pointer;
    padding: 0.48rem 1.1rem;
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(255,152,0,0.14);
    transition: background 0.2s, color 0.2s;
}
.help-btn:focus,
.help-btn:hover {
    background: #f57c00;
    color: #fffde7;
}
/* Main container */
.container {
    min-height: 600px;
    max-width: 800px;
    margin: 2rem auto;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 3px 18px rgba(33,150,243,0.09);
    padding: 2rem 1.5rem;
}
.senses {
    margin-bottom: 2rem;
}
.word {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--accent);
    margin-bottom: 0.8rem;
}
.sense {
    margin: 1.1rem 0;
    padding: 0.5rem 1rem;
    border-left: 5px solid var(--sense-border);
    background: var(--sense-bg);
    border-radius: 7px;
    box-shadow: 0 2px 8px rgba(255,152,0,0.07);
}
.sense:hover {
    box-shadow: 0 4px 12px rgba(255,152,0,0.2);
}
.sense-title {
    font-weight: bold;
    color: var(--accent);
    font-size: 1.12rem;
}
.sense-desc {
    margin: 0 0 0 1rem;
    line-height: 1.78;
}
.sim-sense {
    margin-bottom: 0.7em;
    padding: 0.8em 0.2em;
    color: var(--dynasty-txt-count);
    font-weight: bold;
    font-size: 1.0rem;
    letter-spacing: 2px;
}
/* Dynasty heading */
.dynasty-heading {
    margin-bottom: 0.7em;
    margin-top: 0.7em;
    padding: 0.8em 0.0em;
    color: var(--dynasty-txt);
    font-size: 1.12em;
    font-weight: bold;
    letter-spacing: 2px;
}
.dynasty-heading-count {
    margin-left: 1em;
    color: var(--dynasty-txt-count);
    font-weight: bold;
    letter-spacing: 2px;
}
.cluster-heading {
    margin-bottom: 0.7em;
    margin-top: 0.7em;
    padding: 0.8em 0.0em;
    color: var(--dynasty-txt);
    font-size: 1.12em;
    font-weight: bold;
    letter-spacing: 2px;
}
.cluster-heading-center {
    color: var(--dynasty-txt-count);
    font-weight: bold;
    letter-spacing: 2px;
}
.cluster-text {
    margin-bottom: 1.1em;
    background: var(--sense-bg);
    border-left: 5px solid var(--sense-border);
    border-radius: 8px;
    padding: 1em 1.3em 0.8em 1.3em;
    box-shadow: 0 2px 10px rgba(255,152,0,0.09);
    font-size: 1.08em;
    line-height: 1.85;
    transition: box-shadow 0.2s;
    text-align: left;
}
.cluster-text:hover {
    box-shadow: 0 4px 18px rgba(255,152,0,0.18);
    background: #fffde7;
}
.cluster-word {
    color: var(--dynasty-txt);
}
.cluster-sense {
    color: #863939;
}
/* Text block */
.sense-text {
    margin-bottom: 1.1em;
    background: var(--sense-bg);
    border-left: 5px solid var(--sense-border);
    border-radius: 8px;
    padding: 1em 1.3em 0.8em 1.3em;
    box-shadow: 0 2px 10px rgba(255,152,0,0.09);
    font-size: 1.08em;
    line-height: 1.85;
    transition: box-shadow 0.2s;
    text-align: center;
}
.sense-text:hover {
    box-shadow: 0 4px 18px rgba(255,152,0,0.18);
    background: #fffde7;
}

/* Highlighted word */
.sense-text strong {
    color: var(--highlight-txt) !important;
    background: var(--highlight-bg) !important;
    font-weight: bold;
    border-radius: 4px;
    padding: 0 0.2em;
    box-shadow: 0 1px 4px #ffe08255;
    transition: background 0.2s;
}

/* Pagination */
.pagination {
    margin-top: 1.2em;
    text-align: center;
}
.pagination-text {
    font-size: 1.13em;
}
.pagination .help-btn {
    background: #1d8af7;
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 0.2em 0.5em;
    font-size: 1.13em;
    font-weight: 600;
    cursor: pointer;
    margin: 0 0.7em;
    box-shadow: 0 4px 16px rgba(25, 118, 210, 0.13);
    transition: background 0.18s, box-shadow 0.18s, transform 0.13s;
    letter-spacing: 1px;
    outline: none;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
}
.pagination .help-btn:hover,
.pagination .help-btn:focus {
    background: #127af1;
    color: #fffde7;
    box-shadow: 0 6px 24px rgba(25, 118, 210, 0.18);
    transform: translateY(-2px) scale(1.04);
}
.pagination .help-btn:active {
    background: #4288f0;
}
.toggleModeBtnDiv {
    text-align: right;
    padding-right: 1em;
}
.toggleModeBtn {
    background: #fff;
    color: #333;
    border: 1px solid #bbb;
    border-radius: 22px;
    padding: 0.25em 1em;
    font-size: 0.9em;
    font-weight: 500;
    margin-bottom: -2em;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(33,150,243,0.08);
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    outline: none;
}
.toggleModeBtn:hover, .toggleModeBtn:focus {
    background: #f5f5f5;
    border-color: #888;
    box-shadow: 0 4px 16px rgba(33,150,243,0.13);
}
canvas {
    width: 100% !important;
    max-width: 100%;
}
.no-result {
    color: #e53935;
    text-align: center;
    margin: 2rem 0;
    font-weight: bold;
}
/* Help Modal */
.modal-bg {
    display: none;
    position: fixed;
    z-index: 999;
    left: 0; top: 0; right: 0; bottom: 0;
    background: var(--modal-blur);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}
.modal-bg.active {
    display: flex;
}
.modal {
    background: #fff;
    border-radius: 14px;
    max-width: 340px;
    width: 95vw;
    padding: 1.6rem 1.3rem;
    box-shadow: 0 4px 22px rgba(255,152,0,0.26);
    position: relative;
    color: var(--main-txt);
    line-height: 1.8;
}
.modal-close {
    position: absolute;
    right: 1.1rem;
    top: 1rem;
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: #888;
}
.modal-close:hover {
    color: #e53935;
}
.modal-title {
    font-weight: bold;
    font-size: 1.21rem;
    margin-bottom: 0.75rem;
    color: var(--accent);
}
.footer {
    text-align: center;
    padding: 1.2rem 0;
    font-size: 0.98rem;
    color: var(--footer-txt);
    border-top: 1px solid rgba(33,150,243,0.1);
    border-radius: 0 0 18px 18px;
}
.initial-state {
    border-radius: 10px;
    padding: 1.2em 1.8em 1.0em 1.8em;
    margin: 1.0em auto 1em auto;
    max-width: 520px;
    color: #333;
    text-align: center;
    font-size: 1.08em;
    transition: box-shadow 0.2s;
}
.initial-state h2 {
    margin-top: 0;
    margin-bottom: 0.7em;
    color: #1976d2;
    font-size: 1.35em;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.initial-state h3 {
    margin-top: 0;
    margin-bottom: 0.7em;
    color: #000203;
    font-size: 1.0em;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.initial-state li {
    margin: 0.5em 0;
}
.initial-state ul {
    margin: 1.1em 0 0.2em 0;
    padding-left: 1.2em;
    text-align: left;
    color: #555;
    font-size: 0.98em;
}
.initial-state strong {
    color: #ff9800;
    font-weight: 500;
}
.initial-state p {
    margin-bottom: 0.7ema;
    text-align: left;
}
/* Responsive adjustments */
@media (max-width: 700px) {
    .banner { padding: 0.7rem 0.6rem; }
    .container { padding: 1.2rem 0.5rem; }
    .corpus-name { font-size: 1.15rem; }
}
@media (max-width: 500px) {
    .container { margin: 1rem 0 0 0; }
    .corpus-name {
        font-size: 1.02rem;
        letter-spacing: 1px;
    }
    .corpus-name-abbr {
        font-size: 1.1rem;
    }
    .corpus-name-small {
        font-size: 0.78rem;
    }
    .banner-actions {
        gap: 0rem;
    }
    /* .banner-actions { width: 100%; justify-content: flex-start; } */
}