/* ========================================
   前台 - 左侧栏 + 右侧内容（对标参考图）
   ======================================== */

:root {
    --brand: #ff7a1d;
    --brand-light: #ffae3d;
    --brand-dark: #e9540d;
    --brand-pale: #fff3df;
    --brand-bg: #fff8ef;
    --sidebar-w: 200px;
    --topbar-h: 46px;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(0,0,0,.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,.06);
    --shadow-lg: 0 8px 24px rgba(0,0,0,.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body.front-body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Segoe UI', sans-serif;
    background: var(--brand-bg);
    color: var(--gray-800);
    min-height: 100vh;
}

/* =======================================
   顶栏 - 极简 46px
   ======================================= */
.front-topbar {
    background: #fff;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 20px 0 calc(var(--sidebar-w) + 20px);
    border-bottom: 1px solid #eaedf3;
    position: sticky; top: 0; z-index: 1000;
}
.topbar-left { flex: 1; }
.topbar-right {
    display: flex; align-items: center; gap: 16px;
}
.topbar-balance {
    font-size: 13px; color: var(--gray-500);
    display: flex; align-items: center; gap: 4px;
}
.topbar-balance i { color: var(--brand); font-size: 12px; }
.topbar-amount { color: var(--brand); font-weight: 700; }
.topbar-user {
    font-size: 13px; color: var(--gray-700);
    display: flex; align-items: center; gap: 5px;
}
.topbar-user i { font-size: 15px; color: var(--brand); }
.topbar-logout {
    color: var(--gray-400); font-size: 14px; text-decoration: none; transition: .15s;
}
.topbar-logout:hover { color: var(--danger); }
.topbar-login-btn {
    padding: 5px 16px; border-radius: 6px; font-size: 13px; font-weight: 600;
    color: #fff; background: var(--brand); text-decoration: none;
}

/* =======================================
   整体布局
   ======================================= */
.front-layout {
    display: flex;
    min-height: calc(100vh - var(--topbar-h));
}

/* =======================================
   左侧边栏 (对标参考图)
   ======================================= */
.front-sidebar {
    width: var(--sidebar-w);
    flex: none;
    background: #fff;
    border-right: 1px solid #eaedf3;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

/* -- Logo 区 -- */
.sidebar-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 20px 18px 18px;
    text-decoration: none;
    border-bottom: 1px solid #f0f2f5;
    margin-bottom: 6px;
    flex-shrink: 0;
}
.sidebar-brand-icon {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #ffae3d, #f05a00);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}
.sidebar-brand-icon i {
    font-size: 18px; color: #fff;
}
.sidebar-brand-icon img {
    width: 100%;
    height: 100%;
    display: block;
}
.sidebar-brand-text {
    font-size: 15px; font-weight: 800;
    color: var(--gray-900);
    white-space: nowrap;
    letter-spacing: -.2px;
}

/* -- 菜单列表 -- */
.sidebar-nav {
    list-style: none; margin: 0; padding: 6px 0;
    flex: 1;
}

.sidebar-nav li a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px;
    margin: 2px 8px 2px 0;
    font-size: 14px;
    color: var(--gray-600);
    text-decoration: none;
    transition: all .15s ease;
    border-radius: 0 22px 22px 0;
    position: relative;
}

.sidebar-nav li a i {
    width: 18px; text-align: center;
    font-size: 15px;
    color: var(--gray-400);
    transition: color .15s;
    flex-shrink: 0;
}

.sidebar-nav li a span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* hover */
.sidebar-nav li a:hover {
    background: var(--brand-pale);
    color: var(--brand);
}
.sidebar-nav li a:hover i {
    color: var(--brand);
}

/* active - 实心橙底白字胶囊 */
.sidebar-nav li a.active {
    background: var(--brand);
    color: #fff;
    font-weight: 700;
}
.sidebar-nav li a.active i {
    color: #fff;
}

/* =======================================
   右侧主内容
   ======================================= */
.front-main {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-w);
    padding: 24px 28px 50px;
}

.front-container {
    max-width: 1080px;
    margin: 0;
    padding: 0;
}

/* =======================================
   三栏功能页
   ======================================= */
