/* ========================================
   CureLink Profile CSS
   プロフィール帳専用
======================================== */

body{
    font-family:sans-serif;
    min-height:100vh;
    background-attachment:fixed;

    color:#444;
}

.container{
    background:white;
    overflow:hidden;
    max-width:900px;
    margin:0px auto;
    border-radius:32px;
    box-shadow:
        0 10px 40px rgba(0,0,0,0.12);
}

body.bg-sakura{
    position:relative;
}

body.bg-sakura::before{
    content:'';
    position:fixed;
    inset:0;
    pointer-events:none;
    z-index:1;
}

.banner-wrap{
    width:100%;
    height:260px;
    overflow:hidden;
    position:relative;
}

.banner{
    width:100%;
    position:relative;
    display:block;
}

.content{
    padding:16px 40px 40px;
}

.avatar{
    width:150px;
    height:150px;

    border-radius:50%;
    border:6px solid white;

    object-fit:contain;

    background:white;
}

h1{
    color:var(--main);
    margin-bottom:8px;
}

.username{
    color:#888;
}

.field{
    margin-top:20px;

    background:var(--sub2);

    padding:20px;

    border-radius:20px;

    line-height:1.8;
}

.tabs{
    display:flex;

    gap:12px;

    margin-top:36px;

    margin-bottom:24px;

    flex-wrap:wrap;
}

.tab-button{
    padding:12px 20px;

    border:none;

    border-radius:16px;

    background:var(--main);

    color:white;

    cursor:pointer;

    font-weight:bold;

    transition:0.2s;
}

.tab-button:hover{
    transform:translateY(-2px);
}

.tab-button.active{
    background:var(--main);
    color:white;
}

.tab-content{
    display:none;
}

.tab-content.active{
    display:block;
}

.field-name{
    color:var(--main);
    font-weight:bold;
    margin-bottom:12px;
    font-size:18px;
}

.edit-button{

    display:inline-block;

    margin-top:24px;

    padding:14px 22px;

    border-radius:18px;

    background:var(--main);

    color:white;

    text-decoration:none;

    font-weight:bold;

    box-shadow:
        0 6px 20px rgba(255,102,170,0.25);

}

.empty{
    color:#999;
    line-height:1.8;
}

.markdown{
    line-height:1.9;
}

.markdown h1,
.markdown h2,
.markdown h3{
    color:var(--main);
    margin-top:24px;
}

.markdown p{
    margin:12px 0;
}

.markdown ul,
.markdown ol{
    padding-left:24px;
}

.markdown blockquote{
    margin:16px 0;
    padding:12px 18px;
    background:white;
    border-left:4px solid var(--main);
    border-radius:12px;
}

.markdown code{
    background:white;
    padding:2px 6px;
    border-radius:8px;
}

.markdown pre{
    background:white;
    padding:16px;
    border-radius:16px;
    overflow:auto;
}

.markdown img{
    max-width:100%;
    border-radius:16px;
    margin-top:12px;
}

.markdown a{
    color:var(--main);
}

.youtube-wrap{
    position:relative;

    width:100%;

    padding-top:56.25%;

    margin-top:16px;

    border-radius:20px;

    overflow:hidden;

    background:#000;
}

.youtube-wrap iframe{
    position:absolute;

    top:0;
    left:0;

    width:100%;
    height:100%;
}

.diary-card{
    background:var(--sub2);

    border-top:6px solid var(--main);

    box-shadow:
        0 6px 20px rgba(
            0,
            0,
            0,
            0.06
        );
}

.diary-card h2{
    color:var(--main);
}

.diary-card p{
    color:#666;
}

.diary-button,
.album-button{
    display:block;

    background:var(--main);

    color:white;

    font-weight:bold;

    text-decoration:none;
}

.diary-thumb{

    width:280px;

    height:180px;

    object-fit:cover;

    border-radius:18px;

    display:block;

    margin:15px auto;

}

.diary-link{
    display:block;

    background:var(--main);

    color:white;

    text-align:center;

    padding:18px;

    border-radius:20px;

    text-decoration:none;

    font-weight:bold;
}

.top-nav a:hover{

    transform:translateY(-2px);

}

