html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}
body {
    background: #f1f5f9;
    overflow: hidden;
    font-family: "Microsoft YaHei", "Segoe UI", "PingFang SC", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}
*, *::before, *::after {
    box-sizing: border-box;
}
input, textarea, select, [contenteditable], [contenteditable="true"] {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
    font-family: inherit;
}
button, .btn, .nav, .menu, .logo, .hamburger, .top-header, .footer, .no-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 10px; }
::-webkit-scrollbar-track { background: #f1f5f9; }

.top-header {
    position: fixed; 
    top:0; 
    left:0; 
    width:100%; 
    height:65px;
    background: #1e293b;
    padding:0 24px; 
    display:flex; 
    align-items:center; 
    justify-content:space-between;
    z-index:999; 
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transform: translateZ(0);
}
.hamburger { 
    display:none; 
    color:#fff; 
    font-size:22px; 
    margin-right:16px; 
    cursor:pointer; 
    transition: color 0.2s ease;
    background: none;
    border: none;
    padding: 0;
}
.hamburger:hover {
    color: #38bdf8;
}
.logo { 
    color:#fff; 
    font-size:20px; 
    font-weight:600;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.logo i {
    color: #38bdf8;
}
.user-area { 
    display:flex; 
    align-items:center; 
    gap:18px; 
}
.user-info { 
    color:#e2e8f0; 
    font-size:14px; 
    font-weight: 500;
}
.user-btn {
    padding:7px 14px; 
    border-radius:6px; 
    border:none;
    background:#0ea5e9; 
    color:#fff; 
    cursor:pointer; 
    font-size:14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}
.user-btn:hover { 
    background:#0284c7; 
}

.msg-container { 
    position:relative; 
    cursor:pointer; 
}
.msg-icon { 
    color:#e2e8f0; 
    font-size:20px; 
    transition: color 0.2s ease;
}
.msg-container:hover .msg-icon {
    color: #38bdf8;
}
.msg-badge {
    position:absolute;
    top:-5px;
    right:-5px;
    min-width:18px;
    height:18px;
    padding:0 5px;
    background:#ef4444;
    color:#fff;
    font-size:11px;
    border-radius:10px;
    display:none;
    align-items:center;
    justify-content:center;
    font-weight: bold;
    line-height:1;
}
.msg-badge.show {
    display:flex;
}
.msg-panel {
    position:absolute; 
    top:60px; 
    right:0; 
    width:360px; 
    background:#ffffff;
    border-radius:10px; 
    z-index:1000; 
    display:none; 
    max-height:420px; 
    overflow-y:auto;
    border: 1px solid #e2e8f0;
}
.msg-panel-header { 
    padding:14px 16px; 
    border-bottom:1px solid #f1f5f9; 
    display:flex; 
    justify-content:space-between;
    font-weight: 500;
    color: #1e293b;
}
.msg-empty { 
    padding:40px; 
    text-align:center; 
    color:#94a3b8; 
}

.left-nav {
    position:fixed; 
    top:65px; 
    left:0; 
    width:220px;
    height:calc(100vh - 65px);
    background: #1e293b;
    overflow-y:auto;
    padding:20px 0;
    z-index:998;
    transition: transform 0.25s ease-out;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    -webkit-overflow-scrolling: touch;
}

.nav-title { 
    color:#ffffff; 
    padding:0 20px 12px; 
    margin:0 12px 16px; 
    border-bottom:1px solid rgba(255,255,255,0.1);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.nav-list { 
    list-style:none; 
}
.nav-item a {
    display:flex; 
    align-items:center; 
    padding:13px 20px; 
    margin:4px 12px;
    color:#ffffff; 
    text-decoration:none; 
    border-radius:8px; 
    transition: background-color 0.2s ease, border-color 0.2s ease;
    font-weight: 500;
    font-size: 14px;
    border: 1px solid transparent;
    cursor: pointer;
}
.nav-item a i { 
    margin-right:11px; 
    width:18px; 
    text-align:center; 
    font-size: 16px;
    color: #a5b4fc;
    transition: color 0.2s ease;
}
.nav-item a:hover { 
    background:rgba(255,255,255,0.1); 
    color:#ffffff; 
    border-color: rgba(255,255,255,0.15);
}
.nav-item a:hover i {
    color: #38bdf8;
}
.nav-item a.active { 
    background:#0ea5e9; 
    color:#ffffff; 
    border: 1px solid rgba(255,255,255,0.2);
}
.nav-item a.active i {
    color: #ffffff !important;
}
.nav-item a.no-auth { 
    background:rgba(255,255,255,0.05); 
    color:#94a3b8; 
    cursor:not-allowed; 
    pointer-events:none;
}
.nav-item a.no-auth i {
    color: #94a3b8 !important;
}
.dropdown { 
    position:relative; 
}
.dropdown-menu {
    display: none; 
    list-style: none; 
    background: rgba(255,255,255,0.05);
    margin: 0 12px; 
    padding: 6px 0; 
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.08);
}
.dropdown.active .dropdown-menu { 
    display: block; 
}
.dropdown-menu li a {
    padding: 10px 20px;
    margin: 2px 8px;
    font-size: 13px;
    color: #e2e8f0;
}
.dropdown-menu li a i {
    color: #94a3b8;
}

.right-content {
    position:fixed;
    top:65px;
    left:220px;
    right:0;
    width:auto;
    height:calc(100vh - 65px);
    background: #f1f5f9;
}
.content-iframe { 
    width:100%; 
    height:100%; 
    border:none; 
    background:#ffffff; 
    display:none;
    visibility: hidden;
    opacity: 0;
}
.content-iframe.loaded {
    visibility: visible;
    opacity: 1;
}
.overlay {
    display:none;
    position:fixed;
    top:65px;
    left:0;
    width:100%;
    height:calc(100vh - 65px);
    background:rgba(0,0,0,0.35);
    z-index:997;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.modal-box {
    width: 90%;
    max-width: 420px;
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    position: relative;
    border: 1px solid rgba(0,0,0,0.1);
}
.modal-close {
    position: absolute;
    right: 18px;
    top: 14px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    transition: color 0.2s ease;
}
.modal-close:hover {
    color: #333;
}
.modal-title {
    text-align: center;
    margin-bottom: 24px;
    font-size: 20px;
    color: #333;
}
.form-item {
    margin-bottom: 18px;
}
.form-item label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #333;
}
.form-item input,
.form-item textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}
.form-item input:focus,
.form-item textarea:focus {
    border-color: #0ea5e9;
}
.form-item textarea {
    min-height: 90px;
    resize: none;
}
.code-row {
    display: flex;
    gap: 10px;
    align-items: center;
}
#codeCanvas {
    width: 150px;
    height: 50px;
    border-radius: 10px;
    cursor: pointer;
    border: 1px solid #e2e8f0;
    background: transparent;
    transition: border-color 0.24s ease;
}
#codeCanvas:hover {
    border-color: #0ea5e9;
}
.modal-btn {
    width: 100%;
    padding: 13px;
    background: #0ea5e9;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    margin-top: 10px;
    transition: background-color 0.25s ease;
}
.modal-btn:hover {
    background: #0284c7;
}
.modal-switch {
    text-align: center;
    margin-top: 18px;
    font-size: 13px;
    color: #666;
}
.modal-switch span {
    color: #0ea5e9;
    cursor: pointer;
    transition: color 0.2s ease;
}
.modal-switch span:hover {
    color: #0284c7;
}
.forgot-pwd {
    text-align: right;
    font-size: 13px;
    color: #0ea5e9;
    cursor: pointer;
    margin-bottom: 10px;
    transition: color 0.2s ease;
}
.forgot-pwd:hover {
    color: #0284c7;
}
.send-msg-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}
.send-msg-box {
    background: #fff;
    width: 90%;
    max-width: 500px;
    padding: 30px;
    border-radius: 16px;
    border: 1px solid rgba(0,0,0,0.1);
}
.send-msg-btn-group {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}
.send-msg-btn {
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s ease;
}
.btn-cancel {
    background: #f1f5f9;
}
.btn-cancel:hover {
    background: #e2e8f0;
}
.btn-confirm {
    background: #0ea5e9;
    color: #fff;
}
.btn-confirm:hover {
    background: #0284c7;
}

