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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    line-height: 1.8;
    color: #333;
    background: #f5f5f5;
}

header {
    background: #fff;
    border-bottom: 3px solid #17a2b8;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo-text {
    font-size: 22px;
    font-weight: bold;
    color: #17a2b8;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 20px;
}

nav a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s;
    padding: 5px 10px;
}

nav a:hover, nav a.active {
    color: #17a2b8;
}

.hero {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: #fff;
    padding: 30px 20px;
    text-align: center;
}

.hero h1 {
    font-size: 28px;
    margin-bottom: 8px;
    font-weight: bold;
}

.hero p {
    font-size: 16px;
    opacity: 0.9;
}

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

/* ページセクション */
.page-section {
    display: none;
}

.page-section.active {
    display: block;
}

/* カード */
.card {
    background: #fff;
    border: 1px solid #ddd;
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    background: #17a2b8;
    color: #fff;
    padding: 12px 20px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    padding: 20px;
}

/* ファイルリスト */
.file-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
    flex-wrap: wrap;
    gap: 8px;
}

.file-item:last-child {
    border-bottom: none;
}

.file-item:hover {
    background: #f8f9fa;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: bold;
    color: #333;
    word-break: break-all;
}

.file-meta {
    font-size: 13px;
    color: #999;
    margin-top: 2px;
}

.file-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* ステータスバッジ */
.badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 3px;
}

.badge-pending {
    background: #ffeaa7;
    color: #856404;
}

.badge-processing {
    background: #74b9ff;
    color: #0056b3;
    animation: pulse 1.5s infinite;
}

.badge-done {
    background: #55efc4;
    color: #155724;
}

.badge-error {
    background: #fab1a0;
    color: #721c24;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ボタン */
.btn {
    display: inline-block;
    padding: 8px 20px;
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
    border: none;
    font-size: 14px;
    transition: opacity 0.3s;
}

.btn:hover {
    opacity: 0.8;
}

.btn-primary {
    background: #17a2b8;
    color: #fff;
}

.btn-outline {
    background: #fff;
    color: #17a2b8;
    border: 2px solid #17a2b8;
}

.btn-outline:hover {
    background: #17a2b8;
    color: #fff;
}

.btn-play {
    background: #00b894;
    color: #fff;
    padding: 6px 14px;
    font-size: 13px;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

.btn-danger {
    background: #e17055;
    color: #fff;
}

/* テキスト送信フォーム */
.submit-form {
    margin-bottom: 20px;
}

.submit-form textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 2px solid #ddd;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.3s;
}

.submit-form textarea:focus {
    outline: none;
    border-color: #17a2b8;
}

.submit-form input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #ddd;
    font-size: 14px;
    margin-bottom: 10px;
    transition: border-color 0.3s;
}

.submit-form input[type="text"]:focus {
    outline: none;
    border-color: #17a2b8;
}

.form-row {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

/* 統計 */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: #fff;
    border: 1px solid #ddd;
    padding: 15px;
    text-align: center;
}

.stat-number {
    font-size: 28px;
    font-weight: bold;
    color: #17a2b8;
}

.stat-label {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

/* オーディオプレイヤー */
.audio-player {
    width: 100%;
    margin-top: 8px;
}

.audio-player audio {
    width: 100%;
    height: 40px;
}

/* プログレスバー */
.progress-bar {
    width: 100%;
    height: 6px;
    background: #eee;
    margin-top: 8px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #17a2b8;
    transition: width 0.3s;
}

/* トースト通知 */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.toast {
    background: #2c3e50;
    color: #fff;
    padding: 12px 20px;
    margin-top: 8px;
    font-size: 14px;
    animation: slideIn 0.3s;
    max-width: 300px;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* 空状態 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 10px;
}

/* フッター */
footer {
    background: #2c3e50;
    color: #999;
    padding: 15px 20px;
    text-align: center;
    font-size: 13px;
}

/* ===== モバイル対応 ===== */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        gap: 8px;
        padding: 8px 15px;
    }

    .logo-text {
        font-size: 18px;
    }

    nav ul {
        gap: 10px;
        flex-wrap: wrap;
        justify-content: center;
    }

    nav a {
        font-size: 13px;
        padding: 4px 8px;
    }

    .hero {
        padding: 20px 15px;
    }

    .hero h1 {
        font-size: 20px;
    }

    .hero p {
        font-size: 14px;
    }

    .container {
        padding: 10px;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .stat-number {
        font-size: 22px;
    }

    .file-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .file-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .card-body {
        padding: 12px;
    }

    .form-row {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        text-align: center;
    }
}

/* ===== 固定オーディオプレイヤーバー ===== */
.player-bar {
    position: fixed;
    bottom: -100px;
    left: 0;
    right: 0;
    background: #2c3e50;
    color: #fff;
    z-index: 200;
    transition: bottom 0.3s ease;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
}

.player-bar.active {
    bottom: 0;
}

.player-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.player-info {
    min-width: 0;
    flex-shrink: 0;
    max-width: 200px;
}

.player-name {
    display: block;
    font-weight: bold;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #17a2b8;
}

.player-time {
    font-size: 11px;
    color: #999;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.player-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    padding: 5px 8px;
    transition: color 0.2s;
}

.player-btn:hover {
    color: #17a2b8;
}

.player-btn-main {
    background: #17a2b8;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.player-btn-main:hover {
    background: #138496;
    color: #fff;
}

.player-progress-wrap {
    flex: 1;
    height: 6px;
    background: #444;
    cursor: pointer;
    position: relative;
}

.player-progress {
    height: 100%;
    background: #17a2b8;
    width: 0%;
    transition: width 0.1s linear;
}

.player-close {
    background: none;
    border: none;
    color: #999;
    font-size: 22px;
    cursor: pointer;
    padding: 5px;
    flex-shrink: 0;
}

.player-close:hover {
    color: #fff;
}

/* プレイヤー表示時にフッターとコンテンツの余白確保 */
body.player-visible {
    padding-bottom: 70px;
}

/* モバイル: プレイヤーバー */
@media (max-width: 768px) {
    .player-inner {
        flex-wrap: wrap;
        padding: 8px 12px;
        gap: 8px;
    }

    .player-info {
        order: 1;
        flex: 1;
        max-width: none;
    }

    .player-close {
        order: 2;
    }

    .player-controls {
        order: 3;
    }

    .player-progress-wrap {
        order: 4;
        width: 100%;
    }

    .player-btn-main {
        width: 36px;
        height: 36px;
    }
}