.profile-meta{
    margin-top:20px;
    max-width:340px;
}

.profile-qr-box{
    margin-top:16px;
    width:fit-content;
}

.qr-toggle{
    border:none;
    padding:12px 18px;
    border-radius:999px;
    background:var(--sub2);
    border:2px solid var(--main);
    color:var(--main);
    cursor:pointer;
    font-weight:bold;
    transition:0.2s;
}

.qr-toggle:hover{
    transform:translateY(-2px);
    box-shadow:0 8px 18px rgba(0,0,0,0.08);
}

.qr-area{
    margin-top:16px;
    padding:18px;
    background:white;
    border-radius:24px;
    box-shadow:0 8px 24px rgba(0,0,0,0.08);
    width:fit-content;
}

.qr-area img{
    display:block;
    margin:auto;
    border-radius:20px;
    border:3px solid var(--sub2);
    padding:8px;
    background:white;
}

.qr-link{
    margin-top:12px;
    color:var(--main);
    font-weight:bold;
    font-size:13px;
    word-break:break-all;
    max-width:260px;
}

.qr-area{
    animation:fadeIn 0.25s ease;
}

@keyframes fadeIn{
    from{
        opacity:0;
        transform:translateY(-8px);
    }
    to{
        opacity:1;
        transform:translateY(0);
    }
}

.short-bio{
    margin-top:18px;
    margin-bottom:18px;
    padding:18px 20px;
    background:var(--sub2);
    border-left:4px solid var(--main);
    border-radius:18px;
    line-height:1.8;
    white-space:pre-wrap;
    color:#444;
}

.sns-section{
    margin-top:24px;
}

.sns-section h3{
    color:var(--main);
}

.sns-item{
    margin-top:14px;
}

.sns-toggle{
    display:inline-flex;
    align-items:center;
    gap:10px;
    padding:10px 18px;
    border:2px solid var(--main);
    border-radius:999px;
    background:white;
    color:var(--main);
    font-weight:bold;
    cursor:pointer;
}

.sns-toggle:hover{
    background:var(--sub2);
}

.sns-item a{
    text-decoration:none;
    color:var(--main);
    font-weight:bold;
}

.sns-qr-btn{
    border:none;
    background:var(--sub2);
    border-radius:50%;
    width:32px;
    height:32px;
    cursor:pointer;
}

.sns-qr-area{
    margin-top:12px;
    margin-bottom:18px;
}

.sns-qr-area img{
    border-radius:16px;
    border:2px solid var(--sub2);
    padding:6px;
    background:white;
}

.card-style-cute .container{
    border-radius:32px;
    border:2px solid #ffd6e7;
    box-shadow:0 12px 30px rgba(255,105,180,0.15);
}

.card-style-glass .container{
    background:rgba(255,255,255,0.72);
    backdrop-filter:blur(14px);
    border:1px solid rgba(255,255,255,0.6);
}

.card-style-luxury .container{
    background:white;
    border:2px solid #d4af37;
    box-shadow:0 12px 36px rgba(212,175,55,0.18);
}

.card-style-idol .container{
    box-shadow:
        0 0 24px rgba(255,105,180,0.28),
        0 0 50px rgba(255,182,193,0.18);
    border:2px solid rgba(255,182,193,0.6);
}

.card-style-idol .field,
.card-style-idol .diary-card{
    box-shadow:
        0 0 14px rgba(255,105,180,0.18);
}

.card-style-glass .navbar{
    background:rgba(255,255,255,0.7);
    backdrop-filter:blur(12px);
}
.post{
    transition:0.25s;
}

.profile-edit-modal-overlay{
    display:none;
    position:fixed;
    inset:0;
    z-index:9000;
    background:rgba(0,0,0,0.45);
    align-items:flex-start;
    justify-content:center;
    overflow:auto;
    padding:24px 12px;
}

.profile-edit-modal-overlay.is-open{
    display:flex;
}

.profile-edit-modal-window{
    width:min(720px, 100%);
    background:#fff;
    border-radius:22px;
    overflow:hidden;
    box-shadow:0 20px 80px rgba(0,0,0,0.35);
}

