/* ==========================================================
   辞書 (dictionary/) のスタディ枠デザイン
   dictionary/index.php / dictionary/content/index.php / dictionary/request_sent.php で使う。
   共通部品は css/study_app.css。JP/EN で同一内容を保つこと。
   ========================================================== */

/* ---------- 上部: タイトル + 大きい検索ボックス ---------- */
.dc-hero {
    padding: 28px 32px 30px;
    border-radius: 24px;
    background: #eef4ee;
}
.dc-hero-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.dc-hero-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--sa-green);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dc-hero-icon .material-symbols-outlined { font-size: 32px; }
.dc-hero .sa-h1 { margin: 0 0 2px; }
.dc-hero .sa-lead { margin: 0; }

.dc-search {
    display: flex;
    align-items: stretch;
    gap: 0;
    max-width: 960px;
    background: #fff;
    border-radius: 999px;
    box-shadow: 0 2px 10px rgba(38, 74, 40, .10);
    overflow: hidden;
}
.dc-search-icon {
    display: flex;
    align-items: center;
    padding-left: 22px;
    color: #9aa89b;
}
.dc-search-icon .material-symbols-outlined { font-size: 26px; }
body.study-app .dc-search input[type=text] {
    flex: 1;
    min-width: 0;
    height: 60px;
    padding: 0 16px 0 12px;
    border: 0;
    outline: 0;
    background: transparent;
    box-shadow: none;
    font-family: var(--sa-font);
    font-size: 18px;
    color: var(--sa-text);
}
body.study-app .dc-search input[type=text]::placeholder { color: #a8a8a8; }
body.study-app .dc-search button {
    flex-shrink: 0;
    margin: 6px;
    padding: 0 28px;
    border: 0;
    border-radius: 999px;
    background: var(--sa-green);
    color: #fff;
    font-family: var(--sa-font);
    font-size: 16px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}
body.study-app .dc-search button:hover { background: var(--sa-green-light); }
.dc-search button .material-symbols-outlined { font-size: 22px; }
.dc-search:focus-within { box-shadow: 0 0 0 3px rgba(55, 100, 57, .25), 0 2px 10px rgba(38, 74, 40, .10); }

.dc-hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* ---------- 2カラム (本文 + サイド) ---------- */
.dc-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 32px;
    margin-top: 28px;
    align-items: start;
}
.dc-main { min-width: 0; }
.dc-side { min-width: 0; display: grid; gap: 20px; }

