/* ベース：iPhoneのシステムフォントを最優先 */
body { 
    margin: 0; 
    background: #fff; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: flex;                                                                                                                                                                                                                                                                          
    justify-content: center;
    color: #161823;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* 全画面透明リンク */
.global-link { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 9999; }

/* メインコンテナ（iPhoneの幅を意識） */
.tiktok-ui-container { 
    width: 100%;
    max-width: 480px; /* iPhone Pro Max等の幅に対応 */
    min-height: 100vh;
    background: #fff;
    padding-top: 50px; /* ヘッダー分 */
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
}

/* ヘッダー完全再現 */
.header { 
    position: fixed; top: 0; width: 100%; max-width: 480px; height: 50px;
    display: flex; align-items: center; padding: 0 12px; background: #fff;
    border-bottom: 0.5px solid rgba(22, 24, 35, 0.12); z-index: 100; box-sizing: border-box;
}

.header-left, .header-right { display: flex; align-items: center; z-index: 2; }
.header-right { margin-left: auto; gap: 14px; }
.back-icon, .bell-icon, .share-icon { width: 24px; height: 24px; cursor: pointer; }
/* 右矢印アイコンのスタイルリセット */
.share-icon { 
    width: 24px; 
    height: 24px; 
    transform: none; /* 回転を解除 */
    cursor: pointer;
}

/* ヘッダータイトル（おやすみ）の中央配置を修正 */
.header-title {
    position: absolute; left: 50%; transform: translateX(-50%);
    text-align: center;
    width: 60%; /* 幅を確保 */
    z-index: 1;
}
.header-name { font-size: 17px; font-weight: 700; color: #161823; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-id { font-size: 11px; color: #161823; font-weight: 500; margin-top: -1px; }

/* プロフィール情報エリア */
.profile-info { padding-top: 14px; }

/* アイコン（icon.jpg） */
.avatar-container { display: flex; justify-content: center; margin-bottom: 8px; }
.avatar-img { 
    width: 96px; height: 96px; border-radius: 50%;
    border: 0.5px solid rgba(22, 24, 35, 0.06); object-fit: cover;
}

.name-id-container { text-align: center; margin-bottom: 20px; }
.full-name { font-size: 18px; font-weight: 700; margin-bottom: 3px; color: #161823; }
.full-id { font-size: 14px; font-weight: 600; color: #161823; }

/* 数値データ（フォロー、フォロワー、いいね） */
/* 数値コンテナ：全体を内側に寄せる設定 */
.stats-container { 
    display: flex; 
    justify-content: center; 
    align-items: center;
    margin-bottom: 22px; /* 下のボタンとの間隔 */
    padding: 0 50px; /* 左右の数値を内側に寄せるために数値を大きく（重要） */
}

.stat-item { 
    flex: 1;
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    position: relative;
    padding: 0 4px;
}

/* 縦の仕切り線（位置と高さを微調整） */
.stat-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 25%; /* 線を少し短くして中央に寄せる */
    height: 50%;
    width: 0.5px;
    background-color: rgba(22, 24, 35, 0.12);
}

/* 数字部分 */
.stat-item strong { 
    font-size: 17px; 
    font-weight: 700; 
    color: #161823;
    line-height: 1.1;
    letter-spacing: -0.5px; /* 数字の間隔を少し詰める */
}

/* 文字部分 */
.stat-item span { 
    font-size: 12px; 
    color: rgba(22, 24, 35, 0.5); 
    margin-top: 6px; /* 数字との上下間隔 */
    white-space: nowrap; /* 折り返し防止 */
}

/* ボタンセクション */
.action-buttons { 
    display: flex; justify-content: center; gap: 6px; padding: 0 24px; margin-bottom: 16px;
}
.btn { 
    background: #f1f1f2; height: 44px; display: flex; justify-content: center;
    align-items: center; border-radius: 4px; font-weight: 600; cursor: pointer; color: #161823;
}
.btn-follow { flex: 2; font-size: 15px; color: #fff; background-color: #fe2c55; /* TikTokレッド */ max-width: 140px;}
.btn-message { flex: 2; font-size: 15px; max-width: 140px; background:rgba(22, 24, 35, 0.03); }
.btn-more { width: 44px; flex-shrink: 0; background:rgba(22, 24, 35, 0.03); }
.btn-more svg { width: 18px; height: 18px; }

/* 自己紹介エリア（バイオ） */
.bio-container { text-align: center; padding: 0 32px; margin-bottom: 16px; font-size: 14px; color: #161823; }
.bio-text { margin: 0 0 6px 0; line-height: 1.5; }
.bio-link { margin: 0 0 6px 0; font-weight: 500; font-size: 13px; color: #161823; }
.live-status { margin: 0; font-weight: 600; color: #161823; }
.live-icon { margin-right: 4px; }

/* 動画タブメニュー */
.video-tabs { display: flex; border-bottom: 0.5px solid rgba(22, 24, 35, 0.12); margin-top: 10px; }
.tab-item { flex: 1; height: 44px; display: flex; justify-content: center; align-items: center; cursor: pointer; position: relative; }
.tab-item svg { width: 22px; height: 22px; }
.tab-item.active::after { 
    content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 2px;
    background-color: #161823;
}
.tab-item-liked svg { fill: #8a8b91; }

/* 動画グリッド（▶マークとドロップシャドウの再現） */
.video-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: #fff; }
.grid-item { aspect-ratio: 3 / 4; position: relative; background-size: cover; background-position: center; background-color: #f1f1f2; overflow: hidden; }

/* 「トップ」ラベル（画像に合わせて適宜） */
.top-label { 
    position: absolute; top: 0; left: 0; background-color: #fe2c55; color: #fff;
    font-size: 10px; font-weight: 700; padding: 2px 6px; border-bottom-right-radius: 4px;
}

/* 再生数（▶マークのSVGを再現） */
.view-count { 
    position: absolute; bottom: 8px; left: 8px; color: #fff; font-size: 13px; font-weight: 600;
    display: flex; align-items: center; gap: 2px;
    text-shadow: 0 0.5px 1px rgba(0, 0, 0, 0.6); /* 本物のドロップシャドウ */
}
.view-count svg { width: 14px; height: 14px; margin-right: -1px;}