/* ============================================================
   93话费充值系统 - 全局共享样式
   整合自 includes/header.php、includes/footer.php 内联样式
   及各页面跨页面复用的 .auth-*-modern、.sidebar-*-modern 等样式
   ============================================================ */

/* ============ 全局变量与基础样式 ============ */
:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --success-color: #10b981;
    --navbar-height: 68px;
    --body-bg: #f8fafc;
    --card-shadow: 0 4px 16px rgba(99, 102, 241, 0.06);
    --card-shadow-hover: 0 12px 32px rgba(99, 102, 241, 0.12);
    --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-accent: linear-gradient(135deg, #ec4899 0%, #f59e0b 100%);
}

* {
    -webkit-tap-highlight-color: transparent;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: var(--navbar-height);
    background-color: var(--body-bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: #1e293b;
}

/* ============ 导航栏样式 ============ */
.navbar {
    height: var(--navbar-height);
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.25);
    padding: 0.5rem 1rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: none;
}

.navbar-brand {
    font-size: 1.4rem;
    font-weight: 700;
    color: white !important;
    letter-spacing: 0.5px;
    white-space: nowrap;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand i {
    margin-right: 0.5rem;
}

.nav-link {
    color: rgba(255,255,255,0.92) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 10px;
    transition: var(--transition-base);
    position: relative;
}

.nav-link:hover {
    color: white !important;
    background-color: rgba(255,255,255,0.18);
    transform: translateY(-1px);
}

.nav-link.active {
    color: white !important;
    background-color: rgba(255,255,255,0.25);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.navbar-toggler {
    border: none;
    padding: 0.25rem 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.95%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.5' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ============ 用户菜单样式 ============ */
.user-menu .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-menu .dropdown-toggle::after {
    display: none;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    border: 2px solid rgba(255,255,255,0.4);
    transition: var(--transition-base);
}

.user-menu:hover .user-avatar {
    background-color: rgba(255,255,255,0.35);
    transform: scale(1.05);
}

.user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.user-name {
    font-size: 0.9rem;
    color: white;
    font-weight: 600;
}

.user-balance {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.85);
}

.dropdown-menu {
    border: none;
    box-shadow: 0 12px 32px rgba(0,0,0,0.15);
    border-radius: 16px;
    padding: 0.5rem 0;
    margin-top: 0.5rem !important;
    border: 1px solid rgba(0,0,0,0.04);
}

.dropdown-item {
    padding: 0.7rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 10px;
    margin: 0 0.5rem;
    transition: var(--transition-base);
    font-weight: 500;
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    color: var(--secondary-color);
}

.dropdown-item:hover {
    background-color: rgba(99, 102, 241, 0.08);
    color: var(--primary-color);
}

.dropdown-item:hover i {
    color: var(--primary-color);
}

/* 未读消息徽章 */
.badge-notification {
    position: absolute;
    top: 4px;
    right: 4px;
    transform: translate(50%, -50%);
    font-size: 0.65rem;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
}

/* ============ 通用卡片增强 ============ */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    transition: var(--transition-base);
}

.card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    font-weight: 600;
    padding: 1rem 1.5rem;
}

/* ============ 按钮增强 ============ */
.btn {
    border-radius: 10px;
    font-weight: 500;
    transition: var(--transition-base);
    padding: 0.5rem 1.2rem;
}

