/* ==========================================================================
   音频合并工具（PC 端）
   独立命名空间 mg-，避免与 pc.css 冲突
   ========================================================================== */

.mg-page {
    width: 1200px;
    margin: 0 auto;
    padding: 28px 0 80px;
    color: #2b3440;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.mg-page *,
.mg-page *::before,
.mg-page *::after {
    box-sizing: border-box;
}

.mg-hide {
    display: none !important;
}

/* ---------- 顶部说明 ---------- */
.mg-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 32px;
    padding: 26px 30px;
    border: 1px solid #dbe9f8;
    border-radius: 16px;
    background: linear-gradient(135deg, #eff8ff 0%, #f8fcff 55%, #ffffff 100%);
}

.mg-hero h1 {
    font-size: 24px;
    font-weight: 600;
    color: #1b2735;
    letter-spacing: .5px;
}

.mg-hero p {
    margin-top: 8px;
    max-width: 640px;
    color: #5f7183;
    font-size: 14px;
}

.mg-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    padding: 0;
    list-style: none;
}

.mg-badges li {
    padding: 3px 10px;
    border: 1px solid #cfe6fb;
    border-radius: 20px;
    background: #fff;
    color: #2a90d8;
    font-size: 12px;
    line-height: 18px;
}

.mg-hero-note {
    flex: 0 0 268px;
    padding: 14px 16px;
    border: 1px solid #e4eef8;
    border-radius: 12px;
    background: rgba(255, 255, 255, .82);
    color: #6b7c8f;
    font-size: 12.5px;
    line-height: 1.75;
}

.mg-hero-note b {
    display: block;
    margin-bottom: 4px;
    color: #33465c;
    font-size: 13px;
    font-weight: 600;
}

/* ---------- 音频卡片 ---------- */
.mg-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-top: 20px;
}

.mg-card {
    display: flex;
    flex-direction: column;
    padding: 16px 18px 18px;
    border: 1px solid #e3ebf3;
    border-radius: 14px;
    background: #fff;
    transition: border-color .18s, box-shadow .18s;
}

.mg-card.is-over {
    border-color: #59b4f2;
    box-shadow: 0 0 0 3px rgba(23, 161, 255, .12);
}

.mg-card.is-ready {
    border-color: #d5e6f6;
}

.mg-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.mg-no {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: #eef6fe;
    color: #2a90d8;
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.mg-card.is-ready .mg-no {
    background: #17a1ff;
    color: #fff;
}

.mg-card-title {
    flex: 1;
    color: #33465c;
    font-size: 13.5px;
    font-weight: 600;
}

.mg-remove {
    padding: 2px 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #93a3b5;
    font-size: 12.5px;
    cursor: pointer;
}

.mg-remove:hover {
    background: #f2f6fa;
    color: #e0574f;
}

/* 空状态：拖放区 */
.mg-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 172px;
    padding: 20px;
    border: 1.5px dashed #cfdded;
    border-radius: 12px;
    background: #fafcfe;
    color: #8492a6;
    text-align: center;
    cursor: pointer;
    transition: border-color .18s, background .18s, color .18s;
}

.mg-drop:hover,
.mg-card.is-over .mg-drop {
    border-color: #17a1ff;
    background: #f2f9ff;
    color: #2a90d8;
}

.mg-drop-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-bottom: 2px;
    border-radius: 50%;
    background: #eaf4fd;
    color: #3d9fe8;
}

.mg-drop-icon svg {
    width: 22px;
    height: 22px;
}

.mg-drop-main {
    color: #4b5f74;
    font-size: 14px;
}

.mg-drop-sub {
    font-size: 12px;
    color: #9aa9bb;
}

