:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #f0f4f8;
    --accent-color: #7c3aed;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
}

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

body {
    font-family: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
    color: var(--text-color);
    background-color: #fafafa;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    text-align: center;
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    background-color: white;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

button {
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    transition: background-color 0.2s, transform 0.1s;
    box-shadow: var(--shadow-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

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

button:active {
    transform: translateY(0);
}

button:disabled {
    background-color: var(--text-light);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.7;
}

#resultOutput {
    margin-top: 1.5rem;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    background-color: white;
    white-space: pre-line;
    word-break: break-word;
    overflow-wrap: break-word;
    min-height: 100px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: box-shadow 0.3s;
}

#resultOutput:not(:empty) {
    animation: fadeIn 0.5s ease-out;
}

/* 設定パネルのスタイル */
.settings-panel {
    background-color: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.settings-section {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.settings-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.settings-section label {
    font-weight: 500;
    margin-right: 1rem;
    min-width: 160px;
    color: var(--text-color);
}

.setting-description {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 0.5rem;
    width: 100%;
    margin-left: 160px;
}

#modelSelect {
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    font-size: 0.875rem;
    width: calc(100% - 180px);
    background-color: white;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 10.5a.5.5 0 0 1-.354-.146l-4-4a.5.5 0 1 1 .708-.708L8 9.293l3.646-3.647a.5.5 0 0 1 .708.708l-4 4A.5.5 0 0 1 8 10.5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#modelSelect:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

#temperatureInput {
    width: calc(100% - 230px);
    vertical-align: middle;
    margin: 0 0.75rem;
    accent-color: var(--primary-color);
}

#temperatureValue {
    display: inline-block;
    width: 30px;
    text-align: center;
    font-weight: 500;
    color: var(--primary-color);
}

#maxTokensInput {
    width: calc(100% - 180px);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#maxTokensInput:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

label[for="imageInput"] {
    display: block;
    margin-bottom: 0.5rem;
}

#imageInput {
    display: block;
    margin-bottom: 1.5rem;
}

/* カスタムファイル入力スタイル */
#imageInput::file-selector-button {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background-color: white;
    color: var(--text-color);
    cursor: pointer;
    margin-right: 0.75rem;
    transition: background-color 0.2s;
}

#imageInput::file-selector-button:hover {
    background-color: var(--secondary-color);
}

/* アニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }
    
    .settings-section label {
        min-width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .setting-description,
    #modelSelect,
    #temperatureInput,
    #maxTokensInput {
        margin-left: 0;
        width: 100%;
    }
    
    #temperatureInput {
        margin: 0.5rem 0;
    }
}

.container {
    width: 100%;
    max-width: 800px;
}

.accent-text {
    color: var(--accent-color);
    font-weight: 700;
}

.material-symbols-rounded {
    vertical-align: middle;
    margin-right: 0.5rem;
    font-size: 1.25rem;
}

.input-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.input-field {
    display: flex;
    flex-direction: column;
}

/* ドラッグ＆ドロップエリアのスタイル */
.input-field.file-upload {
    position: relative;
}

.dropzone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    background-color: var(--secondary-color);
    cursor: pointer;
    margin-top: 0.5rem;
}

.dropzone.dragover {
    border-color: var(--primary-color);
    background-color: rgba(79, 70, 229, 0.05);
}

.dropzone .upload-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.dropzone .upload-message {
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.dropzone .upload-hint {
    font-size: 0.875rem;
    color: var(--text-light);
}

.dropzone input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.file-preview {
    display: flex;
    align-items: center;
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    background-color: white;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.file-preview img {
    max-width: 60px;
    max-height: 60px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    margin-right: 1rem;
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 500;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}

.file-size {
    font-size: 0.75rem;
    color: var(--text-light);
}

.file-remove {
    color: var(--text-light);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    transition: all 0.2s;
}

.file-remove:hover {
    color: #ef4444;
    background-color: rgba(239, 68, 68, 0.1);
}

.input-field label {
    display: flex;
    align-items: center;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.result-section h2 {
    display: flex;
    align-items: center;
    font-weight: 600;
    color: var(--text-color);
}

.result-box {
    position: relative;
}

.result-box:empty::after {
    content: "AIの応答がここに表示されます";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-light);
    font-style: italic;
}

footer {
    margin-top: 3rem;
    text-align: center;
    color: var(--text-light);
    font-size: 0.875rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
}

button .material-symbols-rounded {
    margin-right: 0.5rem;
    font-size: 1.25rem;
}

/* より洗練されたホバーエフェクト */
.settings-panel:hover {
    box-shadow: var(--shadow-lg);
    transition: box-shadow 0.3s ease;
}

#generateButton {
    align-self: flex-start;
    margin-top: 0.5rem;
}

@media (max-width: 768px) {
    #generateButton {
        align-self: stretch;
        width: 100%;
    }
    
    /* ... existing code ... */
}

