/* === ベース === */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    padding: 16px;
}

/* === ヘッダー === */
header {
    max-width: 800px;
    margin: 0 auto 24px;
    padding: 16px 0;
    text-align: center;
}

header h1 {
    font-size: 1.5em;
    color: #1a73e8;
    margin-bottom: 4px;
}

.subtitle {
    color: #666;
    font-size: 0.9em;
}

/* === メイン === */
main {
    max-width: 800px;
    margin: 0 auto;
}

/* === 検索エリア === */
.search-area {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 24px;
}

#search-form {
    display: flex;
    gap: 8px;
}

#code-input {
    flex: 1;
    padding: 12px 16px;
    font-size: 1.1em;
    border: 1px solid #ddd;
    border-radius: 4px;
    outline: none;
}

#code-input:focus {
    border-color: #1a73e8;
}

#search-form button {
    padding: 12px 24px;
    font-size: 1em;
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
}

#search-form button:hover {
    background: #1557b0;
}

.hint {
    margin-top: 8px;
    color: #999;
    font-size: 0.85em;
}

/* === 結果エリア === */
#result-area {
    background: white;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    min-height: 200px;
}

.placeholder {
    color: #999;
    text-align: center;
    padding: 40px 0;
}

.error-message {
    color: #c62828;
    text-align: center;
    padding: 40px 0;
}

/* === 銘柄情報 === */
.issuer-info {
    border-bottom: 2px solid #eee;
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.issuer-info h2 {
    font-size: 1.3em;
    color: #1a73e8;
    margin-bottom: 4px;
}

.issuer-info .meta {
    color: #666;
    font-size: 0.85em;
}

/* === 外部リンク (v2.6新規) === */
.external-links {
    margin-top: 10px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.external-links a {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.8em;
    color: #1a73e8;
    text-decoration: none;
    border: 1px solid #1a73e8;
    border-radius: 3px;
    background: white;
}

.external-links a:hover {
    background: #1a73e8;
    color: white;
}

/* === セクションタイトル === */
.section-title {
    font-size: 1.1em;
    color: #1a73e8;
    margin: 24px 0 4px;
    padding: 8px 12px;
    background: #f0f7ff;
    border-left: 4px solid #1a73e8;
}

.section-title.past {
    background: #fafafa;
    border-left-color: #999;
    color: #666;
}

.section-title.sh-section {
    background: #fff8e1;
    border-left-color: #f57c00;
    color: #e65100;
}

.section-desc {
    color: #666;
    font-size: 0.85em;
    margin: 0 0 12px;
    padding-left: 12px;
}

.subsection-title {
    font-size: 0.95em;
    color: #555;
    margin: 16px 0 8px;
    padding-left: 12px;
    font-weight: 600;
}

.subsection-title.past {
    color: #999;
}

/* === 保有者カード === */
.holder-card {
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 14px 16px;
    margin-bottom: 10px;
    background: #fafbfc;
}

.holder-card.past {
    background: #fafafa;
    opacity: 0.85;
}

.holder-main {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
}

.ratio {
    font-size: 1.3em;
    font-weight: bold;
    color: #1a73e8;
    min-width: 80px;
}

.ratio.past {
    color: #999;
    font-size: 1.1em;
}

.change-up {
    color: #d32f2f;
    font-size: 0.9em;
}

.change-down {
    color: #2e7d32;
    font-size: 0.9em;
}

.filer-name {
    font-weight: 500;
    flex: 1;
    min-width: 200px;
}

.holder-meta {
    font-size: 0.85em;
    color: #666;
    margin-top: 4px;
}

.tag {
    display: inline-block;
    padding: 2px 8px;
    margin-right: 4px;
    font-size: 0.75em;
    background: #e8eaf6;
    border-radius: 3px;
}

.tag.proposal {
    background: #ffe0b2;
    color: #e65100;
}

.tag.joint {
    background: #c8e6c9;
    color: #1b5e20;
}

.purpose {
    margin-top: 6px;
    font-size: 0.85em;
    color: #555;
}

.prev-ratio {
    color: #999;
    font-size: 0.85em;
}

/* === 大株主の状況テーブル (v2.6新規) === */
.sh-table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0;
    background: #fffdf5;
    font-size: 0.9em;
}

.sh-table thead th {
    background: #fff3cd;
    color: #5d4037;
    padding: 8px 10px;
    text-align: left;
    border-bottom: 2px solid #f57c00;
    font-weight: 600;
}

.sh-table tbody td {
    padding: 8px 10px;
    border-bottom: 1px solid #f0e6d2;
}

.sh-table tbody tr:hover {
    background: #fff8e1;
}

.sh-rank {
    width: 50px;
    text-align: center;
    font-weight: 600;
    color: #e65100;
}

.sh-name {
    word-break: break-all;
}

.sh-shares {
    text-align: right;
    font-family: 'Menlo', 'Courier New', monospace;
    white-space: nowrap;
}

.sh-ratio {
    width: 70px;
    text-align: right;
    font-weight: 600;
    color: #e65100;
    white-space: nowrap;
}

.sh-note {
    color: #999;
    font-size: 0.8em;
    margin-top: 8px;
    padding-left: 12px;
}

/* === 統計 === */
.summary {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #eee;
    color: #666;
    font-size: 0.85em;
    text-align: right;
}

/* === フッター === */
footer {
    max-width: 800px;
    margin: 32px auto 0;
    padding: 16px;
    text-align: center;
    color: #999;
    font-size: 0.8em;
}

/* === スマホ対応 === */
@media (max-width: 600px) {
    body {
        padding: 8px;
    }
    header h1 {
        font-size: 1.2em;
    }
    .subtitle {
        font-size: 0.85em;
    }
    #search-form {
        flex-direction: column;
    }
    .holder-main {
        flex-direction: column;
        align-items: flex-start;
    }
    .ratio {
        min-width: auto;
    }
    /* テーブルはスマホで横スクロール可能に */
    .sh-table {
        font-size: 0.8em;
    }
    .sh-name {
        max-width: 140px;
    }
}
