/* ============================================================
   TWIBOOST 共享样式
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --bg:           #0d1015;
    --bg-input:     #171b22;
    --bg-card:      #14181f;
    --bg-active:    #191d24;
    --bg-hover:     #1a1f27;
    --divider:      #161a22;
    --border:       #252b33;
    --border-light: #2a313a;
    --text:         #e6edf3;
    --text-dim:     #8b949e;
    --text-mute:    #6e7681;
    --accent:       #f97316;
    --accent-hover: #ea6a0f;
    --success:      #22c55e;
    --danger:       #ef4444;
    --warning:      #eab308;

    --sidebar-w:    220px;
    --content-max:  700px;
    --app-max:      1280px;
}

html, body {
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; }

/* ============================================================
   整体容器
   ============================================================ */
.app {
    max-width: var(--app-max);
    margin: 0 auto;
    display: flex;
    min-height: 100vh;
    padding: 0 40px;
}

/* ============================================================
   侧边栏
   ============================================================ */
.sidebar {
    width: var(--sidebar-w);
    padding: 30px 0;
    flex-shrink: 0;
}

.sidebar .logo {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 30px;
    text-decoration: none;
}

.sidebar .logo-mark { width: 22px; height: 22px; flex-shrink: 0; }

.sidebar .logo-text {
    font-size: 16px;
    font-weight: 800;
    font-style: italic;
    letter-spacing: 0.4px;
    color: #fff;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: background .15s, color .15s;
}

.nav-item:hover { color: var(--text); }

.nav-item.active {
    background: var(--bg-active);
    color: var(--accent);
    font-weight: 600;
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ============================================================
   主区域
   ============================================================ */
.main {
    flex: 1;
    min-width: 0;
    padding-left: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.main-inner {
    width: 100%;
    max-width: var(--content-max);
}

/* ============================================================
   顶部栏
   ============================================================ */
.topbar {
    padding: 22px 0 14px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.search-box {
    flex: 1;
    position: relative;
}

.search-box input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 11px 18px 11px 42px;
    color: var(--text);
    font-size: 13px;
    outline: none;
    transition: border-color .15s;
}

.search-box input::placeholder { color: var(--text-mute); }
.search-box input:focus { border-color: var(--border-light); background: var(--bg-hover); }

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-mute);
    width: 15px;
    height: 15px;
    pointer-events: none;
}

.search-icon svg {
    width: 15px; height: 15px;
    stroke: currentColor; fill: none;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* 通知 + 余额 + 折扣 + 头像 */
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.icon-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    text-decoration: none;
    transition: all .15s;
}

.icon-btn:hover { color: var(--text); border-color: var(--border-light); }
.icon-btn svg {
    width: 16px; height: 16px;
    stroke: currentColor; fill: none;
    stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

.pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all .15s;
    white-space: nowrap;
}

.pill:hover { border-color: var(--border-light); }

.pill .pill-icon {
    width: 14px; height: 14px;
    color: var(--text-dim);
    flex-shrink: 0;
}

.pill .pill-icon svg {
    width: 100%; height: 100%;
    stroke: currentColor; fill: none;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

.pill .pill-value {
    font-weight: 600;
    color: var(--text);
}

.pill .pill-label {
    color: var(--text-dim);
    font-weight: 500;
}

.pill-recharge { border-color: rgba(34,197,94,0.4); color: var(--success); }
.pill-recharge:hover { border-color: var(--success); }
.pill-recharge .pill-icon { color: var(--success); }

/* 头像 + 折扣 */
.avatar-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.discount-circle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-dim);
    font-weight: 500;
}

.discount-ring {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: conic-gradient(#a855f7 0%, #ec4899 50%, #a855f7 100%);
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.discount-ring-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9.5px;
    font-weight: 700;
    color: var(--text);
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f97316, #fb923c);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.avatar-menu {
    position: absolute;
    top: 46px;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px;
    min-width: 180px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 100;
    display: none;
}

.avatar-menu.show { display: block; }

.avatar-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 13px;
    transition: all .15s;
    white-space: nowrap;
}