.profile-edit-modal-header{
    position:sticky;
    top:0;
    z-index:20;
    height:68px;
    display:flex;
    align-items:center;
    gap:18px;
    padding:0 20px;
    background:#fff;
    border-bottom:1px solid #eff3f4;
}

.profile-edit-close-btn{
    width:42px;
    height:42px;
    border:none;
    border-radius:50%;
    background:transparent;
    color:#0f1419;
    font-size:36px;
    line-height:1;
    cursor:pointer;
}

.profile-edit-close-btn:hover{
    background:#eff3f4;
}

.profile-edit-modal-title{
    flex:1;
    font-size:24px;
    font-weight:900;
}

.profile-edit-save-btn{
    border:none;
    border-radius:999px;
    padding:10px 22px;
    background:#0f1419;
    color:#fff;
    font-size:16px;
    font-weight:800;
    cursor:pointer;
}

.profile-edit-image-area{
    position:relative;
    margin-bottom:80px;
}

.profile-edit-banner{
    position:relative;
    width:100%;
    aspect-ratio:3 / 1;
    background:#ddd;
    overflow:hidden;
}

.profile-edit-banner img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
    filter:brightness(0.75);
}

.banner-edit-btn{
    position:absolute;
    left:50%;
    top:50%;
    transform:translate(-50%, -50%);
    width:56px;
    height:56px;
    border:none;
    border-radius:50%;
    background:rgba(0,0,0,0.45);
    color:white;
    font-size:26px;
    cursor:pointer;
}

.profile-edit-icon{
    position:absolute;
    left:24px;
    bottom:-68px;
    width:136px;
    height:136px;
    border-radius:50%;
    border:5px solid #fff;
    overflow:hidden;
    background:#fff;
}

.profile-edit-icon img{
    width:100%;
    height:100%;
    object-fit:cover;
    filter:brightness(0.75);
}

.icon-edit-btn{
    position:absolute;
    inset:0;
    border:none;
    background:rgba(0,0,0,0.35);
    color:white;
    font-size:28px;
    cursor:pointer;
}

.profile-edit-modal-body{
    padding:0 20px 28px;
}

.x-field{
    display:block;
    border:1px solid #cfd9de;
    border-radius:8px;
    padding:12px 14px;
    margin-bottom:22px;
}

.x-field span{
    display:block;
    color:#536471;
    font-size:14px;
    font-weight:700;
    margin-bottom:8px;
}

.x-field textarea{
    width:100%;
    min-height:110px;
    border:none;
    outline:none;
    resize:vertical;
    font-size:20px;
    line-height:1.45;
}

.x-section{
    margin-top:24px;
}

.x-section h2{
    color:#0f1419;
    font-size:20px;
    margin-bottom:12px;
}

.sns-box{
    margin-top:16px;
    padding:16px;
    border-radius:16px;
    background:#f7f9f9;
    border:1px solid #eff3f4;
}

.sns-box input,
.sns-box select{
    width:100%;
    padding:12px;
    border:1px solid #cfd9de;
    border-radius:10px;
    box-sizing:border-box;
}

.add-btn,
.remove-btn{
    border:none;
    border-radius:999px;
    padding:10px 16px;
    margin-top:14px;
    color:#fff;
    background:#ff66aa;
    font-weight:700;
    cursor:pointer;
}

.remove-btn{
    background:#ff4d88;
}

.tab-setting-link{
    display:inline-block;
    margin-top:24px;
    color:#ff66aa;
    font-weight:800;
    text-decoration:none;
}

.crop-modal{
    display:none;
    position:fixed;
    inset:0;
    z-index:10000;
    padding:20px;
    background:rgba(0,0,0,0.55);
    align-items:center;
    justify-content:center;
}

.crop-modal.is-open{
    display:flex;
}

.crop-modal-content{
    width:min(920px, 100%);
    background:white;
    border-radius:28px;
    padding:24px;
    box-shadow:0 20px 60px rgba(0,0,0,0.25);
}

.crop-area{
    width:100%;
    max-height:65vh;
    overflow:hidden;
    border-radius:20px;
    background:#fff7fb;
}

