﻿:root { --primary: #1a73e8; --line: #e5e7eb; --text: #1f2937; --sub: #6b7280; }
* { box-sizing: border-box; }
/* Reusable header and footer */
.home-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(229, 231, 235, 0.9);
    backdrop-filter: blur(10px);
}
.home-header-inner {
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
}
.brand img {
    width: 40px;
    height: 40px;
    border-radius: 5px;
}
.brand-copy {
    display: flex;
    flex-direction: column;
}
.brand-copy strong {
    font-size: 18px;
    line-height: 1.1;
}
.brand-copy span {
    color: var(--sub);
    font-size: 12px;
}
.header-nav {
    display: flex;
    gap: 20px;
}
.header-nav a {
    text-decoration: none;
    color: #4b5563;
    font-weight: 500;
}
.header-nav a:hover { color: var(--primary); }
.header-user { display: flex; align-items: center; }
.header-login {
    text-decoration: none;
    border: 1px solid #c6d9ff;
    background: #eef4ff;
    color: var(--primary);
    border-radius: 999px;
    font-size: 13px;
    padding: 8px 14px;
}
.header-avatar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #374151;
}
.header-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}
/* VIP 金色头像光环 + 角标 */
.header-avatar.is-vip img {
    box-shadow: 0 0 0 2px #f59e0b;
}
.header-avatar.is-vip::after {
    content: "VIP";
    position: absolute;
    top: -4px;
    right: -8px;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    padding: 2px 5px;
    border-radius: 6px;
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: #fff;
    box-shadow: 0 1px 4px rgba(245,158,11,.35);
    pointer-events: none;
}
.header-avatar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #374151;
    position: relative;
}
.home-footer {
    border-top: 1px solid var(--line);
    background: #fff;
}
.footer-top {
    padding: 22px 0 14px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
}
.footer-brand strong { font-size: 17px; }
.footer-brand p {
    margin: 8px 0 0;
    color: var(--sub);
    font-size: 13px;
    line-height: 1.7;
}
.footer-links {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 14px;
    flex-wrap: wrap;
}
.footer-links a {
    color: #4b5563;
    text-decoration: none;
    font-size: 13px;
}
.footer-links a:hover { color: var(--primary); }
.footer-bottom {
    border-top: 1px solid #eff2f6;
    color: #94a3b8;
    font-size: 12px;
    padding: 12px 0 20px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.footer-bottom a { color: #64748b; }
body {
    margin: 0;
    font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    color: var(--text);
    background: radial-gradient(circle at top, #e7f0ff 0%, #f5f8ff 42%, #f2f5fb 100%);
    scrollbar-width: thin;
    scrollbar-color: #c9d3e3 #f6f8fc;
}
.home-wrap { width: 1160px; max-width: calc(100% - 32px); margin: 0 auto; }
.hero { padding: 44px 0 18px; text-align: center; }
.hero h1 { margin: 12px 0; font-size: 36px; letter-spacing: -1px; }
.hero p { margin: 0 auto; max-width: 760px; color: var(--sub); font-size: 16px; line-height: 1.7; }
.hero-badge {
    display: inline-block;
    font-size: 13px;
    color: #3f6ed3;
    background: #eef4ff;
    border: 1px solid #dce7ff;
    border-radius: 999px;
    padding: 6px 12px;
}
.translate-menu {
    margin: 14px 0 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.translate-menu a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #4b5563;
    border: 1px solid #d7e3fb;
    background: #fff;
    border-radius: 999px;
    padding: 8px 13px;
    font-size: 13px;
    line-height: 1.2;
    transition: all .2s ease;
}
.menu-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #edf3ff;
    color: #3f6ed3;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.translate-menu a:hover {
    color: var(--primary);
    border-color: #bcd2fd;
    background: #f5f9ff;
    transform: translateY(-1px);
}
.translate-menu a.is-active {
    color: #fff;
    background: linear-gradient(120deg, #1a73e8 0%, #3f83ef 100%);
    border-color: transparent;
    box-shadow: 0 6px 14px rgba(26, 115, 232, 0.25);
}
.translate-menu a.is-active .menu-icon {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}
.panel {
    margin: 20px auto 34px;
    background: #fff;
    border: 1px solid #dfe3eb;
    border-radius: 14px;
    overflow: visible;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.08);
}
.panel-main {
    display: flex;
    flex-direction: column;
    border-radius: 0 0 14px 14px;
    overflow: hidden;
    background: #fff;
}
.panel-main .action {
    order: 1;
    border-top: 0;
    border-bottom: 1px solid #eef2f7;
}
.panel-main .edit-row {
    order: 2;
}
.lang-row {
    position: relative;
    padding: 0 18px;
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-columns: 1fr 44px 1fr;
    gap: 12px;
    align-items: center;
    min-height: 62px;
    background: #fff;
}
.lang-picker { position: static; }
.lang-trigger {
    width: 100%;
    min-height: 44px;
    border: 0;
    border-radius: 10px;
    padding: 10px 14px;
    background: #f8fafd;
    color: #334155;
    font-size: 15px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}
.lang-trigger:hover { background: #f2f6fd; }
.lang-label {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lang-panel {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: calc(100% + 8px);
    z-index: 40;
    width: 1080px;
    max-width: min(calc(100vw - 48px), 1080px);
    border: 1px solid #d7deed;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.14);
    overflow: hidden;
}
.lang-picker[data-role="target"] .lang-panel {
    right: auto;
    left: 50%;
}
.lang-search-wrap {
    position: relative;
    padding: 10px;
    border-bottom: 1px solid #edf0f6;
    background: #fbfcff;
}
.lang-search {
    width: 100%;
    border: 1px solid #d8dfef;
    border-radius: 8px;
    padding: 8px 34px 8px 10px;
    font-size: 13px;
    color: #334155;
    outline: none;
    background: #fff;
}
.lang-search:focus {
    border-color: #8ab6ff;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.12);
}
.lang-search-clear {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 0;
    border-radius: 50%;
    background: #eef2f7;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.lang-search-clear:hover { background: #dde6f4; }
.lang-search-clear::before,
.lang-search-clear::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 12px;
    height: 1.5px;
    background: #64748b;
    border-radius: 1px;
    transform-origin: center;
}
.lang-search-clear::before { transform: translate(-50%, -50%) rotate(45deg); }
.lang-search-clear::after { transform: translate(-50%, -50%) rotate(-45deg); }
.lang-search-clear:hover::before,
.lang-search-clear:hover::after { background: #334155; }
.lang-subtitle {
    margin: 0;
    padding: 10px 12px 6px;
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
}
.lang-recent-wrap { border-bottom: 1px solid #edf0f6; }
.lang-recent {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 12px 10px;
}
.lang-chip {
    border: 1px solid #d4def3;
    background: #f7faff;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    color: #334155;
    cursor: pointer;
}
.lang-chip:hover {
    border-color: #9dc0ff;
    color: #1a73e8;
    background: #edf4ff;
}
.lang-list {
    max-height: none;
    overflow: visible;
    padding: 6px 0;
}
.lang-list-wrap .lang-list { padding: 6px 8px 10px; }
.lang-list-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 4px;
}
.lang-option {
    display: block;
    width: auto;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 8px 8px;
    font-size: 13px;
    color: #1f2937;
    cursor: pointer;
    border-radius: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lang-option:hover { background: #f5f8ff; }
.lang-option.is-selected {
    color: #1a73e8;
    background: #edf4ff;
    font-weight: 600;
}
.lang-empty {
    margin: 0;
    padding: 8px 12px 12px;
    font-size: 12px;
    color: #94a3b8;
}
.swap-btn {
    width: 38px;
    height: 38px;
    border: 1px solid #d7ddea;
    border-radius: 50%;
    background: #fff;
    color: #5b6578;
    font-size: 18px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}
.swap-btn:hover { background: #f8faff; color: var(--primary); }
.edit-row { display: grid; grid-template-columns: 1fr 1fr; min-height: 340px; }
.col { padding: 18px 20px; min-height: 300px; background: #fff; }
.col-orig { position: relative; }
.col + .col { border-left: 1px solid #eceff5; }
.orig-clear-icon {
    position: absolute;
    right: 18px;
    top: 14px;
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 50%;
    background: #eef2f7;
    cursor: pointer;
    padding: 0;
    z-index: 2;
}
.orig-clear-icon::before,
.orig-clear-icon::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 12px;
    height: 1.5px;
    background: #64748b;
    border-radius: 1px;
}
.orig-clear-icon::before { transform: translate(-50%, -50%) rotate(45deg); }
.orig-clear-icon::after { transform: translate(-50%, -50%) rotate(-45deg); }
.orig-clear-icon:hover { background: #dde6f4; }
.orig-clear-icon:hover::before,
.orig-clear-icon:hover::after { background: #334155; }
textarea {
    width: 100%;
    min-height: 255px;
    border: 0;
    resize: none;
    outline: none;
    font-size: 22px;
    line-height: 1.5;
    color: #1f2937;
    background: transparent;
    overflow-y: hidden;
}
textarea::placeholder { color: #9aa4b2; }
#trans { color: #0f172a; }
.tools { margin-top: 8px; display: flex; justify-content: space-between; align-items: center; }
.count { color: #9ca3af; font-size: 12px; }
.result-translit-wrap {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #475569;
    font-size: 13px;
}
.result-translit-label {
    color: #64748b;
    background: #f1f5f9;
    border-radius: 999px;
    padding: 2px 8px;
}
.result-translit-text {
    color: #0f172a;
}
.result-pos-wrap {
    margin-top: 12px;
    border-top: 1px solid #edf1f7;
    padding-top: 10px;
}
.result-alt-wrap {
    margin-top: 12px;
    border-top: 1px solid #edf1f7;
    padding-top: 10px;
}
.result-extra-wrap {
    margin-top: 12px;
    border-top: 1px solid #edf1f7;
    padding-top: 10px;
}
.result-pos-title {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}
.result-kv-text {
    font-size: 13px;
    color: #334155;
    line-height: 1.6;
}
.result-pos-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.result-bullet-list {
    margin: 0;
    padding-left: 18px;
    color: #334155;
    font-size: 13px;
    line-height: 1.65;
}
.result-bullet-list li + li { margin-top: 4px; }
.pos-item {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.pos-label {
    min-width: 42px;
    font-size: 12px;
    color: #64748b;
    line-height: 1.9;
}
.pos-terms {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.pos-term {
    display: inline-flex;
    align-items: center;
    border: 1px solid #d8e5fb;
    background: #f7fbff;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    color: #1e293b;
    line-height: 1.3;
}
.result-alt-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.alt-term {
    display: inline-flex;
    align-items: center;
    border: 1px solid #d8e5fb;
    background: #f7fbff;
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 12px;
    color: #1e293b;
    line-height: 1.3;
}
.result-rich-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.result-rich-item {
    border: 1px solid #e7edf7;
    border-radius: 8px;
    padding: 8px;
    background: #fcfdff;
}
.result-rich-pos {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 6px;
}
.result-def-entry + .result-def-entry {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #e7edf7;
}
.result-def-gloss {
    margin: 0;
    font-size: 13px;
    color: #334155;
    line-height: 1.55;
}
.result-def-example {
    margin: 4px 0 0;
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
}
.btn-lite {
    border: 1px solid #d6e1f8;
    border-radius: 8px;
    background: #fff;
    padding: 6px 12px;
    font-size: 12px;
    color: #55637f;
    cursor: pointer;
    transition: all .2s ease;
}
.btn-lite:hover { background: #f6f9ff; color: #3f6ed3; }
.action {
    padding: 12px 16px 16px;
    text-align: center;
    border-top: 1px solid #eef2f7;
    background: #fafcff;
}
.btn-main {
    border: 0;
    border-radius: 8px;
    min-width: 210px;
    padding: 10px 20px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    background: #1a73e8;
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-main:hover { filter: brightness(1.03); }
.btn-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #ffffff;
    border-radius: 50%;
    display: none;
}
.btn-main.is-loading .btn-spinner {
    display: inline-block;
    animation: btn-spin .8s linear infinite;
}
@keyframes btn-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.panel { margin-bottom: 40px; }

.global-toast {
    position: fixed;
    left: 50%;
    bottom: 32px;
    transform: translateX(-50%) translateY(8px);
    min-width: 140px;
    max-width: calc(100vw - 40px);
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.88);
    color: #fff;
    font-size: 13px;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    z-index: 9999;
    transition: opacity .2s ease, transform .2s ease;
}
.global-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.global-toast.type-success { background: rgba(16, 185, 129, 0.92); }
.global-toast.type-error { background: rgba(239, 68, 68, 0.92); }
.global-toast.type-warning { background: rgba(245, 158, 11, 0.94); }

/* Premium scrollbar */
html::-webkit-scrollbar,
body::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
    background: #f6f8fc;
}
html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
    background: #c9d3e3;
    border-radius: 999px;
    border: 2px solid #f6f8fc;
}
html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover {
    background: #bcc9dc;
}

textarea {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e4 #f8fafd;
}
textarea::-webkit-scrollbar {
    width: 8px;
}
textarea::-webkit-scrollbar-track {
    background: #f8fafd;
    border-radius: 999px;
}
textarea::-webkit-scrollbar-thumb {
    background: #cbd5e4;
    border-radius: 999px;
    border: 1px solid #f8fafd;
}
textarea::-webkit-scrollbar-thumb:hover {
    background: #c1cfe1;
}

@media (max-width: 992px) {
    .header-nav { display: none; }
    .footer-top { flex-direction: column; }
    .footer-links { justify-content: flex-start; }
    .hero h1 { font-size: 36px; }
    .translate-menu a { font-size: 12px; }
    .edit-row { grid-template-columns: 1fr; }
    .col + .col { border-left: 0; border-top: 1px solid var(--line); }
    textarea { font-size: 18px; height: 210px; }
    .lang-row { grid-template-columns: 1fr; gap: 10px; padding: 10px 12px; }
    .swap-btn {
        justify-self: center;
        width: 34px;
        height: 34px;
    }
    .lang-trigger { font-size: 14px; min-height: 40px; padding: 8px 10px; }
    .lang-panel {
        width: min(92vw, 560px);
        max-width: min(92vw, 560px);
        left: 50%;
        transform: translateX(-50%);
        max-height: 72vh;
        display: flex;
        flex-direction: column;
    }
    .lang-picker[data-role="target"] .lang-panel { left: 50%; }
    .lang-list {
        max-height: 48vh;
        overflow: auto;
    }
    .lang-list-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