.front-feature-shell {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.front-feature-aside {
    position: sticky;
    top: calc(var(--topbar-h) + 20px);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.front-feature-card {
    background: linear-gradient(180deg, #fff7ec 0%, #FFFFFF 100%);
    border: 1px solid #ffe1bd;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(255, 122, 29, 0.08);
    overflow: hidden;
}

.front-feature-card-body {
    padding: 22px 20px;
}

.front-feature-title {
    font-size: 30px;
    line-height: 1.2;
    font-weight: 800;
    color: #1f2a44;
    margin-bottom: 8px;
    letter-spacing: -.4px;
}

.front-feature-subtitle {
    font-size: 13px;
    color: #97A0B5;
    line-height: 1.8;
    margin-bottom: 14px;
}

.front-feature-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: #fff;
    border: 1px solid #ffd9ae;
    border-radius: 999px;
    font-size: 13px;
    color: #8a4a16;
    box-shadow: 0 6px 18px rgba(255, 122, 29, 0.08);
}

.front-feature-stepbox {
    padding: 18px;
    border-top: 1px solid #ffe8cf;
}

.front-feature-step {
    position: relative;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding-bottom: 16px;
}

.front-feature-step:last-child {
    padding-bottom: 0;
}

.front-feature-step:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 14px;
    top: 34px;
    bottom: 4px;
    width: 2px;
    background: linear-gradient(180deg, #ffc986 0%, #fff0d9 100%);
}

.front-feature-step-num {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), #ffb33a);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(255, 122, 29, 0.22);
    flex: none;
}

.front-feature-step-content {
    min-width: 0;
    padding-top: 2px;
}

.front-feature-step-title {
    font-size: 14px;
    font-weight: 700;
    color: #223150;
    margin-bottom: 4px;
}

.front-feature-step-desc {
    font-size: 12px;
    line-height: 1.7;
    color: #7D879F;
}

.front-feature-highlight {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255,122,29,.11), rgba(255,179,58,.13));
    border: 1px dashed #ffd29b;
}

.front-feature-highlight-title {
    font-size: 13px;
    font-weight: 700;
    color: #d95500;
    margin-bottom: 6px;
}

.front-feature-highlight-text {
    font-size: 12px;
    line-height: 1.8;
    color: #667085;
}

.front-feature-work {
    min-width: 0;
}

.front-work-card {
    background: #fff;
    border: 1px solid #eaedf3;
    border-radius: 20px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.04);
    padding: 26px 28px;
}

/* =======================================
   页面标题
   ======================================= */
.page-header { margin-bottom: 24px; }
.page-header h1 {
    font-size: 20px; font-weight: 700; color: var(--gray-900); margin-bottom: 4px;
}
.page-header p {
    color: var(--gray-500); font-size: 13px;
}

/* =======================================
   工具卡片
   ======================================= */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.tool-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
    border: 1px solid #eaedf3;
    transition: all .2s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
    overflow: hidden;
}
.tool-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brand), #ffb33a);
    opacity: 0;
    transition: opacity .2s;
}
.tool-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: #ffd6a3;
}
.tool-card:hover::before { opacity: 1; }