/* ---------- セクション見出し ---------- */
.dc-sec { margin-bottom: 32px; }
.dc-sec-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-bottom: 14px;
}
.dc-sec-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 19px;
    font-weight: 900;
    color: var(--sa-text);
    word-break: break-word;
}
.dc-sec-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e6f0e6;
    color: var(--sa-green);
}
.dc-sec-icon .material-symbols-outlined { font-size: 22px; }
.dc-sec-icon.is-blue { background: #e4f1f7; color: var(--sa-blue-dark); }
.dc-sec-icon.is-orange { background: #fdf0e0; color: var(--sa-orange-dark); }
.dc-sec-icon.is-maroon { background: #f6e6ea; color: var(--sa-purple); }
.dc-kw { color: var(--sa-green); }
.dc-count { font-size: 13px; font-weight: 700; color: var(--sa-muted); }

/* 北部/南部 (単語帳・クイズの .vw-source と同じ見た目。style.css の .option-source の背景画像・左余白は打ち消す) */
.dc-source {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px 4px 12px;
    border: 2px solid var(--sa-line);
    border-radius: 12px;
    background: #fff;
    color: var(--sa-muted);
    flex-shrink: 0;
}
.dc-source .material-symbols-outlined { font-size: 20px; }
body.study-app .dc-source select {
    height: 32px;
    width: auto;
    min-width: 0;
    margin: 0;
    padding: 0 2px;
    border: 0;
    background: transparent;
    font-family: var(--sa-font);
    font-size: 14px;
    font-weight: 800;
    color: var(--sa-text);
    cursor: pointer;
}

/* ---------- 単語カード ---------- */
.dc-cards { display: grid; gap: 14px; }
.dc-cards.is-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dc-card {
    padding: 20px 22px;
    border-radius: var(--sa-radius);
    background: #f5f7f5;
}
.dc-card-top { display: flex; align-items: flex-start; gap: 14px; }
.dc-card-main { flex: 1; min-width: 0; }
.dc-word {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 26px;
    font-weight: 900;
    line-height: 1.3;
    color: var(--sa-text);
    word-break: break-word;
}
.dc-cards.is-grid .dc-word { font-size: 22px; }
.dc-mean { margin-top: 10px; font-size: 15px; line-height: 1.8; color: var(--sa-text); }
.dc-mean-label {
    display: block;
    margin-bottom: 2px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .06em;
    color: var(--sa-green);
}
.dc-pos {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 22px;
    margin-right: 8px;
    padding: 0 8px;
    border-radius: 7px;
    background: #fff;
    color: var(--sa-muted);
    font-size: 12px;
    font-weight: 800;
    vertical-align: 1px;
}
.dc-pos:empty { display: none; }
.dc-example {
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    background: #fff;
    font-size: 15px;
    line-height: 1.7;
}
.dc-example-vi { font-weight: 800; color: var(--sa-text); }
.dc-example-tr { margin-top: 2px; font-size: 14px; color: var(--sa-muted); }

/* 音声ボタン (.audioPlay > audio + .audio_btn の構造は main.js が前提にしているので変えない) */
body.study-app .dc-word .audioPlay { display: inline-flex; }
body.study-app .dc-word .audio_btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--sa-blue);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
body.study-app .dc-word .audio_btn:active { transform: translateY(1px); box-shadow: none; }
body.study-app .dc-word .audio_btn img { display: none; }
body.study-app .dc-word .audio_btn::before {
    content: 'volume_up';
    font-family: 'Material Symbols Outlined';
    font-size: 24px;
    font-weight: normal;
    color: #fff;
    font-variation-settings: 'FILL' 1;
    -webkit-font-feature-settings: 'liga';
    font-feature-settings: 'liga';
}

/* マイ単語トグル (input.tango_register + label は my_tango.js が前提。見た目だけ変える) */
.dc-bookmark { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.dc-bookmark-label { font-size: 11px; font-weight: 800; color: #9a9a9a; white-space: nowrap; }
body.study-app .dc-bookmark .toggle { justify-content: center; }
body.study-app .dc-bookmark .toggle input[type=checkbox] { position: absolute; opacity: 0; width: 0; height: 0; }
body.study-app .dc-bookmark .toggle label {
    display: block;
    width: 48px;
    height: 28px;
    margin: 0;
    background: #dcdfdc;
    border-radius: 999px;
}
body.study-app .dc-bookmark .toggle label:after { top: 4px; left: 4px; width: 20px; height: 20px; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
body.study-app .dc-bookmark .toggle input:checked + label { background: var(--sa-green-light); }
body.study-app .dc-bookmark .toggle input:checked + label:after { left: calc(100% - 4px); }

.dc-mytango-link { display: flex; justify-content: flex-end; margin-top: 12px; }

/* ---------- フレーズ ---------- */
.dc-phrases {
    padding: 6px 22px;
    border-radius: var(--sa-radius);
    background: #f5f7f5;
}
.dc-phrase { padding: 14px 0; }
.dc-phrase + .dc-phrase { border-top: 1px solid #e3e8e3; }
.dc-phrase-vi { font-size: 15px; font-weight: 800; line-height: 1.6; color: var(--sa-text); }
.dc-phrase-tr { margin-top: 2px; font-size: 14px; line-height: 1.6; color: var(--sa-muted); }
.dc-empty-note { padding: 14px 0; font-size: 14px; color: var(--sa-muted); }

/* ---------- 検索前 / 見つからない ---------- */
.dc-state {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 28px 32px;
    border-radius: 24px;
    background: #f5f7f5;
}
.dc-state-img { flex-shrink: 0; width: 180px; }
.dc-state-img img { display: block; width: 100%; height: auto; }
.dc-state-icon {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: #e6f0e6;
    color: var(--sa-green);
    display: flex;
    align-items: center;
    justify-content: center;
}
.dc-state-icon .material-symbols-outlined { font-size: 40px; }
.dc-state-body { flex: 1; min-width: 0; }
.dc-state-title { margin: 0 0 6px; font-size: 20px; font-weight: 900; color: var(--sa-text); word-break: break-word; }
.dc-state-text { margin: 0; font-size: 15px; line-height: 1.7; color: var(--sa-muted); }
.dc-hints { margin: 16px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.dc-hints li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    background: #fff;
    font-size: 13px;
    font-weight: 700;
    color: var(--sa-text);
}
.dc-hints .material-symbols-outlined { font-size: 18px; color: var(--sa-orange-dark); }
.dc-state-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.dc-errors { margin: 12px 0 0; font-size: 14px; color: var(--sa-red-dark); word-break: break-word; }

/* ---------- 索引 ---------- */
.dc-panel {
    padding: 20px 22px;
    border-radius: 20px;
    background: #f5f7f5;
}
.dc-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 900;
    color: var(--sa-text);
}
.dc-panel-title .material-symbols-outlined { font-size: 20px; color: var(--sa-green); }
.dc-alpha { display: flex; flex-wrap: wrap; gap: 6px; }
.dc-alpha a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 6px;
    border-radius: 10px;
    background: #fff;
    color: var(--sa-green-dark);
    font-size: 15px;
    font-weight: 800;
    text-decoration: none;
    transition: background .15s, color .15s;
}
.dc-alpha a:hover,
.dc-alpha a.active { background: var(--sa-green); color: #fff; text-decoration: none; }

/* 索引ページ: 単語一覧 */
.dc-index-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}
.dc-index-grid a {
    display: block;
    padding: 12px 16px;
    border-radius: 12px;
    background: #f5f7f5;
    color: var(--sa-text);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    text-decoration: none;
    word-break: break-word;
    transition: background .15s, color .15s;
}
.dc-index-grid a:hover { background: #e6f0e6; color: var(--sa-green-dark); text-decoration: none; }

/* ---------- 送信完了 ---------- */
.dc-thanks {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 28px 32px;
    border-radius: 24px;
    background: #fdf3e6;
}
.dc-thanks .dc-state-icon { background: #fff; color: var(--sa-orange-dark); }

/* ---------- サイド: バナー ---------- */
.dc-banner { display: block; border-radius: 16px; overflow: hidden; }
.dc-banner img { display: block; width: 100%; height: auto; }
.dc-ad { margin-top: 8px; min-width: 0; }
.dc-cta .sa-btn { margin-top: 14px; }

/* ---------- マイ単語登録のポップアップ (my_tango.js が .popup / #msg / #close を使う) ---------- */
body.study-app .popup { z-index: 9998; }
body.study-app .contentPopup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(420px, calc(100% - 32px));
    padding: 24px;
    border-radius: 20px;
    text-align: center;
    font-family: var(--sa-font);
}
body.study-app .contentPopup #msg { font-size: 16px; font-weight: 700; color: var(--sa-text); margin: 0 0 18px; white-space: pre-wrap; }
body.study-app .contentPopup #close {
    min-width: 140px;
    min-height: 44px;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    background: var(--sa-green);
    cursor: pointer;
}

/* ---------- レスポンシブ ---------- */
@media (max-width: 1180px) {
    .dc-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; }
    .dc-cards.is-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
    .dc-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
    .dc-hero { padding: 20px 16px 22px; border-radius: 20px; }
    .dc-hero-head { gap: 12px; margin-bottom: 16px; }
    .dc-hero-icon { width: 46px; height: 46px; border-radius: 14px; }
    .dc-hero-icon .material-symbols-outlined { font-size: 26px; }
    .dc-hero .sa-h1 { font-size: 22px; }
    .dc-hero .sa-lead { font-size: 13px; }
    .dc-search-icon { display: none; }
    body.study-app .dc-search input[type=text] { height: 52px; padding: 0 8px 0 18px; font-size: 16px; }
    body.study-app .dc-search button { margin: 5px; padding: 0 16px; }
    .dc-search-btn-text { display: none; }
    .dc-layout { margin-top: 20px; }
    .dc-sec-title { font-size: 17px; }
    .dc-sec-icon { width: 32px; height: 32px; }
    .dc-card { padding: 16px; }
    .dc-word { font-size: 22px; gap: 10px; }
    .dc-cards.is-grid .dc-word { font-size: 20px; }
    .dc-phrases { padding: 4px 16px; }
    .dc-state,
    .dc-thanks { flex-direction: column; align-items: flex-start; gap: 16px; padding: 22px 18px; }
    .dc-state-img { width: 130px; align-self: center; }
    .dc-panel { padding: 16px; }
    .dc-index-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
