:root {
    --toyota-red: #EB0A1E;
    --toyota-red-hover: #FF1F33;
    --toyota-red-dark: #C4081A;
    --toyota-black: #1A1A1F;
    --toyota-charcoal: #282830;
    --toyota-gray: #58595B;
    --toyota-silver: #9EA0A5;
    --toyota-light: #F4F4F5;
    --toyota-white: #FFFFFF;

    --bg-primary: var(--toyota-white);
    --bg-secondary: #FAFAFA;
    --bg-sidebar: var(--toyota-charcoal);
    --bg-header: var(--toyota-black);
    --bg-hover: rgba(235, 10, 30, 0.04);
    --bg-active: rgba(235, 10, 30, 0.08);

    --border-light: #E8E8EA;
    --border-sidebar: rgba(255, 255, 255, 0.08);

    --text-dark: #1A1A1F;
    --text-body: #3A3A42;
    --text-muted: #78797E;
    --text-light: #E8E8EA;
    --text-sidebar: #B8B9BD;
    --text-sidebar-muted: #78797E;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --sidebar-width: 340px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

#header {
    position: relative;
    background: var(--bg-header);
    color: var(--toyota-white);
    padding: 0 28px;
    height: 54px;
    display: flex;
    align-items: center;
    z-index: 10;
    flex-shrink: 0;
}

#header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: var(--toyota-red);
}

#header h1 {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: var(--toyota-white);
    display: flex;
    align-items: center;
    gap: 14px;
}

#header h1::before {
    content: "";
    display: inline-block;
    width: 22px;
    height: 22px;
    background: var(--toyota-red);
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z'/%3E%3C/svg%3E");
    mask-size: contain;
    -webkit-mask-size: contain;
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
    flex-shrink: 0;
}

#main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

#sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

#sidebar-header {
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border-sidebar);
}

#sidebar-header h2 {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-sidebar-muted);
    letter-spacing: 2.5px;
    text-transform: uppercase;
}

#search-container {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-sidebar);
    position: relative;
}

#search-input {
    width: 100%;
    padding: 10px 36px 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--toyota-white);
    background-color: rgba(255, 255, 255, 0.06);
    transition: all var(--transition-fast);
    outline: none;
    font-family: inherit;
}

#search-input:focus {
    border-color: var(--toyota-red);
    background-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 3px rgba(235, 10, 30, 0.2);
}

#search-input::placeholder {
    color: var(--text-sidebar-muted);
}

.search-clear {
    position: absolute;
    right: 22px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border: none;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-sidebar-muted);
    border-radius: 50%;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.search-clear:hover {
    background-color: var(--toyota-red);
    color: var(--toyota-white);
}

.search-clear.hidden {
    display: none;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 8px;
    right: 8px;
    margin-top: 4px;
    background-color: #2F2F38;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    max-height: 420px;
    overflow-y: auto;
    z-index: 100;
}

.search-results.hidden {
    display: none;
}

.search-results::-webkit-scrollbar {
    width: 5px;
}

.search-results::-webkit-scrollbar-track {
    background: transparent;
}

.search-results::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.search-result-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: all var(--transition-fast);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: rgba(235, 10, 30, 0.1);
}

.search-result-item .result-path {
    font-size: 11px;
    color: var(--text-sidebar-muted);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-item .result-name {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 500;
}

.search-result-item:hover .result-name {
    color: var(--toyota-red-hover);
}

.search-results-empty {
    padding: 24px 20px;
    text-align: center;
    color: var(--text-sidebar-muted);
    font-size: 13px;
}

#tree-container {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

#tree-container::-webkit-scrollbar {
    width: 5px;
}

#tree-container::-webkit-scrollbar-track {
    background: transparent;
}

#tree-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
}

#tree-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

#loading {
    padding: 32px 20px;
    text-align: center;
    color: var(--text-sidebar-muted);
    font-size: 13px;
}

#content {
    flex: 1;
    overflow: hidden;
    background-color: var(--bg-primary);
    position: relative;
}

#content-frame {
    width: 100%;
    height: 100%;
    border: none;
}

.tree {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tree li {
    list-style: none;
}

.tree-item {
    display: flex;
    align-items: center;
    padding: 7px 16px;
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
    margin: 0;
    position: relative;
    border-left: 3px solid transparent;
}

.tree-item:hover {
    background-color: rgba(255, 255, 255, 0.04);
}

.tree-item.active {
    background-color: rgba(235, 10, 30, 0.12);
    border-left-color: var(--toyota-red);
}

.tree-item.active .tree-text {
    color: var(--toyota-white);
    font-weight: 600;
}

.tree-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    text-align: center;
    margin-right: 4px;
    color: var(--text-sidebar-muted);
    transition: transform var(--transition-fast), color var(--transition-fast);
    font-size: 9px;
    flex-shrink: 0;
}

.tree-item:hover .tree-toggle {
    color: var(--text-sidebar);
}

.tree-toggle.expanded {
    transform: rotate(90deg);
}

.tree-toggle.invisible {
    visibility: hidden;
}

.tree-icon {
    margin-right: 8px;
    font-size: 13px;
    flex-shrink: 0;
    opacity: 0.65;
}

.tree-text {
    flex: 1;
    font-size: 13px;
    color: var(--text-sidebar);
    line-height: 1.5;
    transition: color var(--transition-fast);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tree-item:hover .tree-text {
    color: var(--toyota-white);
}

.tree-children {
    padding-left: 16px;
    position: relative;
}

.tree-children::before {
    content: "";
    position: absolute;
    left: 24px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(255, 255, 255, 0.06);
}