.crop-area img{
    display:block;
    max-width:100%;
}

.crop-actions{
    display:flex;
    justify-content:flex-end;
    gap:12px;
    margin-top:20px;
}

.crop-cancel-btn{
    border:none;
    border-radius:999px;
    padding:12px 20px;
    background:#ddd;
    color:#333;
    cursor:pointer;
}

.crop-apply-btn{
    border:none;
    border-radius:999px;
    padding:12px 20px;
    background:#ff66aa;
    color:white;
    cursor:pointer;
}

.profile-top-row{
    display:flex;
    align-items:flex-start;
    gap:28px;
    margin-top:20px;
    margin-bottom:24px;
}

.profile-top-row .avatar{
    flex-shrink:0;
}

.profile-side-bio{
    flex:1;
    margin-top:8px;
    margin-bottom:0;
    min-height:110px;
    display:flex;
    align-items:center;
    font-size:17px;
}

@media(max-width:700px){

    .profile-top-row{
        flex-direction:column;
        gap:16px;
    }

    .profile-side-bio{
        width:100%;
        min-height:auto;
    }

}

.section-title{
    margin-top:34px;
    margin-bottom:16px;
    color:var(--main);
    font-size:26px;
    font-weight:900;
}

.sns-clean-section,
.profile-share-section{
    margin-top:28px;
}

.sns-card-list{
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(260px, 1fr));
    gap:16px;
}

.sns-clean-card,
.profile-share-card{
    display:flex;
    gap:16px;
    align-items:flex-start;
    padding:18px;
    border-radius:24px;
    background:linear-gradient(
        135deg,
        var(--sub2),
        rgba(255,255,255,0.96)
    );
    border:1px solid var(--sub);
    box-shadow:0 8px 22px rgba(0,0,0,0.06);
}

.sns-icon,
.share-icon{
    width:52px;
    height:52px;
    flex-shrink:0;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:18px;
    background:var(--main);
    color:white;
    font-size:24px;
    font-weight:900;
    box-shadow:0 8px 18px rgba(0,0,0,0.08);
}

.sns-main,
.share-main{
    flex:1;
    min-width:0;
}

.sns-service-name,
.share-title{
    color:#333;
    font-size:18px;
    font-weight:900;
}

.sns-account,
.share-url{
    margin-top:4px;
    color:#888;
    font-size:15px;
    word-break:break-all;
}

.sns-actions{
    display:flex;
    gap:10px;
    margin-top:12px;
    flex-wrap:wrap;
}

.sns-action-btn,
.share-qr-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:38px;
    padding:8px 16px;
    border-radius:999px;
    border:2px solid var(--main);
    background:white;
    color:var(--main);
    text-decoration:none;
    font-weight:900;
    cursor:pointer;
    box-sizing:border-box;
    transition:0.2s;
}

.sns-action-btn:hover,
.share-qr-btn:hover{
    background:var(--main);
    color:white;
    transform:translateY(-2px);
}

.sns-clean-qr,
.profile-clean-qr{
    margin-top:16px;
    width:fit-content;
    padding:14px;
    border-radius:20px;
    background:white;
    border:2px solid var(--sub);
    box-shadow:0 8px 20px rgba(0,0,0,0.06);
}

.sns-clean-qr img,
.profile-clean-qr img{
    display:block;
    border-radius:14px;
    padding:6px;
    background:white;
    border:2px solid var(--sub2);
}

.sns-clean-qr p,
.profile-clean-qr p{
    margin:8px 0 0;
    color:#888;
    font-size:13px;
    text-align:center;
}

.profile-share-card{
    max-width:520px;
}

@media(max-width:700px){

    .sns-card-list{
        grid-template-columns:1fr;
    }

    .sns-clean-card,
    .profile-share-card{
        border-radius:20px;
    }

}

.profile-lower-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:28px;
    align-items:start;
    margin-top:36px;
}

.profile-lower-grid .sns-clean-section,
.profile-lower-grid .profile-share-section{
    margin-top:0;
}

.profile-lower-grid .section-title{
    margin-top:0;
}

.profile-lower-grid .sns-card-list{
    grid-template-columns:1fr;
}

