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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 300;
}

.header p {
    font-size: 1.1em;
    opacity: 0.9;
}

.help-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 123, 255, 0.3);
}

.help-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.5);
}

.upload-section {
    padding: 40px;
    text-align: center;
}

/* 登録語辞書セクション */
.dict-upload-section {
    background: #fff8e1;
    border: 2px solid #ffc107;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    text-align: center;
}

.dict-upload-section h3 {
    color: #f57c00;
    margin: 0 0 10px 0;
    font-size: 1.3em;
}

.dict-upload-text {
    color: #666;
    font-size: 0.95em;
    margin-bottom: 15px;
}

.dict-upload-area {
    border: 3px dashed #ff9800;
    border-radius: 10px;
    padding: 40px 20px;
    margin: 20px 0;
    transition: all 0.3s ease;
    cursor: pointer;
    background: white;
}

.dict-upload-area:hover {
    border-color: #f57c00;
    background-color: #fff8e1;
}

.dict-upload-area.dragover {
    border-color: #f57c00;
    background-color: #ffe0b2;
}

.dict-upload-icon {
    font-size: 3em;
    color: #ff9800;
    margin-bottom: 15px;
}

.dict-upload-text-content {
    font-size: 1.1em;
    color: #666;
    margin-bottom: 15px;
}

.dict-upload-btn {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 20px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.dict-upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 152, 0, 0.4);
}

.dict-status {
    font-size: 0.95em;
    color: #666;
    padding: 8px 15px;
    background: #f5f5f5;
    border-radius: 15px;
    border: 2px solid #e0e0e0;
}

.dict-template-section {
    margin-top: 15px;
    text-align: center;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 2px dashed #ff9800;
}

.dict-template-text {
    color: #666;
    margin-bottom: 10px;
    font-size: 0.9em;
}

.dict-template-btn {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.95em;
    transition: all 0.3s ease;
}

.dict-template-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.4);
}

/* データアップロードセクション */
.data-upload-section {
    background: #e3f2fd;
    border: 2px solid #2196f3;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    text-align: center;
}

.data-upload-section h3 {
    color: #1976d2;
    margin: 0 0 10px 0;
    font-size: 1.3em;
}

.data-upload-text {
    color: #666;
    font-size: 0.95em;
    margin-bottom: 15px;
}

.upload-area {
    border: 3px dashed #ddd;
    border-radius: 10px;
    padding: 60px 20px;
    margin: 20px 0;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #4facfe;
    background-color: #f8f9ff;
}

.upload-area.dragover {
    border-color: #4facfe;
    background-color: #e8f4ff;
}

.upload-icon {
    font-size: 4em;
    color: #4facfe;
    margin-bottom: 20px;
}

.upload-text {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 20px;
}

.file-input {
    display: none;
}

.upload-btn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.1em;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.upload-btn:hover {
    transform: translateY(-2px);
}

.data-template-section {
    margin-top: 15px;
    text-align: center;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 2px dashed #2196f3;
}

.data-template-text {
    color: #666;
    margin-bottom: 10px;
    font-size: 0.9em;
}

.data-template-btn {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.95em;
    transition: all 0.3s ease;
}

.data-template-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
}

.results-section {
    padding: 40px;
    display: none;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.header-buttons {
    display: flex;
    gap: 10px;
}


.results-title {
    font-size: 1.8em;
    color: #333;
}

.export-btn, .view-docs-btn, .feedback-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
}

.view-docs-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.feedback-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
}

