* { margin: 0; padding: 0; box-sizing: border-box; overflow-anchor: none; }
body { font-family: "HarmonyOS Sans", "HarmonyOS Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: #f0f2f5; }
.app-container { display: flex; height: 100vh; overflow: hidden; }

/* 左侧边栏 - 草绿色 */
.sidebar {
    width: 260px;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    background: #43a047;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    overflow: hidden;
    z-index: 10;
}
/* 运行在exe(有28px自绘标题栏)时，侧栏从标题栏下方开始 */
body.dt-shell .sidebar { top: 28px; }
.site-title {
    font-size: 26px;
    font-weight: bold;
    text-align: center;
    padding: 30px 20px;
    margin-bottom: 20px;
    width: 100%;
    color: #ffffff;
    border-bottom: none;
    background-image: linear-gradient(to right, #ffffff, #ffffff);
    background-repeat: no-repeat;
    background-position: center bottom;
    background-size: calc(100% - 40px) 2px;
}
.sidebar-nav {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 20px;
    width: 100%;
    align-items: center;
}
.nav-item {
    display: block;
    padding: 12px 16px;
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    transition: 0.2s;
    font-size: 16px;
    text-align: center;
    width: 100%;
}
.nav-item:hover{
    background: #81c784;
}
.logout-btn {
    flex-shrink: 0;
    padding: 16px 22px;
    text-align: left;
    border-top: none;
    margin-top: auto;
    width: 100%;
    position: relative;
}
.settings-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    border-radius: 8px;
    line-height: 0;
}
.settings-btn:hover { background: rgba(255,255,255,0.15); }
.settings-menu {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 140px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.18);
    padding: 6px;
    z-index: 20;
}
.settings-menu a {
    display: block;
    padding: 11px 16px;
    color: #333333;
    text-decoration: none;
    font-size: 14px;
    border-radius: 8px;
    text-align: center;
}
.settings-menu a:hover { background: #f1f3f5; color: #333333; }
.main-content {
    flex: 1;
    min-width: 0;
    overflow-anchor: none;
    margin-left: 260px;
    padding: 30px 40px;
    background: #ffffff;
    overflow-y: auto;
    height: 100vh;
    box-shadow: -2px 0 10px rgba(0,0,0,0.05);
}
/* exe 下主体高度扣除28px标题栏 */
body.dt-shell .main-content { height: calc(100vh - 28px); }

/* 页面标题与搜索框间距 */
.main-content h1 {
    margin-bottom: 25px;
}

.search-bar { margin-bottom: 20px; }
.search-bar form { display: flex; gap: 10px; align-items: center; }
.search-bar input { flex: 1; padding: 8px 12px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; }
.search-bar button { padding: 8px 16px; background: #43a047; color: white; border: none; border-radius: 6px; cursor: pointer; text-decoration: none; }
.search-bar button:hover { background: #388e3c; }
.clear-btn { padding: 8px 16px; background: #6c757d; color: white; border: none; border-radius: 6px; cursor: pointer; text-decoration: none; }

/* 保存/保存修改 主按钮 */
.save-btn { background: #43a047; color: #fff; border: none; padding: 8px 20px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.save-btn:hover { background: #388e3c; }
.note-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.note-table th, .note-table td { padding: 12px 8px; text-align: left; border-bottom: 1px solid #ddd; }
.note-table th { background: #f8f9fa; font-weight: 600; }
.note-table tr:hover { background: #f1f3f5; }
.note-table td a { color: #2c3e50; text-decoration: none; }
.note-table td a:hover { color: #3498db; text-decoration: underline; }
.no-result { margin-top: 20px; color: #6c757d; }
.login-container { display: flex; justify-content: center; align-items: center; min-height: 100vh; background: #e9ecef; }
.login-box { background: white; padding: 40px; border-radius: 16px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); width: 360px; text-align: center; }
.login-box h2 { margin-bottom: 30px; color: #2c3e50; }
.input-group { margin-bottom: 20px; text-align: left; }
.input-group label { display: block; margin-bottom: 6px; font-weight: 500; }
.input-group input { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 6px; }
.login-btn { width: 100%; padding: 10px; background: #388e3c; color: white; border: none; border-radius: 6px; cursor: pointer; }
.login-btn:hover { background: #2e7d32; }
.error-msg { color: #e74c3c; margin-bottom: 15px; }
@media (max-width: 700px) { .sidebar { width: 80px; } .site-title { font-size: 16px; padding: 20px 5px; } .nav-item { text-align: center; font-size: 12px; padding: 10px 5px; } .main-content { padding: 15px; } }

/* ===== 标签样式 ===== */
.tag-link {
    display: inline-block;
    background: #e8f5e9;
    color: #2e7d32;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    margin: 2px 4px 2px 0;
    text-decoration: none;
    border: 1px solid #c8e6c9;
}
.tag-link:hover {
    background: #c8e6c9;
    text-decoration: none;
}

.no-tag {
    color: #bbb;
    font-size: 12px;
}

.tag-filter-bar {
    margin-bottom: 15px;
    padding: 10px;
    background: #f1f8e9;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.tag-filter-bar .tag {
    background: #2e7d32;
    color: white;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 13px;
}

/* 标签输入框提示 */
.tag-hint {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}
/* ===== 详情页正文铺满右侧宽度(2026-08-31) ===== */
.print-area { width: 100% !important; box-sizing: border-box; }
.note-content {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    overflow-wrap: break-word;
}
.note-content img, .note-content table, .note-content video, .note-content iframe {
    max-width: 100%;
}
