/* style.css */
:root { --primary: #667eea; --bg: #f4f6f9; }
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: white;
    padding: 30px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 400px; /* 限制最大宽，手机全屏，电脑居中 */
}

h2 { text-align: center; color: #333; margin-bottom: 25px; font-size: 22px; }

input, select {
    width: 100%;
    padding: 14px;
    margin-bottom: 15px;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    font-size: 16px; /* 防止 iOS 缩放 */
    background: #fafafa;
}

input:focus { border-color: var(--primary); outline: none; background: #fff; }

button {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.2s;
}

button:active { opacity: 0.8; }

.link { text-align: center; margin-top: 20px; font-size: 14px; }
.link a { color: var(--primary); text-decoration: none; }

/* 树形图移动端适配 */
.branch-container {
    display: flex;
    flex-direction: column; /* 手机上垂直排列 */
    gap: 15px;
    margin-top: 20px;
}
@media (min-width: 600px) {
    .branch-container { flex-direction: row; } /* 电脑上水平排列 */
}

.node-card {
    background: #fff;
    border: 1px solid #eee;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* 树形节点基础样式 */
.tree-item {
    margin: 10px 0;
    padding: 10px 15px;
    border-left: 3px solid #667eea; /* 左侧竖线体现层级 */
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* 子容器垂直堆叠 */
.branch-vertical {
    display: flex;
    flex-direction: column; /* 关键：强制垂直排列 */
    padding-left: 20px;     /* 缩进体现深度 */
    margin-top: 10px;
}

.branch-label {
    font-size: 12px;
    color: #888;
    margin-bottom: 5px;
    font-weight: bold;
}
