/* ======================================
   通じる！かんたん中国語会話
====================================== */

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

body{
    font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
    background:#f6f7fb;
    color:#333;
    max-width:600px;
    margin:auto;
}

/* ------------------------------
   ヘッダー
------------------------------ */

.header{
    background:#ffffff;
    padding:15px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    position:sticky;
    top:0;
    z-index:100;
    box-shadow:0 2px 8px rgba(0,0,0,.08);
}

.header h1{
    font-size:22px;
    color:#e85d8b;
}

#reviewButton{
    border:none;
    background:#ffff0b;
    padding:10px 18px;
    border-radius:25px;
    font-size:15px;
    color :green;
    cursor:pointer;
}

/* ------------------------------
   メイン
------------------------------ */

main{

    padding:15px;

    padding-bottom:90px;

}


h2{
    margin-bottom:15px;
}

h3{
    text-align:center;
    margin:20px 0;
    font-size:26px;
}

/* ------------------------------
   一覧
------------------------------ */

#conversationList{
    display:flex;
    flex-direction:column;
    gap:15px;
}

.card{
    background:#fff;
    border-radius:16px;
    padding:14px 16px;
    display:flex;
    align-items:center;
    gap:15px;
    box-shadow:0 2px 10px rgba(0,0,0,.08);
    cursor:pointer;
}

.card img{
    width:80px;
    height:80px;
    object-fit:cover;
    border-radius:12px;
    flex-shrink:0;
}


.cardText{

    flex:1;

}

.cardTitle{
    font-size:18px;
    font-weight:bold;
    color:#333;
}

.cardSub{
    margin-top:6px;
    color:#666;
    font-size:17px;
    line-height:1.4;
}



/* ------------------------------
   会話画面
------------------------------ */

.topBar{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:15px;
}

.topBar button{
    border:none;
    background:#ffffff;
    font-size:22px;
    width:45px;
    height:45px;
    border-radius:50%;
    cursor:pointer;
}

.imageArea{
    margin:20px 0;
    text-align:center;
}

.imageArea img{
    width:100%;
    border-radius:15px;
    box-shadow:0 3px 10px rgba(0,0,0,.15);
}

/* ------------------------------
   会話
------------------------------ */

#conversationArea{
    display:flex;
    flex-direction:column;
    gap:20px;
    margin-top:20px;
}

.dialog{
    background:white;
    padding:18px;
    border-radius:15px;
    box-shadow:0 2px 10px rgba(0,0,0,.08);
}

.speaker{
    color:#ff4081;
    font-size:22px;
    font-weight:bold;
}

.zh{
    font-size:28px;
    margin-top:10px;
}

.pinyin{
    color:#ff00d0;
    margin-top:5px;
    font-size:20px;
}

.jp{
    color:#1976d2;
    margin-top:10px;
    font-size:22px;
}

/* ------------------------------
   ボタン
------------------------------ */

.audioButtons,
.bottomButtons{

    display:flex;
    align-items:center;
    justify-content:space-between;
    margin-top:20px;
}

.audioButtons button,
.bottomButtons button{

    border:none;
    background:#8fcff3;
    color:white;

    border-radius:14px;

    padding:12px 22px;

    font-size:18px;

    font-weight:600;

    cursor:pointer;

    transition:.2s;

}

.speedButtons{

    display:flex;

    gap:8px;

}

.speedButtons button{

    background:#8fcff3;

    color:#ffffff;

    border:none;

    border-radius:10px;

    padding:10px 18px;

    font-size:16px;

    font-weight:600;

    cursor:pointer;

    transition:.2s;

}

.reviewArea button{

    background:#ffd54f;
    color:#333;

}

/* ------------------------------
   スマホ
------------------------------ */

@media(max-width:600px){

.header h1{

    font-size:18px;

}

.card img{

    width:75px;
    height:75px;

}

.zh{

    font-size:24px;

}

.jp{

    font-size:20px;

}

.audioButtons{
    gap:6px;
}

.speedButtons{
    flex:3;
    gap:6px;
}

.speedButtons button{
    flex:1;
    padding:10px 4px;
    font-size:14px;
    white-space:nowrap;
}

#playButton{
    flex:1;
    padding:10px 4px;
    font-size:14px;
    white-space:nowrap;
}

}

/* ------------------------------
   下部タブ
------------------------------ */

.bottomTab{

    position:fixed;

    left:0;
    right:0;
    bottom:0;

    max-width:600px;

    margin:auto;

    height:65px;

    display:flex;

    background:#ffffff;

    border-top:1px solid #eeeeee;

    box-shadow:0 -2px 8px rgba(0,0,0,.08);

}

.bottomTab button{

    flex:1;

    border:none;

    background:white;

    color:#e85d8b;

    font-size:20px;

    cursor:pointer;

}

.bottomTab button:hover{

    background:#fff3f6;

}

/* ------------------------------
   カード右側の矢印
------------------------------ */

.cardArrow{

    margin-left:auto;

    display:flex;

    align-items:center;

    justify-content:center;

    font-size:28px;

    color:#edace4;

    font-weight:600;

    width:36px;

    flex-shrink:0;

}

/* ======================================
   パスワード認証画面
====================================== */

#loginScreen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.loginBox {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    padding: 32px 24px;
    border-radius: 18px;
    box-shadow: 0 4px 20px rgba(0,0,0,.10);
    text-align: center;
}

.loginBox h2 {
    color: #e85d8b;
    font-size: 24px;
    margin-bottom: 12px;
}

.loginBox p {
    color: #666;
    margin-bottom: 20px;
}

#passwordInput {
    width: 100%;
    padding: 14px 16px;
    font-size: 18px;
    border: 1px solid #ddd;
    border-radius: 12px;
    outline: none;
    margin-bottom: 14px;
}

#passwordInput:focus {
    border-color: #e85d8b;
}

#loginButton {
    width: 100%;
    border: none;
    background: #e85d8b;
    color: white;
    padding: 14px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
}

#loginButton:active {
    transform: scale(.98);
}

#loginError {
    color: #d32f2f;
    font-size: 14px;
    margin-top: 14px;
    min-height: 20px;
}

/* 会話音声の再生位置 */
.audioProgress {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding: 8px 10px;
    background: #f1f2f3;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    width: 100%;
}
#audioToggle {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: #454a50;
    font-size: 18px;
    cursor: pointer;
}
.audioTime {
    flex-shrink: 0;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    color: #555;
    white-space: nowrap;
}
#audioSeek {
    --audio-progress: 0%;
    -webkit-appearance: none;
    appearance: none;
    flex: 1 1 0;
    min-width: 0;
    width: 100%;
    height: 44px;
    background: transparent;
    cursor: pointer;
}
#audioSeek::-webkit-slider-runnable-track {
    height: 5px;
    border-radius: 5px;
    background: linear-gradient(to right, #777 var(--audio-progress), #d3d5d8 var(--audio-progress));
}
#audioSeek::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    margin-top: -6.5px;
    border-radius: 50%;
    background: #666;
    border: 2px solid #fff;
}
#audioSeek::-moz-range-track {
    height: 5px;
    border-radius: 5px;
    background: #d3d5d8;
}
#audioSeek::-moz-range-progress { height: 5px; background: #777; }
#audioSeek::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #666;
}
#audioSeek:disabled { opacity: .45; cursor: default; }
#audioToggle:focus-visible, #audioSeek:focus-visible {
    outline: 2px solid #e85d8b;
    outline-offset: 2px;
}
#audioError { margin-top: 8px; font-size: 13px; color: #b3261e; }