.btn-primary {
    background: var(--gradient-primary);
    border: none;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

.btn-lg {
    padding: 0.75rem 1.75rem;
    font-size: 1.05rem;
    border-radius: 12px;
}

/* ============ 表单增强 ============ */
.form-control, .form-select {
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    padding: 0.65rem 1rem;
    transition: var(--transition-base);
    background-color: #f8fafc;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    background-color: white;
}

.form-label {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

/* Alert 增强 */
.alert {
    border-radius: 12px;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    padding: 1rem 1.5rem;
}

/* 徽章增强 */
.badge {
    padding: 0.4em 0.8em;
    font-weight: 600;
    border-radius: 8px;
}

/* 表格增强 */
.table {
    margin-bottom: 0;
}

.table thead th {
    background-color: #f1f5f9;
    border-bottom: 2px solid #e2e8f0;
    font-weight: 700;
    color: #475569;
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-color: #f1f5f9;
}

.table tbody tr:hover {
    background-color: #f8fafc;
}

/* 分页增强 */
.pagination .page-link {
    border-radius: 8px;
    margin: 0 2px;
    border: none;
    color: var(--primary-color);
    padding: 0.5rem 0.9rem;
}

.pagination .page-item.active .page-link {
    background: var(--gradient-primary);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.pagination .page-link:hover {
    background-color: #f1f5f9;
}

/* ============ 页脚样式 ============ */
.footer {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%);
    color: rgba(255, 255, 255, 0.75);
    margin-top: 3rem;
    position: relative;
}

.footer-top {
    position: relative;
}

.footer-top::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        rgba(255,255,255,0) 0%,
        rgba(139, 92, 246, 0.5) 50%,
        rgba(255,255,255,0) 100%
    );
}

.footer-info h3,
.footer-links h4,
.footer-contact h4 {
    font-weight: 700;
    letter-spacing: 0.5px;
}

