/* ==========================================================================
   coder.css — Coder 编解码工具页样式（科幻风）
   类别：页面（coder.php 专属：选项卡 + 输入框 + 输出框）
   ========================================================================== */

.coder-main {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 48px 24px 72px;
}

.coder-card {
    width: 100%;
    max-width: 760px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ---------- 选项卡（控制输出类型） ---------- */
.coder-tabs {
    display: flex;
    gap: 6px;
    padding: 5px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 12px;
    align-self: flex-start;
}

.coder-tab {
    padding: 8px 20px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.coder-tab:hover { color: var(--text); }

.coder-tab.active {
    background: rgba(34, 211, 238, 0.15);
    color: #a5f3fc;
    box-shadow: inset 0 0 10px rgba(34, 211, 238, 0.12);
}

/* ---------- 输入框（长方形，中间偏上） ---------- */
.coder-input {
    width: 100%;
    height: 200px;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.92rem;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.coder-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}

.coder-input::placeholder { color: var(--text-dim); }

/* ---------- 输出框（类型标注 + 复制按钮） ---------- */
.coder-output-wrap {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.coder-output-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid var(--border);
}

.coder-output-info {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.coder-output-info iconify-icon { color: var(--accent); font-size: 1rem; }

.coder-output-info .arrow { opacity: 0.5; margin: 0 2px; }

.type-tag {
    color: var(--text);
    font-weight: 600;
}

.type-tag-out { color: var(--accent); }

.coder-copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(34, 211, 238, 0.12);
    border: 1px solid rgba(34, 211, 238, 0.2);
    border-radius: var(--radius-pill);
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}

.coder-copy:hover {
    background: rgba(34, 211, 238, 0.2);
    box-shadow: 0 0 14px rgba(34, 211, 238, 0.2);
}

.coder-copy:active { transform: scale(0.96); }

.coder-copy.copied {
    color: var(--green);
    border-color: rgba(52, 211, 153, 0.4);
    background: rgba(52, 211, 153, 0.12);
}

.coder-output {
    width: 100%;
    height: 200px;
    padding: 16px 18px;
    background: transparent;
    border: none;
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.92rem;
    line-height: 1.6;
    resize: vertical;
    outline: none;
}

.coder-output::placeholder { color: var(--text-dim); }

/* ---------- 手动模式：类型选择列表 ---------- */
.coder-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.coder-type-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    padding: 5px 12px;
    background: rgba(34, 211, 238, 0.08);
    border: 1px solid rgba(34, 211, 238, 0.2);
    border-radius: var(--radius-pill);
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}

.coder-type-trigger:hover {
    background: rgba(34, 211, 238, 0.16);
    box-shadow: 0 0 12px rgba(34, 211, 238, 0.18);
}

.coder-type-trigger iconify-icon { color: var(--accent); font-size: 0.95rem; }

/* 非手动模式时隐藏（作者 display 覆盖了 [hidden] 的 UA 默认，需显式补回） */
.coder-type-trigger[hidden] { display: none; }

/* 下拉列表（fixed 定位，跟随触发按钮） */
.coder-type-menu {
    position: fixed;
    z-index: 1200;
    min-width: 150px;
    padding: 5px;
    background: rgba(12, 19, 34, 0.97);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    -webkit-backdrop-filter: blur(23px);
    backdrop-filter: blur(23px);
}

.coder-type-option {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.coder-type-option:hover { background: rgba(34, 211, 238, 0.1); color: var(--text); }

.coder-type-option.active { color: var(--accent); font-weight: 600; }

/* ---------- 移动端 ---------- */
@media (max-width: 620px) {
    .coder-main { padding: 36px 16px 56px; }
    /* 选项卡：横向可滚动但隐藏滚动条（同 nav 菜单，保留隐式横向滚动） */
    .coder-tabs {
        width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .coder-tabs::-webkit-scrollbar { display: none; width: 0; height: 0; }
    .coder-tab { flex-shrink: 0; }
    .coder-output-head { flex-wrap: wrap; }
}