.profile-lower-grid .profile-share-card{
    max-width:none;
}

@media(max-width:800px){

    .profile-lower-grid{
        grid-template-columns:1fr;
        gap:24px;
    }

}

body{
    background-size:cover;
    background-position:center top;
    background-repeat:no-repeat;
}

body::after{
    content:'';
    position:fixed;
    inset:0;
    z-index:-1;
    pointer-events:none;
    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,0.20),
            rgba(255,247,251,0.45)
        );
}

.container.profile-card{
    background:rgba(255,255,255,0.92);
    backdrop-filter:blur(8px);
}

.card-style-glass .container.profile-card{
    background:rgba(255,255,255,0.72);
    backdrop-filter:blur(14px);
}

html,
body{
    min-height:100%;
}

body{
    margin:0;
    background-size:cover !important;
    background-position:center center !important;
    background-repeat:no-repeat !important;
    background-attachment:fixed !important;
}

.container.profile-card{
    background:rgba(255,255,255,0.88) !important;
    backdrop-filter:blur(8px);
}

.field,
.short-bio,
.diary-card,
.sns-clean-card,
.profile-share-card{
    background:rgba(255,255,255,0.78) !important;
    backdrop-filter:blur(6px);
}

/* ========================================
   プロフィール帳 文字コントラスト修正
======================================== */

