/*
 * file name : tag_cleaner_20260504.css
 * 2026-05-04 新規作成
 *
 * 対象: tag_cleaner.html
 * 方針: dep_zyokyo.html と同系ライトテーマ（#007bff アクセント）に統一
 *       inline style を全廃しこのファイルで完結させる
 *
 * 構成:
 *  1. CSS変数
 *  2. リセット・ベース
 *  3. ヘッダー・ナビゲーション
 *  4. 見出し
 *  5. レイアウト（入出力横並び）
 *  6. コントロール行
 *  7. フォーム部品
 *  8. ボタン（役割別）
 *  9. 警告・ローディング
 * 10. ネガプロセクション
 * 11. ログセクション
 * 12. フッター
 * 13. ユーティリティ
 * 14. レスポンシブ
 */

/* = 1. CSS変数 = */
:root {
    --c-primary:      #007bff;
    --c-primary-dark: #0056b3;
    --c-primary-deep: #003087;
    --c-bg:           #fdfdfd;
    --c-surface:      #f0f4ff;
    --c-surface2:     #fafafa;
    --c-border:       #ddd;
    --c-text:         #333;
    --c-text-muted:   #555;
    --c-text-dim:     #666;
    --c-heading:      #222;
    --c-btn-main:     #007bff;
    --c-btn-copy:     #43a047;
    --c-btn-dl:       #7b1fa2;
    --c-btn-danger:   #c62828;
    --c-btn-sub:      #757575;
    --c-warn-bg:      #fff8e1;
    --c-warn-border:  #f9a825;
    --c-warn-text:    #5d4037;
    --c-error:        #d32f2f;
}

/* = 2. リセット・ベース = */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont,
                 'Segoe UI', 'Hiragino Sans', Meiryo, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--c-text);
    background-color: var(--c-bg);
    max-width: 900px;
    margin: 0 auto;
    padding: 0 12px 40px;
}

/* = 3. ヘッダー・ナビゲーション = */
header {
    margin-top: 16px;
    margin-bottom: 0.8em;
    padding: 0.5em 0.8em;
    background-color: var(--c-surface);
    border-bottom: 2px solid var(--c-primary);
}

h1 {
    font-size: 1.4em;
    margin-bottom: 0.25em;
    color: var(--c-heading);
}

nav[aria-label="関連リンク"] {
    font-size: 0.88em;
    color: var(--c-text-muted);
}

nav[aria-label="関連リンク"] a {
    color: var(--c-primary-dark);
    text-decoration: none;
    padding: 0 0.2em;
}

nav[aria-label="関連リンク"] a:hover {
    color: var(--c-primary-deep);
    text-decoration: underline;
}

/* = 4. 見出し = */
h2 {
    font-size: 1.1em;
    margin: 1.2em 0 0.4em;
    color: var(--c-text);
    border-left: 3px solid var(--c-primary);
    border-radius: 0;
    padding-left: 0.5em;
}

h3 {
    font-size: 0.95em;
    margin: 0.8em 0 0.3em;
    color: var(--c-text-muted);
}

/* = 5. レイアウト（入出力横並び）= */
.input-output-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 12px 0;
}

.input-output-wrapper section {
    flex: 1;
    min-width: 280px;
}

/* 結果コピーボタンを右寄せ */
.result-actions {
    text-align: right;
    margin-top: 4px;
}

/* = 6. コントロール行 = */
.controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

.controls label {
    font-size: 0.88em;
    color: var(--c-text-muted);
    white-space: nowrap;
}

.log-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

/* = 7. フォーム部品 = */
label {
    display: block;
    font-size: 0.88em;
    color: var(--c-text-muted);
    margin-bottom: 4px;
}

textarea {
    width: 100%;
    padding: 0.5em;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    color: var(--c-text);
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
    resize: vertical;
}

textarea:focus {
    outline: 2px solid var(--c-primary);
    border-color: var(--c-primary);
}

textarea[readonly] {
    background: #f8f8f8;
    cursor: default;
}