.site-footer {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 38px;
    line-height: 38px;
    background: #1e293b;
    border-top: 1px solid rgba(255,255,255,0.05);
    text-align: center;
    font-size: 13px;
    color: #e2e8f0;
    z-index: 99;
}
.site-footer a {
    color: #e2e8f0;
    text-decoration: none;
    margin-left: 10px;
}
.site-footer a:hover {
    color: #38bdf8;
}
.site-footer img {
    height: 16px;
    vertical-align: middle;
    margin-right: 4px;
}
.site-footer .policy-link {
    color: #94a3b8;
    cursor: pointer;
    margin-left: 10px;
    transition: color 0.2s ease;
}
.site-footer .policy-link:hover {
    color: #38bdf8;
}

.policy-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}
.policy-modal.active {
    display: flex;
}
.policy-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15,23,42,0.85);
}
.policy-box {
    position: relative;
    width: 720px;
    max-width: 92vw;
    height: 80vh;
    max-height: 85vh;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    border-radius: 16px;
    border: 1px solid rgba(14,165,233,0.3);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.policy-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    background: linear-gradient(90deg, rgba(14,165,233,0.15) 0%, rgba(99,102,241,0.15) 100%);
    border-bottom: 1px solid rgba(14,165,233,0.25);
    position: relative;
    flex-shrink: 0;
}
.policy-header h3 {
    font-size: 18px;
    font-weight: 600;
    background: linear-gradient(135deg, #67e8f9 0%, #38bdf8 50%, #6366f1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}
.policy-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(148,163,184,0.1);
    border: none;
    color: #94a3b8;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.policy-close:hover {
    background: rgba(239,68,68,0.2);
    color: #ef4444;
}
.policy-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px;
    color: #cbd5e1;
    font-size: 14px;
    line-height: 1.8;
    -webkit-overflow-scrolling: touch;
}
.policy-content::-webkit-scrollbar {
    width: 6px;
}
.policy-content::-webkit-scrollbar-track {
    background: rgba(30,41,59,0.5);
}
.policy-content::-webkit-scrollbar-thumb {
    background: rgba(14,165,233,0.4);
    border-radius: 3px;
}
.policy-content h4 {
    color: #e2e8f0;
    font-size: 16px;
    font-weight: 600;
    margin: 24px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(14,165,233,0.2);
}
.policy-content h4:first-child {
    margin-top: 0;
}
.policy-content p {
    margin: 10px 0;
    color: #94a3b8;
}
.policy-content ul {
    margin: 10px 0;
    padding-left: 20px;
    color: #94a3b8;
}
.policy-content ul li {
    margin: 6px 0;
}
.policy-content strong {
    color: #cbd5e1;
    font-weight: 600;
}
.policy-content .update-time {
    color: #64748b;
    font-size: 13px;
    margin-bottom: 20px;
    padding: 10px 14px;
    background: rgba(14,165,233,0.08);
    border-radius: 8px;
    border-left: 3px solid #0ea5e9;
}
.license-info{
    background:rgba(30,41,59,0.6);
    border:1px solid rgba(14,165,233,0.2);
    border-radius:12px;
    padding:24px;
    margin-bottom:20px;
}
.license-info h4{
    color:#38bdf8;
    font-size:18px;
    text-align:center;
    margin:0 0 20px;
    padding-bottom:12px;
    border-bottom:2px solid rgba(14,165,233,0.3);
}
.license-row{
    display:flex;
    padding:10px 0;
    border-bottom:1px dashed rgba(148,163,184,0.15);
}
.license-row:last-child{
    border-bottom:none;
}
.license-label{
    width:120px;
    flex-shrink:0;
    color:#64748b;
    font-weight:500;
}
.license-value{
    flex:1;
    color:#e2e8f0;
    word-break:break-all;
}
.license-tip{
    text-align:center;
    color:#64748b;
    font-size:13px;
    margin-top:16px;
    padding-top:16px;
    border-top:1px solid rgba(148,163,184,0.15);
}
.license-img-wrap{
    text-align:center;
    margin:20px 0;
}
.license-img-wrap img{
    max-width:100%;
    border-radius:8px;
    border:1px solid rgba(14,165,233,0.3);
}

@media (max-width: 768px) {
    .policy-box {
        width: 95vw;
        height: 85vh;
        max-height: 88vh;
    }
    .policy-content {
        padding: 16px 18px;
    }
    .license-row{
        flex-direction:column;
        gap:4px;
    }
    .license-label{
        width:auto;
    }
}

body.project-mode .left-nav {
    transform: translateX(-100%);
}
body.project-mode .right-content { left: 0; }
body.project-mode .hamburger { display: none !important; }

@media (max-width:768px) {
    .hamburger { display:block; }
    .left-nav { transform: translateX(-100%); }
    .left-nav.open { transform: translateX(0); }
    .right-content { left:0; }
    .overlay.open { display:block; }
    .msg-panel { width:280px; }
    .logo {
        display: flex !important;
        font-size: 16px;
    }
    .logo span { display: none; }
    .user-area { gap:10px; }
    .user-info { font-size:12px; max-width:100px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
    .user-btn { font-size:12px; padding:4px 10px; }
}