.tool-card .card-icon {
    width: 44px; height: 44px;
    background: linear-gradient(135deg, var(--brand), #ffb33a);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 14px;
}
.tool-card .card-icon i { font-size: 18px; color: #fff; }
.tool-card .card-title {
    font-size: 15px; font-weight: 700; color: var(--gray-900); margin-bottom: 5px;
}
.tool-card .card-desc {
    font-size: 12px; color: var(--gray-500); line-height: 1.5;
}
.tool-card .card-price {
    margin-top: 12px; padding-top: 12px;
    border-top: 1px solid #f0f2f5;
    display: flex; align-items: center; justify-content: space-between;
}
.tool-card .card-price .price {
    color: var(--brand); font-weight: 700; font-size: 13px;
}
.tool-card .card-price .arrow {
    width: 24px; height: 24px;
    background: #f0f2f5;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--gray-400); font-size: 10px;
    transition: all .2s;
}
.tool-card:hover .card-price .arrow {
    background: var(--brand); color: #fff;
}

/* =======================================
   Tool iframe 页
   ======================================= */
.tool-page-header {
    background: #fff;
    border-bottom: 1px solid #eaedf3;
    padding: 12px 24px;
    display: flex; align-items: center; justify-content: space-between;
}
.tool-page-header .left {
    display: flex; align-items: center; gap: 12px;
}
.tool-page-header .btn-back {
    display: flex; align-items: center; gap: 5px;
    color: var(--gray-600); text-decoration: none; font-size: 13px;
    padding: 6px 10px; border-radius: 6px; transition: .12s;
    border: 1px solid #eaedf3;
}
.tool-page-header .btn-back:hover { background: var(--gray-100); }
.tool-page-header .tool-title {
    font-size: 15px; font-weight: 700; color: var(--gray-900);
}
.tool-page-header .right {
    display: flex; align-items: center; gap: 12px;
}
.tool-page-header .balance-display {
    background: var(--gray-50); border: 1px solid #eaedf3;
    padding: 6px 14px; border-radius: 6px; font-size: 12px; color: var(--gray-600);
}
.tool-page-header .balance-display .bal-amount {
    color: var(--brand); font-weight: 700;
}

.tool-iframe-container {
    width: 100%;
    height: calc(100vh - var(--topbar-h) - 48px);
    border: none; background: #fff;
}
.tool-iframe-container iframe { width: 100%; height: 100%; border: none; }

/* =======================================
   个人中心
   ======================================= */
.profile-section {
    background: #fff;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid #eaedf3;
    margin-bottom: 16px;
}
.profile-section h2 {
    font-size: 16px; font-weight: 700; color: var(--gray-900);
    margin-bottom: 16px; padding-bottom: 10px;
    border-bottom: 1px solid #f0f2f5;
}

.balance-overview {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
.balance-card {
    background: var(--brand-bg); border-radius: 8px; padding: 18px; text-align: center;
}
.balance-card .label { font-size: 12px; color: var(--gray-500); margin-bottom: 5px; }
.balance-card .value { font-size: 24px; font-weight: 700; }
.balance-card.current .value { color: var(--brand); }
.balance-card.recharge .value { color: var(--success); }
.balance-card.consume .value { color: var(--warning); }
.balance-card .unit { font-size: 12px; font-weight: 400; color: var(--gray-400); margin-left: 2px; }

/* =======================================
   表格
   ======================================= */
.records-table { width: 100%; border-collapse: collapse; }
.records-table thead th {
    background: var(--brand-bg);
    padding: 10px 12px; text-align: left;
    font-size: 12px; font-weight: 700; color: var(--gray-600);
    border-bottom: 1px solid #eaedf3;
}
.records-table tbody td {
    padding: 10px 12px; font-size: 13px; color: var(--gray-700);
    border-bottom: 1px solid #f0f2f5;
}
.records-table tbody tr:hover { background: var(--brand-bg); }

.badge-type {
    display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600;
}
.badge-type.recharge { background: #d1fae5; color: #065f46; }
.badge-type.consume { background: #fef3c7; color: #92400e; }
.badge-type.refund { background: #dbeafe; color: #1e40af; }

.text-danger { color: var(--danger); }
.text-success { color: var(--success); }

.empty-state { text-align: center; padding: 44px 20px; color: var(--gray-400); }
.empty-state i { font-size: 40px; margin-bottom: 12px; opacity: .4; }
.empty-state p { font-size: 13px; }

/* =======================================
   温馨提示
   ======================================= */
.front-notice {
    margin-top: 18px; padding: 12px 14px;
    background: #FFFBEB; border: 1px solid #FDE68A; border-radius: 8px;
    font-size: 12px; color: #92400E; line-height: 1.8;
}
.front-notice strong { color: #B45309; }

/* =======================================
   响应式
   ======================================= */
@media (max-width: 860px) {
    body.front-body { overflow: auto !important; }
    .front-topbar {
        padding: 0 12px;
        position: sticky;
        top: 0;
        z-index: 1200;
    }
    .front-layout {
        flex-direction: column;
        min-height: calc(100vh - var(--topbar-h));
    }
    .front-sidebar {
        display: block;
        position: sticky;
        top: var(--topbar-h);
        left: auto;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #eaedf3;
        overflow-x: auto;
        overflow-y: hidden;
        z-index: 1090;
        -webkit-overflow-scrolling: touch;
        box-shadow: 0 8px 18px rgba(15,23,42,.05);
    }
    .front-sidebar::-webkit-scrollbar,
    .sidebar-nav::-webkit-scrollbar {
        display: none;
    }
    .sidebar-brand {
        display: none;
    }
    .sidebar-nav {
        display: flex;
        align-items: center;
        gap: 4px;
        flex: none;
        min-width: max-content;
        padding: 8px 10px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }
    .sidebar-nav li {
        flex: 0 0 auto;
    }
    .sidebar-nav li a {
        margin: 0;
        padding: 9px 13px;
        border-radius: 999px;
        white-space: nowrap;
        gap: 7px;
        font-size: 13px;
        background: #fff;
        border: 1px solid transparent;
    }
    .sidebar-nav li a i {
        width: auto;
        font-size: 14px;
    }
    .sidebar-nav li a.active {
        background: linear-gradient(135deg, var(--brand), var(--brand-light));
        border-color: transparent;
        box-shadow: 0 8px 18px rgba(255,122,29,.18);
    }
    .front-main {
        margin-left: 0;
        width: 100%;
        padding: 16px 14px 50px;
    }
    .front-feature-shell { grid-template-columns: 1fr; }
    .front-feature-aside { position: static; }
    .front-work-card { padding: 20px 16px; border-radius: 16px; }
    .tools-grid { grid-template-columns: 1fr; }
    .balance-overview { grid-template-columns: 1fr; }
    .tool-page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 10px 12px;
    }
    .tool-page-header .left {
        flex-wrap: wrap;
        gap: 8px;
    }
    .tool-page-header .right {
        justify-content: flex-start;
    }
    .tool-page-header .tool-title {
        flex: 1 1 auto;
        min-width: 140px;
    }
    .tool-page-header .balance-display {
        width: 100%;
        line-height: 1.7;
        border-radius: 10px;
    }
    .tool-iframe-container {
        height: calc(100dvh - var(--topbar-h) - 54px - 112px);
        min-height: 520px;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
        background: #f8fafc;
    }
    .tool-iframe-container iframe {
        width: 100%;
        min-width: 980px;
        height: 100%;
        display: block;
        background: #fff;
    }
}