.footer-info h3 {
    font-size: 1.4rem;
    background: linear-gradient(135deg, #a78bfa 0%, #f0abfc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 社交媒体链接 */
.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: #fff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.social-links a:hover {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
    border-color: transparent;
}

/* 页脚链接 */
.footer-links ul li {
    margin-bottom: 12px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}

.footer-links a:hover {
    color: #a78bfa;
    transform: translateX(6px);
}

.footer-links i {
    font-size: 11px;
    transition: all 0.3s ease;
    color: #8b5cf6;
}

.footer-links a:hover i {
    transform: translateX(3px);
    color: #a78bfa;
}

/* 联系信息 */
.footer-contact li {
    display: flex;
    align-items: center;
    margin-bottom: 14px;
}

.footer-contact i {
    width: 24px;
    color: #a78bfa;
}

/* 页脚底部 */
.footer-bottom {
    background: rgba(0, 0, 0, 0.3);
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-bottom p {
    margin: 0;
    color: rgba(255, 255, 255, 0.6);
}

.footer-bottom a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-bottom a:hover {
    color: #a78bfa;
}

/* ============ 现代化卡片（跨页面复用） ============ */
.auth-card-modern {
    background: white;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(99, 102, 241, 0.12);
    overflow: hidden;
    border: 1px solid rgba(99, 102, 241, 0.08);
}

.auth-header-modern {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    padding: 32px 32px 28px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.auth-header-modern::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.auth-icon-wrap {
    width: 56px;
    height: 56px;
    background: rgba(255,255,255,0.2);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 1.4rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
}

.auth-title-modern {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.auth-subtitle-modern {
    color: rgba(255,255,255,0.85);
    margin: 0;
    font-size: 0.9rem;
}

.auth-body-modern {
    padding: 28px;
}

/* 现代化输入框（login/register 复用） */
.input-group-modern {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    z-index: 3;
    pointer-events: none;
}

.form-control-modern {
    padding-left: 44px !important;
    height: 48px;
}

/* 现代化提交按钮 */
.btn-modern-submit {
    display: inline-block;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    padding: 12px 28px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3);
    border: none;
}

.btn-modern-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(99, 102, 241, 0.4);
    color: white;
}

/* 现代化链接 */
.link-modern {
    color: #6366f1;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.link-modern:hover {
    color: #4f46e5;
    text-decoration: underline;
}

/* 底部提示 */
.auth-footer-modern {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
    color: #64748b;
}

/* 现代化提示框 */
.alert-modern {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    padding: 14px 20px;
    color: #475569;
}

/* ============ 现代化侧边栏（orders/recharge/messages 复用） ============ */
.sidebar-modern {
    background: white;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(99, 102, 241, 0.12);
    overflow: hidden;
    border: 1px solid rgba(99, 102, 241, 0.08);
    position: sticky;
    top: 90px;
}

.sidebar-header-modern {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    padding: 28px 20px 24px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.sidebar-header-modern::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 150px;
    height: 150px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.sidebar-avatar-modern {
    width: 64px;
    height: 64px;
    background: rgba(255,255,255,0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 1.6rem;
    border: 2px solid rgba(255,255,255,0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
}

.sidebar-username-modern {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}

.sidebar-userrole-modern {
    color: rgba(255,255,255,0.85);
    margin: 0;
    font-size: 0.82rem;
    position: relative;
    z-index: 1;
}

.sidebar-nav-modern {
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-item-modern {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    color: #475569;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.sidebar-item-modern i {
    font-size: 1.05rem;
    width: 20px;
    text-align: center;
    color: #94a3b8;
    transition: all 0.3s ease;
}

.sidebar-item-modern:hover {
    background-color: #f1f5f9;
    color: #1e293b;
    transform: translateX(4px);
}

.sidebar-item-modern:hover i {
    color: #6366f1;
}

.sidebar-item-modern.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    color: #6366f1;
    font-weight: 600;
}

.sidebar-item-modern.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 0 4px 4px 0;
}

.sidebar-item-modern.active i {
    color: #6366f1;
}

.sidebar-badge-modern {
    margin-left: auto;
    background: linear-gradient(135deg, #ec4899 0%, #f59e0b 100%);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(236, 72, 153, 0.3);
}

/* ============ FAQ/帮助页面通用样式（faq/guide 复用） ============ */
.faq-tabs-modern {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 16px;
}

.faq-tab-item-modern {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 12px;
    color: #475569;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.faq-tab-item-modern i {
    color: #94a3b8;
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.faq-tab-item-modern:hover {
    background: white;
    color: #1e293b;
}

.faq-tab-item-modern:hover i {
    color: #6366f1;
}

.faq-tab-item-modern.active {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3);
}

.faq-tab-item-modern.active i {
    color: white;
}

/* 手风琴（faq/guide 复用） */
.accordion-item {
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    margin-bottom: 10px;
    overflow: hidden;
}

.accordion-button {
    font-weight: 500;
    padding: 16px 20px;
}

.accordion-button:not(.collapsed) {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
    color: #6366f1;
    box-shadow: none;
}

.accordion-button:focus {
    box-shadow: none;
    border-color: rgba(99, 102, 241, 0.3);
}

.accordion-body {
    padding: 16px 20px;
    color: #475569;
    line-height: 1.7;
}

/* ============ 响应式调整 ============ */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
        padding: 1rem;
        border-radius: 16px;
        margin-top: 0.5rem;
        box-shadow: 0 12px 32px rgba(0,0,0,0.15);
    }

    .navbar-nav {
        gap: 0.25rem;
    }

    .footer-top {
        padding: 3rem 0 !important;
    }
    .footer-info h3 {
        font-size: 1.3rem;
    }
}

@media (max-width: 767.98px) {
    .footer-info, .footer-links, .footer-contact {
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }

    .footer-contact li {
        justify-content: center;
    }

    .footer-links a:hover {
        transform: none;
    }
}

@media (max-width: 575.98px) {
    :root {
        --navbar-height: 60px;
    }

    .navbar {
        padding: 0.4rem 0.75rem;
    }

    .navbar-brand {
        font-size: 1.15rem;
    }

    .navbar-brand i {
        font-size: 1rem;
    }

    .user-info {
        display: none !important;
    }

    .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .footer-top {
        padding: 2rem 0 !important;
    }
    .footer-bottom {
        padding: 1rem 0 !important;
    }
    .footer-bottom .row > div {
        text-align: center !important;
    }
    .social-links a {
        width: 38px;
        height: 38px;
    }

    .auth-header-modern {
        padding: 32px 24px 24px;
    }
    .auth-body-modern {
        padding: 24px;
    }
    .auth-title-modern {
        font-size: 1.5rem;
    }
}