.export-btn:hover, .view-docs-btn:hover, .feedback-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.view-docs-btn:hover {
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.feedback-btn:hover {
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

.table-container {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.document-table {
    margin-bottom: 40px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    flex: 1;
    min-width: 300px;
    margin-right: 20px;
}

.document-table:last-child {
    margin-right: 0;
}

.document-table h3 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin: 0;
    padding: 15px 20px;
}

.tables-container {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    padding: 60px 0 20px 0; /* 上部にカスタムスクロールバー用のスペースを確保 */
    scroll-behavior: auto;
    /* 左から昇順で文書を並べる */
    direction: ltr;
    /* 標準スクロールバーを非表示 */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE, Edge */
}

.tables-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
}

/* 上部スクロールバー */
.upper-scrollbar-container {
    position: relative;
    margin-bottom: 10px;
}

.upper-scrollbar {
    width: 100%;
    height: 12px;
    background: #f1f1f1;
    border-radius: 6px;
    position: relative;
    cursor: pointer;
}

.upper-scrollbar-thumb {
    height: 12px;
    background: #007bff;
    border-radius: 6px;
    position: absolute;
    top: 0;
    left: 0;
    cursor: grab;
    transition: background 0.3s ease;
    min-width: 30px;
    display: none; /* 初期状態は非表示 */
}

.upper-scrollbar-thumb:hover {
    background: #0056b3;
}

.upper-scrollbar-thumb:active {
    cursor: grabbing;
    background: #004085;
}

/* 下部スクロールバー */
.lower-scrollbar-container {
    position: relative;
    margin-top: 10px;
}

.lower-scrollbar {
    width: 100%;
    height: 12px;
    background: #f1f1f1;
    border-radius: 6px;
    position: relative;
    cursor: pointer;
}

.lower-scrollbar-thumb {
    height: 12px;
    background: #007bff;
    border-radius: 6px;
    position: absolute;
    top: 0;
    left: 0;
    cursor: grab;
    transition: background 0.3s ease;
    min-width: 30px;
    display: none; /* 初期状態は非表示 */
}

.lower-scrollbar-thumb:hover {
    background: #0056b3;
}

.lower-scrollbar-thumb:active {
    cursor: grabbing;
    background: #004085;
}

/* カスタムスクロールバーコンテナ */
.custom-scrollbar-container {
    position: relative;
    margin-bottom: 20px;
}

.custom-scrollbar {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.scroll-btn {
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.scroll-btn:hover:not(:disabled) {
    background: #0056b3;
    transform: scale(1.05);
}

.scroll-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.5;
}

.scroll-track {
    flex: 1;
    height: 12px;
    background: #e9ecef;
    border-radius: 6px;
    position: relative;
    cursor: pointer;
    margin: 0 10px;
}

.scroll-thumb {
    height: 12px;
    background: #007bff;
    border-radius: 6px;
    position: absolute;
    top: 0;
    left: 0;
    cursor: grab;
    transition: background 0.3s ease;
    min-width: 30px;
}

.scroll-thumb:hover {
    background: #0056b3;
}

.scroll-thumb:active {
    cursor: grabbing;
    background: #004085;
}


/* タブスタイル */
.tab-container {
    margin-top: 30px;
}

.tab-buttons {
    display: flex;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 20px;
}

.tab-button {
    background: none;
    border: none;
    padding: 15px 25px;
    font-size: 16px;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-button:hover {
    color: #007bff;
    background-color: #f8f9fa;
}

.tab-button.active {
    color: #007bff;
    border-bottom-color: #007bff;
    background-color: #f8f9fa;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.table-container h2, .tf-table-container h2, .tfidf-table-container h2 {
    color: #495057;
    margin-bottom: 20px;
    font-size: 1.5em;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

.document-table h3 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin: 0;
    padding: 15px 20px;
    font-size: 1.2em;
    font-weight: 600;
}

.table-wrapper {
    overflow-x: auto;
}

.document-table-content {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.document-table-content th,
.document-table-content td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
    width: 50%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* フィルターメニューのスタイル */
.filter-menu {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid #e9ecef;
}

.filter-menu h3 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 1.1em;
}

.filter-options {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #495057;
}

.filter-checkbox input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.2);
}

.filter-checkbox span {
    user-select: none;
}

/* 並び替えメニューのスタイル */
.sort-menu {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid #e9ecef;
}

.sort-menu h3 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 1.1em;
}

.sort-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.sort-btn {
    background: #fff;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    color: #495057;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.sort-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.sort-btn.active {
    background: #007bff;
    border-color: #007bff;
    color: white;
}

.sort-btn.active:hover {
    background: #0056b3;
    border-color: #0056b3;
}

/* ストップワードメニューのスタイル */
.stopwords-menu {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid #e9ecef;
}

.stopwords-menu h3 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 1.1em;
}

.stopwords-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stopwords-input {
    display: flex;
    gap: 10px;
    align-items: center;
}

.stopwords-input input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
}

.add-stopword-btn {
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.add-stopword-btn:hover {
    background: #218838;
}

.stopwords-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.stopword-tag {
    background: #dc3545;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.stopword-remove {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stopword-remove:hover {
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
}

/* 文書内容表示モーダル */
.documents-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    pointer-events: none;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 1000px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    pointer-events: auto;
    border: 3px solid #007bff;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
    cursor: move;
    user-select: none;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    margin: -20px -20px 20px -20px;
    padding: 15px 20px;
    border-radius: 12px 12px 0 0;
}

.modal-title {
    font-size: 1.5em;
    color: #333;
    margin: 0;
}

.close-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1001;
}

.close-btn:hover {
    background: #c82333;
}

.document-content {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.document-content h3 {
    color: #007bff;
    margin-top: 0;
    margin-bottom: 15px;
}

.document-section {
    margin-bottom: 20px;
}

.document-section h4 {
    color: #495057;
    margin-bottom: 10px;
    font-size: 1.1em;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 5px;
}

.document-text {
    line-height: 1.8;
    color: #333;
    white-space: pre-wrap;
    word-wrap: break-word;
    background: white;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.document-tokenized {
    line-height: 2;
    color: #495057;
    word-wrap: break-word;
    background: #fff3cd;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #ffc107;
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
}

.registered-word-token {
    color: #dc3545;
    font-weight: bold;
    background: #ffe6e6;
    padding: 2px 4px;
    border-radius: 3px;
}

/* ヘルプモーダル */
.help-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    pointer-events: none;
}

.help-modal-content {
    background-color: #fefefe;
    margin: 2% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    pointer-events: auto;
    border: 3px solid #007bff;
    position: relative;
}

.help-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #007bff;
}