.avatar-menu a:hover { background: var(--bg-hover); color: var(--text); }

.avatar-menu hr {
    border: none;
    border-top: 1px solid var(--divider);
    margin: 4px 0;
}

.avatar-menu a.danger { color: var(--danger); }

/* ============================================================
   页面标题
   ============================================================ */
.page-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 14px;
    padding-left: 2px;
}

/* ============================================================
   列表（平台）
   ============================================================ */
.platform-list { display: flex; flex-direction: column; }

.platform-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 2px;
    border-bottom: 1px solid var(--divider);
    text-decoration: none;
    color: var(--text);
    cursor: pointer;
    transition: all .12s;
}

.platform-item:last-child { border-bottom: none; }

.platform-item:hover {
    background: var(--bg-card);
    border-radius: 10px;
    padding-left: 14px;
    padding-right: 14px;
    margin: 0 -14px;
}

.platform-left {
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 0;
}

.platform-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.platform-icon svg { width: 22px; height: 22px; display: block; }

.platform-name {
    font-size: 14px;
    font-weight: 500;
}

.arrow-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-mute);
    flex-shrink: 0;
    transition: all .15s;
}

.arrow-btn svg {
    width: 11px; height: 11px;
    stroke: currentColor; fill: none;
    stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
}

.platform-item:hover .arrow-btn {
    border-color: var(--border-light);
    color: var(--text);
    background: var(--bg-hover);
}

/* ============================================================
   品牌色
   ============================================================ */
.bg-telegram    { background: linear-gradient(135deg, #37b6eb, #1c93c9); }
.bg-tgpremium   { background: linear-gradient(135deg, #a855f7, #7c3aed); }
.bg-max         { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.bg-twitter     { background: #000; }
.bg-tiktok      { background: #000; }
.bg-youtube     { background: #FF0000; }
.bg-instagram   { background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); }
.bg-vk          { background: #0077FF; }
.bg-twitch      { background: #9146FF; }
.bg-facebook    { background: #1877F2; }
.bg-rutube      { background: #000; }
.bg-yappy       { background: linear-gradient(135deg, #14b8a6, #0d9488); }
.bg-dan         { background: #1f2937; }
.bg-sizu        { background: #374151; }
.bg-linkedin    { background: #0A66C2; }
.bg-medium      { background: #000; }
.bg-github      { background: #171515; }
.bg-wildberries { background: linear-gradient(135deg, #cb11ab, #7b0c8a); }
.bg-lele        { background: linear-gradient(135deg, #ec4899, #db2777); }
.bg-steam       { background: linear-gradient(135deg, #1b2838, #2a475e); }
.bg-webtraffic  { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.bg-api         { background: #000; }

/* ============================================================
   通用按钮
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: all .15s;
    border: none;
    white-space: nowrap;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--border-light); }

.btn-block { width: 100%; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1024px) {
    .app { padding: 0 24px; }
    .main { padding-left: 32px; }
}

@media (max-width: 768px) {
    .app { padding: 0; flex-direction: column; }
    .sidebar {
        width: 100%;
        padding: 16px 16px 0;
        border-bottom: 1px solid var(--divider);
        position: sticky;
        top: 0;
        z-index: 100;
        background: var(--bg);
    }
    .sidebar .logo { padding: 0 0 14px; }
    .nav {
        flex-direction: row;
        overflow-x: auto;
        gap: 6px;
        padding-bottom: 12px;
        scrollbar-width: none;
    }
    .nav::-webkit-scrollbar { display: none; }
    .nav-item { padding: 8px 14px; font-size: 13px; flex-shrink: 0; white-space: nowrap; }
    .nav-item .nav-icon { width: 16px; height: 16px; }

    .main { padding-left: 0; width: 100%; }
    .main-inner { max-width: 100%; padding: 0 16px; }

    .topbar { padding: 16px 0 8px; flex-wrap: wrap; }
    .topbar-actions { width: 100%; justify-content: flex-end; }

    .platform-icon { width: 38px; height: 38px; }

    .platform-item:hover {
        background: transparent;
        padding-left: 2px;
        padding-right: 2px;
        margin: 0;
    }
}