/* リセットと基本スタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Meiryo', sans-serif;
    font-size: 14px;
    color: #333;
    background-color: #f5f5f5;
    min-height: 100vh;
}

#app {
    min-height: 100vh;
    padding: 16px;
    padding-top: 80px;
}

.container {
    max-width: 600px;
    margin: 0 auto;
}

/* タイトル */
h1 {
    font-size: 22px;
    color: #0891b2;
    margin-bottom: 4px;
}

.subtitle {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
}

/* パネル */
.panel {
    margin-bottom: 16px;
    padding: 16px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.panel h2 {
    font-size: 14px;
    margin-bottom: 16px;
    color: #555;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

/* フォーム */
.form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.form-group {
    margin-bottom: 12px;
}

.form-group-value {
    flex: 1;
    margin-bottom: 0;
}

.form-group-unit {
    flex: 1;
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    color: #555;
    font-weight: 500;
}

input[type="number"],
select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Consolas', 'Monaco', 'Meiryo', monospace;
    background-color: #fff;
}

input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: #0891b2;
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

/* ボタン */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #0891b2;
    color: #fff;
}

.btn-primary:hover {
    background-color: #0e7490;
}

.btn-secondary {
    background-color: #64748b;
    color: #fff;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #475569;
}

.btn-secondary:disabled {
    background-color: #cbd5e1;
    cursor: not-allowed;
}

.btn-full {
    width: 100%;
}

/* 結果パネル */
.result-panel h2 {
    color: #0e7490;
}

.result-area {
    min-height: 80px;
    padding: 0;
    margin-bottom: 12px;
}

.result-area .placeholder {
    color: #999;
    font-style: italic;
    padding: 12px;
}

/* 結果行 */
.result-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.15s;
}

.result-row:last-child {
    border-bottom: none;
}

.result-row:hover {
    background-color: #f0fdfa;
}

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

.result-label {
    font-size: 12px;
    color: #888;
    margin-bottom: 2px;
}

.result-value {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 15px;
    color: #1a1a1a;
    font-weight: 500;
    word-break: break-all;
}

.result-unit {
    font-size: 13px;
    color: #666;
    font-weight: 400;
    margin-left: 4px;
}

.copy-btn {
    flex-shrink: 0;
    margin-left: 8px;
    padding: 6px 10px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    background: #fff;
    color: #666;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.copy-btn:hover {
    border-color: #0891b2;
    color: #0891b2;
    background-color: #f0fdfa;
}

.copy-btn.copied {
    border-color: #10b981;
    color: #10b981;
    background-color: #ecfdf5;
}

/* 入力元のハイライト */
.result-row.source-unit {
    background-color: #f0fdfa;
    border-left: 3px solid #0891b2;
}

/* 使い方セクション */
.usage-section {
    margin-top: 24px;
    margin-bottom: 24px;
}

.usage-section summary {
    padding: 12px 16px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #555;
}

.usage-section summary:hover {
    background-color: #fafafa;
}

.usage-section[open] summary {
    border-radius: 8px 8px 0 0;
    border-bottom: none;
}

.usage-content {
    padding: 16px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
}

.usage-content h3 {
    font-size: 14px;
    color: #0891b2;
    margin: 16px 0 8px 0;
}

.usage-content h3:first-child {
    margin-top: 0;
}

.usage-content p,
.usage-content ul {
    margin-bottom: 12px;
    color: #555;
}

.usage-content ul {
    margin-left: 20px;
}

.usage-content li {
    margin-bottom: 4px;
}

.usage-content code {
    background-color: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    color: #0e7490;
}

/* 参考テーブル */
.reference-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 13px;
}

.reference-table th,
.reference-table td {
    padding: 8px;
    border: 1px solid #e0e0e0;
    text-align: center;
}

.reference-table th {
    background-color: #f5f5f5;
    font-weight: 500;
    color: #555;
}

.reference-table td {
    font-family: 'Consolas', 'Monaco', monospace;
}

/* レスポンシブ */
@media (max-width: 480px) {
    #app {
        padding: 12px;
        padding-top: 72px;
    }

    h1 {
        font-size: 20px;
    }

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

    .form-group-value,
    .form-group-unit {
        margin-bottom: 12px;
    }

    .panel {
        padding: 12px;
    }

    .result-value {
        font-size: 14px;
    }

    .reference-table {
        font-size: 11px;
    }

    .reference-table th,
    .reference-table td {
        padding: 4px;
    }
}