select {
    padding: 0.3em 0.5em;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.88em;
    background: #fff;
    color: var(--c-text);
}

.error {
    color: var(--c-error);
    font-size: 0.85em;
    min-height: 1.4em;
    width: 100%;
}

/* = 8. ボタン（役割別）= */
.action-btn {
    display: inline-block;
    padding: 0.4em 0.9em;
    border: none;
    border-radius: 4px;
    font-size: 0.88em;
    font-family: inherit;
    cursor: pointer;
    color: #fff;
    background-color: var(--c-btn-main);
    margin-top: 6px;
    transition: filter 0.18s ease, transform 0.1s ease;
}

.action-btn:hover:not(:disabled) {
    filter: brightness(0.88);
    transform: translateY(-1px);
}

.action-btn:focus {
    outline: 2px solid var(--c-primary-deep);
    outline-offset: 2px;
}

.action-btn:disabled {
    background-color: #bdbdbd;
    cursor: not-allowed;
    transform: none;
    filter: none;
}

/* コピー系 */
.action-btn.btn-copy,
button[data-target] {
    background-color: var(--c-btn-copy);
}

/* サブ・補助系 */
.btn-sub {
    background-color: var(--c-btn-sub);
    font-size: 0.82em;
    padding: 0.3em 0.7em;
}

/* 広幅コピー（入出力エリア用）*/
.copy-wide {
    width: 100%;
    margin-top: 8px;
    text-align: center;
}

/* = 9. 警告・ローディング = */
.warning {
    background: var(--c-warn-bg);
    border: 1px solid var(--c-warn-border);
    border-radius: 4px;
    padding: 0.5em 0.8em;
    font-size: 0.88em;
    color: var(--c-warn-text);
    margin-bottom: 0.8em;
}

.warning a {
    color: #e65100;
}

.loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    padding: 0.8em 1.8em;
    border-radius: 6px;
    font-size: 1em;
    z-index: 1000;
}

/* = 10. ネガプロセクション = */
.negative-prompt-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 10px;
}

.negative-prompt-item {
    flex: 1;
    min-width: 240px;
    display: flex;
    flex-direction: column;
}

.negative-prompt-item textarea {
    flex-grow: 1;
    margin-bottom: 6px;
}

.negative-prompt-item .action-btn {
    align-self: flex-end;
    margin-top: 0;
}

/* = 11. ログセクション = */
.log-list {
    margin-top: 0.5em;
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid var(--c-border);
    border-radius: 4px;
    padding: 0.5em;
    background: var(--c-surface2);
    font-size: 0.85em;
}

.log-item {
    padding: 0.4em 0.5em;
    border-bottom: 1px solid #eee;
    color: #444;
    word-break: break-all;
}

.log-item:last-child {
    border-bottom: none;
}

.zip-suggestion {
    font-size: 0.88em;
    color: var(--c-text-muted);
    margin-bottom: 6px;
}

.log-list::-webkit-scrollbar { width: 5px; }
.log-list::-webkit-scrollbar-track { background: #f0f0f0; }
.log-list::-webkit-scrollbar-thumb {
    background: var(--c-primary);
    border-radius: 3px;
}

/* = 12. フッター = */
footer {
    margin-top: 2em;
    text-align: center;
    font-size: 0.88em;
    color: var(--c-text-dim);
}

footer a {
    color: var(--c-primary);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* = 13. ユーティリティ = */
.hidden {
    display: none !important;
}

/* = 14. レスポンシブ = */
@media (max-width: 600px) {
    body { padding: 0 8px 30px; }
    h1   { font-size: 1.2em; }
    h2   { font-size: 1em; }

    .input-output-wrapper {
        flex-direction: column;
        gap: 10px;
    }

    .input-output-wrapper section {
        min-width: auto;
        width: 100%;
    }

    .negative-prompt-wrapper {
        flex-direction: column;
    }

    .action-btn {
        font-size: 0.85em;
        padding: 0.35em 0.8em;
    }
}