.help-section h3 {
    color: #007bff;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.help-section p {
    line-height: 1.6;
    color: #333;
    margin-bottom: 10px;
}

.help-section ul {
    margin: 10px 0;
    padding-left: 20px;
}

.help-section li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.code-example {
    background: #2d3748;
    color: #e2e8f0;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    margin: 10px 0;
    overflow-x: auto;
}

.document-table-content th {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.document-table-content th:hover {
    background: linear-gradient(135deg, #3d8bfe 0%, #00d4fe 100%);
}

.document-table-content tr:hover {
    background-color: #f8f9ff;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

th:hover {
    background: linear-gradient(135deg, #3d8bfe 0%, #00d4fe 100%);
}

th.sortable {
    position: relative;
}

th.sortable::after {
    content: ' ↕';
    opacity: 0.5;
    font-size: 0.8em;
}

th.sort-asc::after {
    content: ' ↑';
    opacity: 1;
}

th.sort-desc::after {
    content: ' ↓';
    opacity: 1;
}

tr:hover {
    background-color: #f8f9ff;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4facfe;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    background-color: #ffe6e6;
    color: #d63031;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #d63031;
}

.success {
    background-color: #e8f5e8;
    color: #00b894;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #00b894;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.stat-number {
    font-size: 2em;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9em;
    opacity: 0.9;
}

/* クリック可能な統計カード */
.clickable-stat {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.clickable-stat:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.clickable-stat::after {
    content: '👆';
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 0.8em;
    opacity: 0.7;
}

/* 全体分析テーブルのソートインジケーター */
#sort-indicator-word::after,
#sort-indicator-tf::after,
#sort-indicator-idf::after,
#sort-indicator-tfidf::after,
#sort-indicator-docs::after {
    content: ' ↕';
    opacity: 0.5;
    font-size: 0.8em;
}

#sort-indicator-word.sort-asc::after,
#sort-indicator-tf.sort-asc::after,
#sort-indicator-idf.sort-asc::after,
#sort-indicator-tfidf.sort-asc::after,
#sort-indicator-docs.sort-asc::after {
    content: ' ↑';
    opacity: 1;
}

#sort-indicator-word.sort-desc::after,
#sort-indicator-tf.sort-desc::after,
#sort-indicator-idf.sort-desc::after,
#sort-indicator-tfidf.sort-desc::after,
#sort-indicator-docs.sort-desc::after {
    content: ' ↓';
    opacity: 1;
}

/* ワードクラウドモーダル */
.wordcloud-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    pointer-events: none;
}

.wordcloud-modal-content {
    background-color: #fefefe;
    margin: 2% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    pointer-events: auto;
    border: 3px solid #007bff;
    position: relative;
}

.wordcloud-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.wordcloud-section {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    border-left: 4px solid #007bff;
}

.wordcloud-section h3 {
    color: #007bff;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.wordcloud-canvas-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 500px;
    width: 100%;
    background: white;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
    margin: 15px 0;
    padding: 10px;
    box-sizing: border-box;
}

.wordcloud-canvas {
    border-radius: 8px;
    max-width: 100%;
    max-height: 100%;
}

.wordcloud-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.wordcloud-btn {
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.wordcloud-btn:hover {
    background: #0056b3;
}

.wordcloud-btn.active {
    background: #28a745;
}

.wordcloud-info {
    background: #e9ecef;
    padding: 10px;
    border-radius: 5px;
    font-size: 14px;
    margin-bottom: 15px;
}

.wordcloud-loading {
    text-align: center;
    color: #666;
    font-style: italic;
}

/* 文書内容表示 */
.document-content-display {
    background: white;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #dee2e6;
    margin: 15px 0;
}

.document-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    border-left: 4px solid #007bff;
}

.document-info p {
    margin: 5px 0;
    font-size: 14px;
}

.document-text-display {
    background: #fefefe;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    font-size: 16px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'メイリオ', Meiryo, 'Hiragino Kaku Gothic ProN', 'ヒラギノ角ゴ ProN W3', sans-serif;
}

/* クリック可能な文書ヘッダー */
.clickable-doc-header {
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.clickable-doc-header:hover {
    background: linear-gradient(135deg, #3d8bfe 0%, #00d4fe 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
}


/* 単語ハイライト機能 */
.word-cell {
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.word-cell:hover {
    background-color: #e3f2fd !important;
    transform: scale(1.05);
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.word-cell.highlighted {
    background-color: #ffeb3b !important;
    color: #333 !important;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(255, 235, 59, 0.6);
    animation: highlightPulse 0.5s ease-in-out;
}

.word-cell.highlighted:hover {
    background-color: #ffc107 !important;
    transform: scale(1.1);
}

@keyframes highlightPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* ヘッダーボタンのスタイル */
.header-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.reset-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.reset-btn:hover {
    background-color: #c82333;
}

