:root {
    --primary-color: #0052CC;
    --primary-hover: #0747A6;
    --secondary-color: #42526E;
    --background: #FAFBFC;
    --surface: #FFFFFF;
    --border: #DFE1E6;
    --text-primary: #172B4D;
    --text-secondary: #6B778C;
    --success: #00875A;
    --error: #DE350B;
    --shadow-sm: 0 1px 3px rgba(9, 30, 66, 0.13);
    --shadow-md: 0 4px 8px rgba(9, 30, 66, 0.13);
    --shadow-lg: 0 8px 16px rgba(9, 30, 66, 0.13);
    --radius: 6px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    flex: 1;
}

/* ヘッダー */
header {
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h1 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.logo {
    width: 32px;
    height: 32px;
    color: var(--primary-color);
}

.language-selector select {
    padding: 8px 32px 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--surface);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%236B778C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    appearance: none;
    transition: border-color 0.2s;
}

.language-selector select:hover {
    border-color: var(--primary-color);
}

.language-selector select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 82, 204, 0.1);
}

/* メインコンテンツ */
main {
    padding: 40px 0;
}

section {
    margin-bottom: 60px;
}

h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.description {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* 入力セクション */
.input-section {
    background-color: var(--surface);
    padding: 32px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

textarea {
    width: 100%;
    min-height: 200px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 82, 204, 0.1);
}

/* ボタン */
button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

button svg {
    width: 18px;
    height: 18px;
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
    margin-top: 20px;
}

.primary-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.primary-btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.secondary-btn {
    background-color: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.secondary-btn:hover {
    background-color: var(--background);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* 結果セクション */
.result-section {
    background-color: var(--surface);
    padding: 32px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.result-section.hidden {
    display: none;
}

.structure-display {
    background-color: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    max-height: 500px;
    overflow-y: auto;
}

/* ツリービュー */
.tree {
    font-size: 14px;
}

.tree-node {
    margin-left: 0;
}

.tree-children {
    margin-left: 24px;
}

.tree-folder, .tree-subfolder, .tree-file {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.tree-folder:hover, .tree-subfolder:hover, .tree-file:hover {
    background-color: rgba(0, 82, 204, 0.08);
}

.tree-folder {
    font-weight: 600;
    color: var(--primary-color);
}

.tree-subfolder {
    font-weight: 500;
    color: var(--text-primary);
}

.tree-file {
    color: var(--text-secondary);
}

.tree-folder svg, .tree-subfolder svg {
    width: 20px;
    height: 20px;
    color: var(--primary-color);
}

.tree-file svg {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}

/* アクションボタン */
.action-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* 機能セクション */
.features {
    margin-top: 80px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.feature-card {
    background-color: var(--surface);
    padding: 32px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature-card svg {
    width: 48px;
    height: 48px;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* フッター */
footer {
    background-color: var(--surface);
    border-top: 1px solid var(--border);
    padding: 24px 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

/* 通知 */
.notification {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 16px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s;
    z-index: 1000;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification.success {
    background-color: var(--success);
    color: white;
}

.notification.error {
    background-color: var(--error);
    color: white;
}

/* スクロールバー */
.structure-display::-webkit-scrollbar {
    width: 8px;
}

.structure-display::-webkit-scrollbar-track {
    background: var(--background);
    border-radius: 4px;
}

.structure-display::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.structure-display::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* レスポンシブ */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 16px;
    }
    
    h1 {
        font-size: 20px;
    }
    
    .input-section, .result-section {
        padding: 24px;
    }
    
    .tree-children {
        margin-left: 16px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons button {
        width: 100%;
        justify-content: center;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
}