:root { 
    --primary: #16697a; 
    --primary-hover: #104f5c;
    --accent: #ede134;
    --danger: #d32f2f;
    --danger-hover: #b71c1c;
    --bg: #f4f6f8; 
    --surface: #ffffff;
    --text: #333333; 
    --border: #e0e0e0;
}

* { box-sizing: border-box; }

body { 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
    margin: 0; 
    background: var(--bg); 
    color: var(--text); 
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.svg-icon {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    flex-shrink: 0;
}

.header {
    background: var(--surface);
    padding: 12px 30px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand { 
    font-size: 1.4rem; 
    font-weight: bold; 
    color: var(--primary); 
    text-decoration: none; 
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand svg {
    width: 28px;
    height: 28px;
    border-radius: 4px;
}

.search-box {
    display: flex;
    gap: 8px;
    flex: 1;
    max-width: 500px;
}

.search-box input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95rem;
}

.header-user-area {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.layout {
    max-width: 1100px;
    margin: 30px auto;
    padding: 0 20px;
    display: flex;
    gap: 30px;
    flex: 1;
    width: 100%;
}

.article-layout {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 20px;
    display: flex;
    gap: 25px;
    align-items: flex-start;
    flex: 1;
    width: 100%;
}

.sidebar-left {
    width: 220px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-left .action-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.sidebar-left .action-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.main-content { 
    flex: 1;
    background: var(--surface); 
    padding: 35px; 
    border-radius: 8px; 
    border: 1px solid var(--border);
}

.knowledge-panel {
    width: 320px;
    flex-shrink: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
}

.knowledge-panel h3 {
    margin-top: 0;
    font-size: 1.1rem;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 8px;
    color: var(--primary);
}

.kp-image {
    width: 100%;
    border-radius: 6px;
    object-fit: cover;
    max-height: 220px;
    margin-bottom: 15px;
    border: 1px solid var(--border);
}

.kp-section {
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.kp-section strong {
    display: block;
    color: var(--primary);
    margin-bottom: 4px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kp-list {
    margin: 0;
    padding-left: 18px;
    font-size: 0.9rem;
}

.kp-list li {
    margin-bottom: 4px;
}

.kp-list a {
    color: var(--primary);
    text-decoration: none;
}

.kp-list a:hover {
    text-decoration: underline;
}

.knowledge-panel input[type="file"],
.knowledge-panel textarea,
.knowledge-panel input[type="text"],
.form-control {
    width: 100%;
    padding: 9px 12px;
    margin-top: 4px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.95rem;
    font-family: inherit;
    background: #fafafa;
}

.knowledge-panel textarea {
    height: 75px;
    resize: vertical;
}

.knowledge-panel label, .form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

h1 { 
    border-bottom: 2px solid var(--border); 
    padding-bottom: 10px; 
    margin-top: 0; 
    font-size: 1.8rem;
}

.content-box { 
    line-height: 1.7; 
    font-size: 1.05rem; 
    min-height: 180px; 
}

.content-box img {
    max-width: 100%;
    border-radius: 6px;
    border: 1px solid var(--border);
    margin: 15px 0;
}

.content-box h2 { margin-top: 25px; border-bottom: 1px solid var(--border); padding-bottom: 5px; }
.content-box h3 { margin-top: 20px; }
.content-box blockquote {
    border-left: 4px solid var(--primary);
    margin: 15px 0;
    padding-left: 15px;
    color: #555;
}

.article-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.article-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.article-list a {
    color: var(--primary);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
}

.article-list a:hover { text-decoration: underline; }

.toolbar { 
    margin-top: 30px; 
    padding-top: 20px; 
    border-top: 1px solid var(--border); 
    display: flex; 
    gap: 12px; 
    flex-wrap: wrap;
}

button, .btn { 
    background: var(--primary); 
    color: white; 
    border: none; 
    padding: 9px 18px; 
    border-radius: 4px; 
    cursor: pointer; 
    text-decoration: none; 
    font-weight: bold; 
    font-size: 0.9rem; 
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

button:hover, .btn:hover { background: var(--primary-hover); }

.btn-secondary { background: #e0e0e0; color: #333; }
.btn-secondary:hover { background: #bdbdbd; }

.btn-danger { background: var(--danger); }
.btn-danger:hover { background: var(--danger-hover); }

.history-item { padding: 15px 0; border-bottom: 1px solid var(--border); }
.history-date { font-weight: bold; color: var(--primary); display: block; margin-bottom: 4px; }

.editor-image-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
    padding: 12px;
    background: #fafafa;
    border: 1px solid var(--border);
    border-radius: 6px;
    min-height: 70px;
}

.editor-thumb-item {
    position: relative;
    width: 90px;
    height: 90px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.editor-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 20px;
    text-align: center;
    font-size: 0.9rem;
    color: #555;
    margin-top: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.footer a:hover {
    text-decoration: underline;
}

@media (max-width: 900px) {
    .layout, .article-layout {
        flex-direction: column;
        margin: 15px auto;
        padding: 0 10px;
        gap: 15px;
    }

    .sidebar-left, .knowledge-panel {
        width: 100%;
    }

    .header {
        flex-direction: column;
        align-items: stretch;
        padding: 10px 15px;
        gap: 10px;
    }

    .search-box {
        max-width: 100%;
    }

    .main-content {
        padding: 20px;
    }
}