/* 诗意工坊 · 方块风(类我的世界) × 唐风 */
/* ---- 热键栏 ---- */
#g2dc-hotbar {
    position: fixed;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1500;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: rgba(30, 22, 12, 0.82);
    border: 2px solid #0f0a05;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
    cursor: pointer;
    backdrop-filter: blur(2px);
}
#g2dc-hotbar:hover { border-color: #DAA520; }
.g2dc-hb-hint { color: #DAA520; font-size: 15px; margin-left: 4px; }

/* ---- 意象方块 ---- */
.g2dc-block {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    background: linear-gradient(145deg, var(--bc, #ccc), color-mix(in srgb, var(--bc, #ccc) 62%, #2b1c0e));
    border: 2px solid #221708;
    border-radius: 6px;
    box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.35), inset -2px -2px 0 rgba(0, 0, 0, 0.3), 0 2px 5px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    user-select: none;
    transition: transform 0.12s ease;
    font-family: "SimSun", "STSong", serif;
}
.g2dc-block:hover { transform: scale(1.08); }
.g2dc-block i { font-style: normal; font-size: 19px; line-height: 1; }
.g2dc-block em { font-style: normal; font-size: 11px; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65); margin-top: 1px; }
.g2dc-block .n {
    position: absolute;
    right: -6px;
    bottom: -6px;
    min-width: 17px;
    height: 17px;
    padding: 0 3px;
    border-radius: 9px;
    background: #B03A2E;
    color: #fff;
    font-size: 10px;
    line-height: 17px;
    text-align: center;
    font-weight: bold;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.g2dc-block.unknown {
    background: linear-gradient(145deg, #5a4a36, #3a2e20);
    color: #DAA520;
    font-size: 20px;
    cursor: default;
}

/* ---- 工坊弹窗 ---- */
#g2dc-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(28, 20, 10, 0.66);
    backdrop-filter: blur(3px);
    padding: 16px;
}
#g2dc-modal.open { display: flex; }
.g2dc-card {
    width: 100%;
    max-width: 560px;
    max-height: 88vh;
    overflow-y: auto;
    background: #FDFAF5;
    border: 2px solid #2b1c0e;
    border-radius: 14px;
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.5), inset 0 0 0 1px #DAA520;
    font-family: "SimSun", "STSong", serif;
    animation: g2dcIn 0.28s cubic-bezier(0.34, 1.4, 0.64, 1);
}
@keyframes g2dcIn {
    from { opacity: 0; transform: translateY(20px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.g2dc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, #3a2a16, #5a3d1e);
    border-bottom: 2px solid #2b1c0e;
}
.g2dc-title { color: #F4D03F; font-size: 17px; letter-spacing: 6px; }
.g2dc-close {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid #DAA520;
    background: rgba(218, 165, 32, 0.15);
    color: #F4D03F;
    cursor: pointer;
    font-size: 14px;
}
.g2dc-close:hover { background: rgba(218, 165, 32, 0.35); }

.g2dc-tabs { display: flex; border-bottom: 1px solid #E8DCC8; background: #F5EDD9; }
.g2dc-tab {
    flex: 1;
    padding: 10px 0;
    border: none;
    background: none;
    font-size: 14px;
    letter-spacing: 2px;
    color: #8B7355;
    cursor: pointer;
    font-family: inherit;
    border-bottom: 3px solid transparent;
}
.g2dc-tab.active { color: #8B4513; border-bottom-color: #DAA520; background: #FDFAF5; font-weight: bold; }

.g2dc-pane { display: none; padding: 16px; }
.g2dc-pane.active { display: block; }

/* 合成区 */
.g2dc-slots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    background: #EFE6D0;
    border: 1px solid #D9C9A3;
    border-radius: 10px;
}
.g2dc-slots.shake { animation: g2dcShake 0.45s ease; }
@keyframes g2dcShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-7px); }
    55% { transform: translateX(6px); }
    80% { transform: translateX(-4px); }
}
.g2dc-slot {
    width: 52px;
    height: 52px;
    background: #DCD0B4;
    border: 2px dashed #A99878;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.g2dc-slot .g2dc-block { border-style: solid; }
.g2dc-slot.out { border: 2px solid #DAA520; background: #F8EFD4; }
.g2dc-arrow { color: #8B7355; font-size: 18px; }
.g2dc-craft-btns { display: flex; gap: 10px; justify-content: center; margin-top: 12px; }
.g2dc-btn {
    padding: 10px 30px;
    border-radius: 8px;
    border: 2px solid #2b1c0e;
    background: #F5EDD9;
    color: #5C4033;
    font-size: 15px;
    letter-spacing: 4px;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 3px 0 #2b1c0e;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.g2dc-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #2b1c0e; }
.g2dc-btn.primary { background: linear-gradient(135deg, #DAA520, #B8860B); color: #fff; }

/* 结果 */
.g2dc-result { margin-top: 14px; }
.g2dc-result:empty { display: none; }
.g2dc-success {
    background: #FBF6E9;
    border: 1px solid #DAA520;
    border-radius: 10px;
    padding: 14px;
    text-align: center;
    animation: g2dcIn 0.3s ease;
}
.s-badge {
    display: inline-block;
    padding: 3px 14px;
    border-radius: 12px;
    background: #B03A2E;
    color: #fff;
    font-size: 12px;
    letter-spacing: 2px;
    margin-bottom: 8px;
}
.s-badge.again { background: #8B7355; }
.s-title { font-size: 18px; color: #5C3317; margin-bottom: 8px; }
.s-title span { font-size: 13px; color: #a08c6d; margin-left: 8px; }
.s-poem { font-family: inherit; font-size: 14px; line-height: 2; color: #4a3728; white-space: pre-wrap; margin: 0 0 8px; }
.s-why { font-size: 12px; line-height: 1.8; color: #6b5b3b; text-align: left; background: #F5EDD9; border-radius: 8px; padding: 10px; }
.s-best { margin-top: 8px; font-size: 12px; color: #B8860B; }
.g2dc-fail {
    background: #F6E3E0;
    border: 1px solid #E5C0BA;
    color: #8f3a2e;
    border-radius: 10px;
    padding: 12px;
    font-size: 13px;
    text-align: center;
}

/* 背包 */
.g2dc-inv-title { margin: 16px 0 8px; font-size: 14px; color: #5C4033; letter-spacing: 2px; }
.g2dc-inv-title span { font-size: 12px; color: #a08c6d; }
.g2dc-inv {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    background: #EFE6D0;
    border: 1px solid #D9C9A3;
    border-radius: 10px;
    min-height: 76px;
}
.g2dc-empty { width: 100%; text-align: center; color: #a08c6d; font-size: 12px; padding: 16px 0; }

/* 自由拼诗 */
.g2dc-free-tip, .g2dc-book-tip { font-size: 12px; color: #8B7355; margin-bottom: 12px; line-height: 1.7; }
.free-line { font-size: 17px !important; color: #5C3317 !important; letter-spacing: 2px; }

/* 配方残卷 */
.g2dc-recipe {
    border: 1px solid #E0CD9E;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    background: #FBF6E9;
}
.g2dc-recipe.lock { background: #F3EDE0; border-style: dashed; opacity: 0.92; }
.r-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.r-head b { color: #5C3317; font-size: 15px; }
.r-head span { font-size: 12px; color: #8B7355; }
.r-blocks { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.r-blocks .plus { font-style: normal; color: #a08c6d; }
.r-blocks .g2dc-block { width: 38px; height: 38px; cursor: default; }
.r-blocks .g2dc-block i { font-size: 15px; }
.r-blocks .g2dc-block em { font-size: 10px; }
.r-poem { font-family: inherit; font-size: 13px; line-height: 1.9; color: #4a3728; white-space: pre-wrap; margin: 0 0 8px; }
.r-why { font-size: 12px; color: #6b5b3b; line-height: 1.7; background: #F5EDD9; border-radius: 8px; padding: 8px 10px; }

/* 残卷操作 · 迷你按钮 */
.r-acts { display: flex; gap: 8px; margin-top: 10px; justify-content: center; }
.g2dc-mini {
    padding: 5px 14px;
    border-radius: 14px;
    border: 1px solid #B8860B;
    background: linear-gradient(135deg, #FFF3D6, #F5E3B3);
    color: #7A5A17;
    font-size: 12px;
    letter-spacing: 1px;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.12s ease;
}
.g2dc-mini:hover { transform: translateY(-1px); background: linear-gradient(135deg, #FFE9B8, #F0D694); }
.g2dc-mini.done { border-color: #C9BBA0; background: #F3EDE0; color: #8B7355; cursor: default; }

/* 声望条 */
.g2dc-fame {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #3a2a16, #5a3d1e);
    border-radius: 10px;
    color: #F4D03F;
}
.g2dc-fame .fame-label { font-size: 12px; letter-spacing: 3px; color: #D9B87C; }
.g2dc-fame b { font-size: 16px; letter-spacing: 2px; }
.g2dc-fame .fame-num { margin-left: auto; font-size: 12px; color: #D9B87C; }

/* 诗碑 */
.g2dc-stele { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 14px; }
.g2dc-stone { display: flex; flex-direction: column; align-items: center; animation: g2dcIn 0.3s ease; }
.stone-cap {
    width: 86px;
    height: 14px;
    background: linear-gradient(180deg, #6E6257, #57504A);
    border-radius: 8px 8px 0 0;
    border: 1px solid #4a423b;
    border-bottom: none;
}
.stone-body {
    width: 86px;
    min-height: 128px;
    padding: 10px 6px;
    background: linear-gradient(180deg, #8A8075, #736A5F);
    border: 1px solid #4a423b;
    border-top: none;
    border-bottom: none;
    text-align: center;
    color: #F5EDD9;
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.28);
}
.stone-body b { display: block; font-size: 13px; letter-spacing: 1px; color: #FFE9A8; }
.stone-body span { display: block; font-size: 10px; color: #D9C9A3; margin: 3px 0 6px; }
.stone-body pre {
    font-family: inherit;
    font-size: 10px;
    line-height: 1.8;
    white-space: pre-wrap;
    margin: 0;
    color: #EFE6D0;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
}
.stone-base {
    width: 102px;
    height: 12px;
    background: linear-gradient(180deg, #57504A, #453e38);
    border: 1px solid #38322c;
    border-radius: 0 0 6px 6px;
}

/* 进度面板 */
.adv-summary { font-size: 13px; color: #8B7355; margin-bottom: 10px; letter-spacing: 1px; }
.g2dc-adv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.adv-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #E0CD9E;
    border-radius: 10px;
    background: #F3EDE0;
    opacity: 0.75;
}
.adv-card.done {
    background: linear-gradient(160deg, #FFF8E7, #FDF0D0);
    border-color: #DAA520;
    box-shadow: 0 4px 14px rgba(218, 165, 32, 0.22);
    opacity: 1;
}
.adv-icon { font-size: 22px; }
.adv-text b { display: block; font-size: 13px; color: #5C3317; }
.adv-text span { font-size: 11px; color: #8B7355; }

/* toast */
#g2dc-toast {
    position: fixed;
    top: 76px;
    left: 50%;
    transform: translate(-50%, -12px);
    z-index: 3500;
    padding: 9px 22px;
    background: rgba(43, 28, 14, 0.92);
    color: #F4D03F;
    border: 1px solid #DAA520;
    border-radius: 20px;
    font-size: 14px;
    letter-spacing: 2px;
    font-family: "SimSun", "STSong", serif;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}
#g2dc-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 夜间模式 */
[data-night-mode="true"] .g2dc-card { background: #23233a; border-color: #0f0f1a; box-shadow: 0 22px 60px rgba(0,0,0,.7), inset 0 0 0 1px #B8860B; }
[data-night-mode="true"] .g2dc-tabs { background: #1c1c2e; border-color: #3a3a52; }
[data-night-mode="true"] .g2dc-tab { color: #8a8aa5; }
[data-night-mode="true"] .g2dc-tab.active { color: #d4a574; background: #23233a; }
[data-night-mode="true"] .g2dc-slots, [data-night-mode="true"] .g2dc-inv { background: #1c1c2e; border-color: #3a3a52; }
[data-night-mode="true"] .g2dc-slot { background: #2a2a42; border-color: #4a4a66; }
[data-night-mode="true"] .g2dc-slot.out { border-color: #DAA520; background: #2e2a1a; }
[data-night-mode="true"] .g2dc-success { background: #26263e; border-color: #B8860B; }
[data-night-mode="true"] .s-title, [data-night-mode="true"] .free-line { color: #f0e0b8 !important; }
[data-night-mode="true"] .s-poem { color: #d8cbb0; }
[data-night-mode="true"] .s-why, [data-night-mode="true"] .r-why { background: #1c1c2e; color: #b8ab8d; }
[data-night-mode="true"] .g2dc-recipe { background: #26263e; border-color: #4a4a66; }
[data-night-mode="true"] .g2dc-recipe.lock { background: #1f1f33; }
[data-night-mode="true"] .r-head b { color: #f0e0b8; }
[data-night-mode="true"] .r-poem { color: #d8cbb0; }
[data-night-mode="true"] .g2dc-btn { background: #2a2a42; color: #d4a574; border-color: #0f0f1a; box-shadow: 0 3px 0 #0f0f1a; }
[data-night-mode="true"] .g2dc-btn.primary { background: linear-gradient(135deg, #B8860B, #DAA520); color: #1a1a2e; }
[data-night-mode="true"] .g2dc-inv-title { color: #d4a574; }
[data-night-mode="true"] .g2dc-free-tip, [data-night-mode="true"] .g2dc-book-tip { color: #8a8aa5; }
[data-night-mode="true"] .g2dc-mini { background: #2a2a42; border-color: #B8860B; color: #d4a574; }
[data-night-mode="true"] .g2dc-mini.done { background: #1f1f33; border-color: #4a4a66; color: #8a8aa5; }
[data-night-mode="true"] .adv-card { background: #1f1f33; border-color: #4a4a66; }
[data-night-mode="true"] .adv-card.done { background: #2e2a1a; border-color: #B8860B; }
[data-night-mode="true"] .adv-text b { color: #f0e0b8; }
[data-night-mode="true"] .adv-text span, [data-night-mode="true"] .adv-summary { color: #8a8aa5; }

/* 移动端 */
@media (max-width: 768px) {
    #g2dc-hotbar { bottom: 10px; padding: 5px 8px; gap: 3px; }
    #g2dc-hotbar .g2dc-block { width: 38px; height: 38px; }
    #g2dc-hotbar .g2dc-block i { font-size: 16px; }
    #g2dc-hotbar .g2dc-block em { font-size: 10px; }
    .g2dc-card { max-height: 92vh; }
    .g2dc-slot { width: 46px; height: 46px; }
    .g2dc-pane { padding: 12px; }
    .g2dc-tab { font-size: 12px; letter-spacing: 1px; padding: 9px 0; }
    .g2dc-adv { grid-template-columns: 1fr; }
    .g2dc-stele { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
}
@media (max-width: 480px) {
    #g2dc-hotbar .g2dc-block:nth-child(n+7) { display: none; }
}