/* プロフィール帳全体の基本文字色 */
.container,
.container *{
    color:var(--text, #44313b);
}

/* メイン見出し・名前・セクションタイトルはテーマ色 */
.profile-name,
.container > h1,
.section-title,
.field-name,
.diary-card h2,
.sns-service-name,
.share-title{
    color:var(--main, #ff4d9d) !important;
    -webkit-text-fill-color:var(--main, #ff4d9d) !important;
}

/* 自己紹介・プロフィール本文・カード本文は読みやすい濃い文字 */
.bio,
.profile-bio,
.field,
.field *,
.short-bio,
.short-bio *,
.diary-card,
.diary-card *,
.sns-clean-card,
.profile-share-card{
    color:var(--text, #44313b) !important;
    -webkit-text-fill-color:var(--text, #44313b) !important;
}

/* 薄めの補足文字 */
.username,
.empty,
.diary-card p,
.sns-account,
.share-url,
.sns-clean-qr p,
.profile-clean-qr p{
    color:var(--muted, #8f7180) !important;
    -webkit-text-fill-color:var(--muted, #8f7180) !important;
}

/* カード類は白系背景で文字を見やすく */
.field,
.short-bio,
.diary-card,
.sns-clean-card,
.profile-share-card{
    background:rgba(255,255,255,0.84) !important;
    border-color:var(--border, #ffd6ea) !important;
    box-shadow:0 8px 24px var(--shadow, rgba(255,77,157,0.18)) !important;
}

/* テーマ色ボタンは白文字固定 */
.edit-button,
.diary-link,
.diary-button,
.album-button,
.tab-button,
.sns-action-btn.main,
.share-qr-btn.main{
    background:var(--main, #ff4d9d) !important;
    color:#ffffff !important;
    -webkit-text-fill-color:#ffffff !important;
    border-color:var(--main, #ff4d9d) !important;
}

/* ボタン内の文字も白固定 */
.edit-button *,
.diary-link *,
.diary-button *,
.album-button *,
.tab-button *,
.sns-action-btn.main *,
.share-qr-btn.main *{
    color:#ffffff !important;
    -webkit-text-fill-color:#ffffff !important;
}

/* 通常リンクはテーマ色 */
.container a:not(.edit-button):not(.diary-link):not(.diary-button):not(.album-button):not(.tab-button){
    color:var(--main, #ff4d9d) !important;
}

/* SNS・共有ボタン系 */
.sns-action-btn,
.share-qr-btn,
.qr-toggle,
.sns-toggle{
    background:rgba(255,255,255,0.9) !important;
    color:var(--main, #ff4d9d) !important;
    -webkit-text-fill-color:var(--main, #ff4d9d) !important;
    border:2px solid var(--main, #ff4d9d) !important;
}

/* hover時だけテーマ背景＋白文字 */
.sns-action-btn:hover,
.share-qr-btn:hover,
.qr-toggle:hover,
.sns-toggle:hover{
    background:var(--main, #ff4d9d) !important;
    color:#ffffff !important;
    -webkit-text-fill-color:#ffffff !important;
}

/* 最新日記カードのタイトル・本文 */
.latest-diary-title,
.diary-card-title{
    color:var(--main, #ff4d9d) !important;
    -webkit-text-fill-color:var(--main, #ff4d9d) !important;
}

.latest-diary-text,
.diary-card-text{
    color:var(--text, #44313b) !important;
    -webkit-text-fill-color:var(--text, #44313b) !important;
}

body{
    background-size:cover !important;
    background-position:center center !important;
    background-repeat:no-repeat !important;
    background-attachment:fixed !important;
}

.container.profile-card{
    background:rgba(255,255,255,0.84) !important;
    backdrop-filter:blur(8px);
}

/* ========================================
   Profile page background image
======================================== */

html,
body{
    min-height:100%;
}

body{
    background-size:cover !important;
    background-position:center center !important;
    background-repeat:no-repeat !important;
    background-attachment:fixed !important;
}

/* プロフィール帳本体を少し透過して、背景画像を見せる */
.container.profile-card{
    background:rgba(255,255,255,0.82) !important;
    backdrop-filter:blur(8px);
    -webkit-backdrop-filter:blur(8px);
}

/* 中の個別カードも白ベタで隠しすぎない */
.field,
.diary-card,
.sns-clean-card,
.profile-share-card,
.short-bio,
.tab-content{
    background:rgba(255,255,255,0.78) !important;
}

/* ========================================
   Profile fixed background layer
======================================== */

html,
body{
    min-height:100%;
}

body{
    position:relative;
    min-height:100vh;
    overflow-x:hidden;
}

.profile-bg-layer{
    position:fixed;
    inset:0;
    z-index:0;
    pointer-events:none;

    background-size:cover;
    background-position:center center;
    background-repeat:no-repeat;

    opacity:1;
}

/* 花びら・パーツは背景より上、カードより下 */
body.bg-sakura::before{
    z-index:1 !important;
}

/* プロフィール帳本体を背景レイヤーより上に出す */
.container.profile-card{
    position:relative;
    z-index:2;
    background:rgba(255,255,255,0.82) !important;
    backdrop-filter:blur(8px);
    -webkit-backdrop-filter:blur(8px);
}

/* ========================================
   sakura particle effect - more natural
======================================== */

body.bg-sakura{
    --particle-size-1: 72px;
    --particle-size-2: 58px;
    --particle-size-3: 46px;
}

/* ========================================
   Profile background layer / z-index
======================================== */

.profile-bg-layer{
    position:fixed;
    inset:0;
    z-index:0;
    pointer-events:none;

    background-size:cover;
    background-position:center center;
    background-repeat:no-repeat;
}

body.bg-sakura::before,
body.bg-sakura::after,
body.bg-stars::before,
body.bg-stars::after,
body.bg-star::before,
body.bg-star::after,
body.bg-snow::before,
body.bg-snow::after{
    z-index:1;
}

.container.profile-card{
    position:relative;
    z-index:2;
}

/* ========================================
   Profile photo diary image fix
   縦長画像を見切れさせない
======================================== */

.profile-card .diary-preview img,
.profile-card .photo-diary img,
.profile-card .photo-diary-image,
.profile-card .latest-diary img,
.profile-card .diary-thumbnail,
.profile-card .diary-card img{
    width:100% !important;
    max-width:560px !important;
    height:auto !important;
    max-height:420px !important;

    display:block !important;
    margin:0 auto !important;

    object-fit:contain !important;
    object-position:center center !important;

    border-radius:18px;
    background:rgba(255,255,255,0.65);
}

@media (max-width:768px){

    .profile-card .diary-preview img,
    .profile-card .photo-diary img,
    .profile-card .photo-diary-image,
    .profile-card .latest-diary img,
    .profile-card .diary-thumbnail,
    .profile-card .diary-card img{
        max-width:100% !important;
        max-height:70vh !important;
        object-fit:contain !important;
    }

}