/* Excelデータ表示領域用のスタイルを追加 */
.excel-data {
    margin-top: 20px;
    overflow-x: auto;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    min-height: 100px;
}

.placeholder-text {
    color: #9e9e9e;
    font-style: italic;
    padding: 20px;
    text-align: center;
}

.excel-data table {
    width: 100%;
    border-collapse: collapse;
}

.excel-data th,
.excel-data td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.excel-data th {
    background-color: #f2f2f2;
    font-weight: 600;
}

.excel-data tr:hover {
    background-color: #f5f5f5;
}

.excel-data .alert {
    padding: 10px;
    border-radius: 4px;
}

.excel-data .alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

/* CSV抽出結果表示セクション */
.csv-output-section {
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: 8px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.csv-output-section h2 {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    color: #343a40;
    font-size: 1.25rem;
}

.csv-output-section h2 .material-symbols-rounded {
    margin-right: 0.5rem;
    color: #0d6efd;
}

.new-badge {
    margin-left: 0.75rem;
    padding: 0.15rem 0.5rem;
    font-size: 0.675rem;
    font-weight: 700;
    text-transform: uppercase;
    color: white;
    background-color: #ff3366;
    border-radius: 12px;
    animation: pulse 2s infinite;
}

.csv-content {
    background-color: white;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    overflow: hidden;
}

.csv-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: #f1f3f5;
    border-bottom: 1px solid #dee2e6;
}

.csv-header h4 {
    margin: 0;
    font-size: 1rem;
    color: #495057;
}

.csv-actions {
    display: flex;
    gap: 0.5rem;
}

.csv-action-button {
    display: flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border: none;
    border-radius: 4px;
    background-color: #e9ecef;
    color: #495057;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.csv-action-button:hover {
    background-color: #dee2e6;
}

.csv-action-button .material-symbols-rounded {
    font-size: 1rem;
    margin-right: 0.25rem;
}

.csv-preview {
    margin: 0;
    padding: 1rem;
    background-color: #2b2b2b;
    color: #f8f9fa;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    overflow-x: auto;
    max-height: 300px;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: break-word;
}

.csv-download-area {
    padding: 1rem;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: center;
}

.csv-download-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    background-color: #198754;
    color: white;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.csv-download-button.disabled {
    background-color: var(--text-light);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.7;
}

.csv-download-button.disabled:hover {
    background-color: var(--text-light);
    transform: none;
    box-shadow: none;
}

.csv-download-button:hover {
    background-color: #157347;
    text-decoration: none;
    color: white;
}

.csv-download-button .material-symbols-rounded {
    margin-right: 0.5rem;
}

/* コピー完了時のスタイル */
.csv-action-button.copied {
    background-color: #20c997;
    color: white;
}

/* 新機能ハイライトのアニメーション */
.highlight-new {
    animation: highlight-fade 2s ease;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 51, 102, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 51, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 51, 102, 0);
    }
}

@keyframes highlight-fade {
    0% {
        background-color: rgba(255, 236, 179, 0.7);
    }
    100% {
        background-color: #f8f9fa;
    }
}

/* バージョン情報 */
.version-info {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.25rem;
    animation: pulse 2s infinite;
}

/* CSV抽出エラー時のスタイル */
.csv-error .csv-preview {
    background-color: #ffebee;
    color: #d32f2f;
    border: 1px solid #ffcdd2;
}

.csv-error h4 {
    color: #d32f2f;
}

/* レート制限の注意書き */
.rate-limit-notice {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    border-radius: 8px;
    padding: 8px 12px;
    margin: 10px 0;
    font-size: 0.9rem;
    color: #856404;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.rate-limit-notice p {
    margin: 0;
    display: flex;
    align-items: center;
}

.rate-limit-notice .material-symbols-rounded {
    margin-right: 5px;
    font-size: 20px;
}

/* プログレスバーのスタイル */
.progress-bar {
  width: 160px;
  height: 8px;
  background: #eee;
  position: relative;
  overflow: hidden;
}

.progress-bar::after {
  content: '';
  position: absolute;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, #ff6b6b, #ff8787);
  animation: progress 1.5s infinite linear;
}

@keyframes progress {
  0% { left: -40% }
  100% { left: 100% }
}