/* 已载入 */
.mg-loaded {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mg-file {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
}

.mg-fname {
    flex: 1;
    overflow: hidden;
    color: #2b3440;
    font-size: 13.5px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mg-fmeta {
    flex: none;
    color: #93a3b5;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.mg-wave {
    display: block;
    width: 100%;
    height: 62px;
    border-radius: 8px;
    background: #f6fafe;
}

.mg-meters {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 9px;
    background: #f7fafd;
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
}

.mg-meter {
    color: #6b7c8f;
}

.mg-meter b {
    color: #33465c;
    font-weight: 600;
}

.mg-arrow {
    color: #b9c7d6;
}

.mg-gain {
    margin-left: auto;
    padding: 2px 9px;
    border-radius: 20px;
    background: #e8f7ee;
    color: #22885a;
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.mg-gain.is-limited {
    background: #fff3e6;
    color: #c47a1d;
}

.mg-tools {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mg-play {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    border: 1px solid #d9e6f2;
    border-radius: 8px;
    background: #fff;
    color: #3d7ba8;
    font-size: 12.5px;
    cursor: pointer;
    transition: border-color .15s, color .15s;
}

.mg-play:hover {
    border-color: #8ec8f2;
    color: #1679c4;
}

.mg-play.is-playing {
    border-color: #17a1ff;
    background: #eef8ff;
    color: #1679c4;
}

.mg-trim {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    color: #8492a6;
    font-size: 12px;
}

.mg-trim input[type="range"] {
    width: 96px;
    height: 3px;
    margin: 0;
    border-radius: 3px;
    background: #dbe7f2;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    cursor: pointer;
}

.mg-trim input[type="range"]::-webkit-slider-thumb {
    width: 12px;
    height: 12px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #17a1ff;
    box-shadow: 0 1px 3px rgba(23, 161, 255, .45);
    -webkit-appearance: none;
    appearance: none;
}

.mg-trim-val {
    min-width: 46px;
    color: #4b5f74;
    font-weight: 600;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ---------- 参数 ---------- */
.mg-settings {
    display: flex;
    flex-wrap: wrap;
    gap: 26px;
    margin-top: 20px;
    padding: 18px 22px;
    border: 1px solid #e3ebf3;
    border-radius: 14px;
    background: #fff;
}

.mg-field {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mg-label {
    color: #6b7c8f;
    font-size: 13px;
    white-space: nowrap;
}

.mg-seg {
    display: inline-flex;
    padding: 3px;
    border-radius: 9px;
    background: #f2f6fa;
}

.mg-seg button {
    min-width: 52px;
    padding: 5px 11px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #6b7c8f;
    font-size: 12.5px;
    cursor: pointer;
    transition: background .15s, color .15s, box-shadow .15s;
}

.mg-seg button:hover {
    color: #33465c;
}

.mg-seg button.is-on {
    background: #fff;
    color: #1679c4;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(43, 52, 64, .12);
}

.mg-hint {
    color: #9aa9bb;
    font-size: 12px;
}

/* ---------- 操作 ---------- */
.mg-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 22px;
}

.mg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 44px;
    padding: 0 34px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, #35b0ff 0%, #1287e6 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .5px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(23, 161, 255, .28);
    transition: transform .12s, box-shadow .18s, opacity .18s;
}

.mg-btn:hover:not(:disabled) {
    box-shadow: 0 6px 16px rgba(23, 161, 255, .36);
    transform: translateY(-1px);
}

.mg-btn:disabled {
    background: #cddbe8;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.mg-btn.is-busy {
    opacity: .8;
    cursor: progress;
}

.mg-spinner {
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: mg-spin .7s linear infinite;
}

@keyframes mg-spin {
    to {
        transform: rotate(360deg);
    }
}

.mg-status {
    color: #8492a6;
    font-size: 13px;
}

.mg-status.is-error {
    color: #e0574f;
}

/* ---------- 结果 ---------- */
.mg-result {
    margin-top: 24px;
    padding: 20px 22px 22px;
    border: 1px solid #cfe6fb;
    border-radius: 14px;
    background: linear-gradient(180deg, #f7fbff 0%, #ffffff 70%);
}

.mg-result-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.mg-result-title {
    color: #1b2735;
    font-size: 15px;
    font-weight: 600;
}

.mg-result-tag {
    padding: 2px 9px;
    border-radius: 20px;
    background: #e8f7ee;
    color: #22885a;
    font-size: 12px;
    font-weight: 600;
}

.mg-result-tag.is-warn {
    background: #fff3e6;
    color: #c47a1d;
}

.mg-result-wave {
    display: block;
    width: 100%;
    height: 72px;
    border-radius: 10px;
    background: #f2f8fe;
}

.mg-result audio {
    width: 100%;
    height: 40px;
    margin-top: 12px;
    outline: none;
}

.mg-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed #dbe9f8;
}

.mg-stat-label {
    color: #93a3b5;
    font-size: 12px;
}

.mg-stat-value {
    color: #2b3440;
    font-size: 16px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.mg-stat-value small {
    margin-left: 2px;
    color: #8492a6;
    font-size: 11.5px;
    font-weight: 400;
}

.mg-result-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.mg-download {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 40px;
    padding: 0 24px;
    border-radius: 9px;
    background: #17a1ff;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s;
}

.mg-download:hover {
    background: #0d8ee6;
    color: #fff;
}

.mg-again {
    height: 40px;
    padding: 0 18px;
    border: 1px solid #d9e6f2;
    border-radius: 9px;
    background: #fff;
    color: #5f7183;
    font-size: 13.5px;
    cursor: pointer;
}

.mg-again:hover {
    border-color: #8ec8f2;
    color: #1679c4;
}

.mg-notes {
    margin-top: 14px;
    padding: 10px 14px;
    border-radius: 9px;
    background: #f7fafd;
    color: #6b7c8f;
    font-size: 12.5px;
    line-height: 1.8;
}

.mg-notes:empty {
    display: none;
}

/* ---------- 窄屏兜底（PC 页面，但允许平板浏览） ---------- */
@media (max-width: 1240px) {
    .mg-page {
        width: auto;
        max-width: 1160px;
        padding-left: 20px;
        padding-right: 20px;
    }
}

@media (max-width: 900px) {
    .mg-grid {
        grid-template-columns: 1fr;
    }

    .mg-hero {
        flex-direction: column;
        gap: 16px;
    }

    .mg-hero-note {
        flex: none;
        width: 100%;
    }
}
