:root {
    --trae-bg: #0d1117;
    --trae-card: #161b22;
    --trae-border: #30363d;
    --trae-text: #f0f6fc;
    --trae-text-muted: #9ca3af;
    --trae-primary: #58a6ff;
    --trae-accent: #238636;
    --trae-danger: #f85149;
    --trae-warning: #d29922;
    --trae-input: #0d1117;
    --trae-header: #161b22;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--trae-bg);
    color: var(--trae-text);
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Typography - 增强对比度 */
label, .form-label {
    color: #f0f6fc !important;
    font-weight: 600 !important;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.text-muted {
    color: #9ca3af !important;
}

small, .small {
    color: #9ca3af !important;
    font-weight: 400;
}

h1, h2, h3, h4, h5, h6 {
    color: #ffffff !important;
    font-weight: 600;
}

/* 确保所有文本可见 */
p, span, div {
    color: inherit;
}

.card-body p,
.card-body span,
.card-body div {
    color: var(--trae-text);
}

.text-gradient {
    background: linear-gradient(135deg, var(--trae-primary) 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Navbar */
.navbar {
    background-color: var(--trae-header);
    border-bottom: 1px solid var(--trae-border);
    padding: 0.75rem 1rem;
}

.navbar-brand {
    font-weight: 600;
    color: var(--trae-primary) !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Cards */
.card {
    background-color: var(--trae-card);
    border: 1px solid var(--trae-border);
    border-radius: 12px;
    margin-bottom: 1rem;
    transition: border-color 0.2s, transform 0.2s;
}

.card:hover {
    border-color: rgba(88, 166, 255, 0.3);
}

.card-header {
    background-color: rgba(48, 54, 61, 0.3);
    border-bottom: 1px solid var(--trae-border);
    padding: 0.75rem 1rem;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--trae-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Forms - 增强输入框对比度 */
.form-control, .form-select {
    background-color: var(--trae-input);
    border: 1px solid var(--trae-border);
    color: #ffffff;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus, .form-select:focus {
    background-color: var(--trae-input);
    border-color: var(--trae-primary);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
    color: #ffffff;
}

.form-control::placeholder {
    color: #6b7280;
}

/* Checkbox 样式优化 */
.form-check-input {
    background-color: var(--trae-input);
    border-color: var(--trae-border);
}

.form-check-input:checked {
    background-color: var(--trae-primary);
    border-color: var(--trae-primary);
}

.form-check-label {
    color: var(--trae-text) !important;
    font-weight: 500 !important;
}

.form-control-lg {
    padding: 1rem 1.25rem;
    font-size: 1.1rem;
}

.form-text {
    color: var(--trae-text-muted);
    font-size: 0.85rem;
}

/* Buttons */
.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, #238636 0%, #2ea043 100%);
    border: 1px solid rgba(240, 246, 252, 0.1);
    color: #ffffff;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2ea043 0%, #3fb950 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(35, 134, 54, 0.3);
}

.btn-outline-primary {
    color: var(--trae-primary);
    border-color: var(--trae-primary);
    border-radius: 8px;
}

.btn-outline-primary:hover {
    background-color: var(--trae-primary);
    color: #ffffff;
}

.btn-outline-light {
    color: var(--trae-text);
    border-color: var(--trae-border);
    border-radius: 8px;
}

.btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: var(--trae-text-muted);
}

.generate-btn {
    position: relative;
    overflow: hidden;
}

.generate-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.generate-btn:active::after {
    width: 300px;
    height: 300px;
}

/* Announcement */
.announcement {
    background: linear-gradient(135deg, rgba(56, 139, 253, 0.1) 0%, rgba(168, 85, 247, 0.1) 100%);
    border-left: 4px solid var(--trae-primary);
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    transition: opacity 0.3s, transform 0.3s, max-height 0.3s, margin 0.3s, padding 0.3s;
    max-height: 200px;
    overflow: hidden;
}

.announcement.hiding {
    opacity: 0;
    transform: translateY(-10px);
    max-height: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.announcement-close {
    flex-shrink: 0;
    opacity: 0.5;
    transition: opacity 0.2s;
    filter: invert(1);
}

.announcement-close:hover {
    opacity: 1;
}

/* Result Area */
.result-area {
    background-color: #010409;
    border: 1px solid var(--trae-border);
    border-radius: 8px;
    padding: 1.25rem;
    font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;
    font-size: 0.95rem;
    color: var(--trae-primary);
    word-break: break-all;
    min-height: 3rem;
    display: flex;
    align-items: center;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}

.result-card {
    border-color: var(--trae-accent);
}

/* Modal */
.modal-content {
    background-color: var(--trae-card);
    border: 1px solid var(--trae-border);
    border-radius: 12px;
}

.modal-header {
    border-bottom-color: var(--trae-border);
}

.modal {
    z-index: 10001 !important;
}

.modal-backdrop {
    z-index: 10000 !important;
}

.modal-backdrop.show {
    z-index: 10000 !important;
}

#redeemModal {
    z-index: 10002 !important;
}

#redeemModal .modal-dialog {
    z-index: 10002 !important;
}

.nav-tabs .nav-link {
    color: var(--trae-text-muted);
    border: none;
    padding: 0.75rem 1.5rem;
}

.nav-tabs .nav-link.active {
    color: var(--trae-text);
    background-color: transparent;
    border-bottom: 2px solid var(--trae-primary);
}

/* Feature Card */
.feature-card {
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
}

.feature-card:hover {
    transform: translateY(-2px);
    border-color: var(--trae-primary);
}

/* User Info */
.user-info {
    font-size: 0.85rem;
    color: var(--trae-text-muted);
}

.user-info b {
    color: var(--trae-text);
}

.expire-warning {
    color: var(--trae-warning);
}

.expire-danger {
    color: var(--trae-danger);
}

/* QRCode - 已迁移至分享模态框，保留旧容器样式兼容 */
#qrcode-container {
    background: white;
    padding: 12px;
    border-radius: 8px;
    display: inline-block;
}

/* ============================================ */
/* 功能选择：横向滑动标签 + 选中后自动折叠       */
/* ============================================ */

/* 外层容器：限制高度，选中后折叠 */
.func-tabs-wrapper {
    position: relative;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, margin 0.3s ease;
    max-height: 200px;
}

.func-tabs-wrapper.collapsed {
    max-height: 0;
    opacity: 0;
    margin: 0;
}

/* 横向滚动容器 */
.func-tabs-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 2px 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-behavior: smooth;
}

.func-tabs-scroll::-webkit-scrollbar {
    display: none;
}

/* 单个标签按钮 */
.func-tab {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    min-width: 90px;
    background: var(--trae-input);
    border: 1.5px solid var(--trae-border);
    border-radius: 12px;
    color: var(--trae-text);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.func-tab i {
    font-size: 1.4rem;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.func-tab span {
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    transition: color 0.2s;
}

/* 标签角标 */
.func-tab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 0.6rem;
    padding: 1px 5px;
    border-radius: 6px;
    line-height: 1.3;
    font-weight: 600;
    pointer-events: none;
}

/* 悬浮效果 */
.func-tab:hover {
    border-color: var(--trae-primary);
    background: rgba(88, 166, 255, 0.06);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.15);
}

.func-tab:hover i {
    transform: scale(1.15);
}

/* 选中状态 */
.func-tab.active {
    border-color: var(--trae-primary);
    background: rgba(88, 166, 255, 0.12);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15), 0 4px 16px rgba(88, 166, 255, 0.2);
}

.func-tab.active i {
    color: var(--trae-primary);
    transform: scale(1.1);
}

.func-tab.active span {
    color: var(--trae-primary);
    font-weight: 600;
}

/* 左右渐变遮罩：提示可滑动 */
.func-tabs-fade-left,
.func-tabs-fade-right {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 32px;
    pointer-events: none;
    z-index: 2;
    transition: opacity 0.3s;
}

.func-tabs-fade-left {
    left: 0;
    background: linear-gradient(to right, var(--trae-card), transparent);
    opacity: 0;
}

.func-tabs-fade-right {
    right: 0;
    background: linear-gradient(to left, var(--trae-card), transparent);
    opacity: 0;
}

.func-tabs-fade-left.visible,
.func-tabs-fade-right.visible {
    opacity: 1;
}

/* 右侧遮罩呼吸脉冲动画：引导用户滑动 */
.func-tabs-fade-right.visible {
    animation: fadePulse 2s ease-in-out infinite;
}

@keyframes fadePulse {
    0%, 100% { opacity: 0.6; width: 32px; }
    50% { opacity: 1; width: 40px; }
}

/* 用户滑动过后停止脉冲 */
.func-tabs-fade-right.touched {
    animation: none;
    opacity: 1;
}

/* 右侧小箭头提示 */
.func-tabs-hint {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--trae-primary);
    font-size: 0.7rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    animation: hintSlide 2s ease-in-out infinite;
}

.func-tabs-hint.visible {
    opacity: 0.8;
}

.func-tabs-hint.touched {
    animation: none;
    opacity: 0;
}

.func-tabs-hint i {
    font-size: 0.85rem;
    animation: hintBounce 1.5s ease-in-out infinite;
}

@keyframes hintSlide {
    0%, 100% { transform: translateY(-50%) translateX(0); }
    50% { transform: translateY(-50%) translateX(-4px); }
}

@keyframes hintBounce {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(4px); }
}

/* 选中后折叠显示的紧凑栏 */
.func-selected-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(88, 166, 255, 0.08);
    border: 1px solid rgba(88, 166, 255, 0.25);
    border-radius: 10px;
    animation: funcBarSlideUp 0.3s ease;
}

@keyframes funcBarSlideUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.func-selected-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.func-selected-info > i {
    font-size: 1.25rem;
    color: var(--trae-primary);
    flex-shrink: 0;
}

.func-selected-info span {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--trae-text);
}

.func-selected-info small {
    color: var(--trae-text-muted);
    font-size: 0.8rem;
    margin-left: 6px;
}

.func-change-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    padding: 5px 12px;
    background: transparent;
    border: 1px solid var(--trae-primary);
    border-radius: 8px;
    color: var(--trae-primary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.func-change-btn:hover {
    background: var(--trae-primary);
    color: #fff;
}

.func-change-btn i {
    font-size: 0.85rem;
    transition: transform 0.3s;
}

.func-change-btn:hover i {
    transform: rotate(180deg);
}

/* Media Card */
.media-card {
    transition: all 0.3s ease;
}

.media-card.blurred img, 
.media-card.blurred video {
    filter: blur(8px);
    pointer-events: none;
}

.media-card:hover {
    border-color: var(--trae-primary);
}

.badge-expiry {
    position: absolute;
    top: -5px;
    right: -5px;
    padding: 0.25rem 0.5rem;
    border-radius: 50%;
    font-size: 0.7rem;
}

/* ==================== */
/* Hero Section Styles  */
/* ==================== */

.hero-section {
    background: linear-gradient(180deg, var(--trae-bg) 0%, #0a0e14 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 20%, rgba(88, 166, 255, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(168, 85, 247, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.min-vh-50 {
    min-height: 50vh;
}

.hero-badge .badge {
    font-size: 0.85rem;
    font-weight: 500;
}

/* Stats */
.stat-item {
    padding: 0.5rem 0;
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--trae-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--trae-text-muted);
}

/* Hero Visual */
.hero-visual {
    position: relative;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-circle {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(88, 166, 255, 0.1) 0%, rgba(168, 85, 247, 0.1) 100%);
    border: 1px solid rgba(88, 166, 255, 0.2);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

.spin-animation {
    display: inline-block;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.floating-card {
    position: absolute;
    background: var(--trae-card);
    border: 1px solid var(--trae-border);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: float 6s ease-in-out infinite;
}

.floating-card i {
    font-size: 1.5rem;
    color: var(--trae-primary);
}

.floating-card span {
    font-weight: 500;
    color: var(--trae-text);
}

.floating-card.card-1 {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.floating-card.card-2 {
    top: 50%;
    right: 5%;
    animation-delay: 2s;
}

.floating-card.card-3 {
    bottom: 15%;
    left: 20%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Features Section */
.features-section {
    background: var(--trae-bg);
}

.feature-box {
    background: var(--trae-card);
    border: 1px solid var(--trae-border);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    height: 100%;
    transition: all 0.3s;
}

.feature-box:hover {
    border-color: var(--trae-primary);
    transform: translateY(-4px);
}

.feature-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(88, 166, 255, 0.1) 0%, rgba(168, 85, 247, 0.1) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.feature-icon i {
    font-size: 1.75rem;
    color: var(--trae-primary);
}

/* Recommendations Section */
.recommendations-section {
    background: linear-gradient(180deg, var(--trae-bg) 0%, #0a0e14 100%);
}

.recommendation-box {
    background: var(--trae-card);
    border: 1px solid var(--trae-border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    height: 100%;
}

.recommendation-box:hover {
    border-color: var(--trae-primary);
    transform: translateY(-4px);
}

.recommendation-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.recommendation-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(88, 166, 255, 0.1) 0%, rgba(168, 85, 247, 0.1) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.recommendation-icon i {
    font-size: 1.5rem;
    color: var(--trae-primary);
}

.recommendation-image {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    overflow: hidden;
    margin: 0 auto 1rem;
}

.recommendation-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* CTA Section */
.cta-section {
    background: var(--trae-bg);
}

.cta-box {
    background: linear-gradient(135deg, rgba(88, 166, 255, 0.1) 0%, rgba(168, 85, 247, 0.1) 100%);
    border: 1px solid var(--trae-border);
    border-radius: 16px;
}

/* ==================== */
/* Main Content Styles  */
/* ==================== */

.generator-card {
    border-color: rgba(88, 166, 255, 0.2);
}

/* Link Mode Badge */
.link-mode-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    margin-left: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    vertical-align: middle;
}

/* Link Mode Selector */
.link-mode-selector {
    display: flex;
    justify-content: center;
}

.mode-tabs {
    display: flex;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.25rem;
    border-radius: 8px;
    width: fit-content;
}

.mode-tab {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--trae-text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.mode-tab:hover {
    background: rgba(88, 166, 255, 0.1);
    color: var(--trae-text);
}

.mode-tab.active {
    background: var(--trae-primary);
    color: #fff;
}

.mode-tab i {
    font-size: 0.9rem;
}

/* User Info in Header */
.user-info {
    font-size: 0.85rem;
}

.user-id-display {
    font-size: 0.8rem;
    opacity: 0.9;
}

.expire-display {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.expire-danger {
    color: #f85149 !important;
    font-weight: 600;
}

.expire-warning {
    color: #d29922 !important;
    font-weight: 500;
}

/* Function Grid */
.function-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 1rem;
}

.function-item {
    background: var(--trae-input);
    border: 1px solid var(--trae-border);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.function-item:hover {
    border-color: var(--trae-primary);
    background: rgba(88, 166, 255, 0.05);
}

.function-item.active {
    border-color: var(--trae-primary);
    background: rgba(88, 166, 255, 0.1);
}

.function-item i {
    font-size: 1.5rem;
    color: var(--trae-primary);
    display: block;
    margin-bottom: 0.5rem;
}

.function-item span {
    display: block;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--trae-text);
}

.function-item small {
    display: block;
    font-size: 0.75rem;
    color: var(--trae-text-muted);
    margin-top: 0.25rem;
}

.function-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    z-index: 1;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quick-action-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--trae-input);
    border: 1px solid var(--trae-border);
    border-radius: 10px;
    text-decoration: none;
    color: var(--trae-text);
    transition: all 0.2s;
}

.quick-action-item:hover {
    border-color: var(--trae-primary);
    background: rgba(88, 166, 255, 0.05);
    color: var(--trae-text);
}

.quick-action-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.quick-action-icon i {
    font-size: 1.25rem;
}

.quick-action-content {
    flex-grow: 1;
    min-width: 0;
}

.quick-action-content h6 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.quick-action-content small {
    display: block;
    margin-top: 2px;
}

/* Recommendation List (Sidebar) */
.recommendation-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.recommendation-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--trae-input);
    border: 1px solid var(--trae-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.recommendation-item:hover {
    border-color: var(--trae-primary);
    background: rgba(88, 166, 255, 0.05);
}

.recommendation-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(88, 166, 255, 0.1) 0%, rgba(168, 85, 247, 0.1) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.recommendation-item-icon i {
    font-size: 1rem;
    color: var(--trae-primary);
}

.recommendation-item-content {
    flex-grow: 1;
    min-width: 0;
}

.recommendation-item-content span {
    font-weight: 500;
    font-size: 0.9rem;
}

.badge-sm {
    font-size: 0.65rem;
    padding: 0.2rem 0.4rem;
}

/* ==================== */
/* Responsive Styles    */
/* ==================== */

@media (max-width: 991.98px) {
    .hero-visual {
        height: 300px;
        margin-top: 2rem;
    }
    
    .hero-circle {
        width: 200px;
        height: 200px;
    }
    
    .floating-card {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .floating-card.card-1 {
        top: 10%;
        left: 5%;
    }
    
    .floating-card.card-2 {
        top: 40%;
        right: 0;
    }
    
    .floating-card.card-3 {
        bottom: 10%;
        left: 10%;
    }
}

@media (max-width: 767.98px) {
    .hero-visual {
        display: none;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .function-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .btn-lg {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 575.98px) {
    .function-grid {
        grid-template-columns: 1fr;
    }
    
    .d-flex.flex-column.flex-sm-row {
        flex-direction: column !important;
    }
}

/* Footer */
footer {
    background: var(--trae-header);
    border-top: 1px solid var(--trae-border);
}

/* ==================== */
/* 链接统计样式         */
/* ==================== */

.link-stats-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.link-stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--trae-input);
    border: 1px solid var(--trae-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.link-stat-item:hover {
    border-color: var(--trae-primary);
    background: rgba(88, 166, 255, 0.05);
}

.link-stat-info {
    flex-grow: 1;
    min-width: 0;
}

.link-stat-type {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--trae-text);
}

.link-stat-id {
    font-size: 0.8rem;
    color: var(--trae-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.link-stat-count {
    text-align: right;
    flex-shrink: 0;
}

.link-stat-count .visit-count {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--trae-primary);
    display: block;
    line-height: 1;
}

.link-stat-count small {
    font-size: 0.7rem;
}

.result-section {
    animation: fadeIn 0.3s ease;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(35, 134, 54, 0.1) 0%, rgba(88, 166, 255, 0.05) 100%);
    border-radius: 12px;
    border: 1px solid rgba(35, 134, 54, 0.3);
    margin-top: 1.5rem !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-section .section-title {
    color: var(--trae-accent) !important;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.result-section .result-area {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--trae-primary);
    box-shadow: 0 0 20px rgba(88, 166, 255, 0.2);
}

/* 统计卡片 */
.stat-card {
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

/* ==================== */
/* 移动端优化           */
/* ==================== */

@media (max-width: 767.98px) {
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    /* 移动端首屏优化 - 减少不必要的间距 */
    .my-3, .my-md-4 {
        margin-top: 0.75rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    .card-body {
        padding: 16px !important;
    }
    
    /* 生成器卡片移动端优化 */
    .generator-card .card-body {
        padding: 12px !important;
    }
    
    .generator-card .section-title {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .generator-card .mb-3 {
        margin-bottom: 0.75rem !important;
    }
    
    .generator-card .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.35rem;
    }
    
    .generator-card .form-text {
        font-size: 0.75rem;
        margin-top: 0.25rem;
    }
    
    .generator-card .form-control-lg {
        padding: 0.65rem 0.85rem;
        font-size: 1rem;
    }
    
    .function-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    
    .function-item {
        padding: 10px 6px;
    }
    
    .function-item i {
        font-size: 1.1rem;
        margin-bottom: 0.35rem;
    }
    
    .function-item span {
        font-size: 0.75rem;
        line-height: 1.2;
    }
    
    .function-item small {
        font-size: 0.65rem;
    }
    
    .btn-lg {
        padding: 10px 16px;
        font-size: 0.95rem;
    }
    
    .link-mode-badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
        margin-left: 0.35rem;
    }
    
    .mode-tabs {
        gap: 0.35rem;
        padding: 0.2rem;
    }
    
    .mode-tab {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .mode-tab i {
        font-size: 0.8rem;
    }
    
    .user-info {
        font-size: 0.75rem;
    }
    
    .user-id-display {
        font-size: 0.7rem;
    }
    
    .expire-display {
        font-size: 0.65rem;
    }
    
    /* 结果区域移动端优化 - 更紧凑 */
    .result-section {
        margin-top: 1rem !important;
    }
    
    .result-section hr {
        margin: 0.75rem 0 !important;
    }
    
    .result-section .section-title {
        font-size: 0.95rem;
        margin-bottom: 0.5rem;
    }
    
    .result-area {
        font-size: 0.8rem;
        padding: 10px;
        min-height: 2.5rem;
    }
    
    .result-section .d-flex.gap-2 {
        gap: 6px !important;
    }
    
    .result-section .btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    /* 功能选择标签移动端优化 */
    .func-tab {
        padding: 10px 12px;
        min-width: 76px;
    }

    .func-tab i {
        font-size: 1.2rem;
    }

    .func-tab span {
        font-size: 0.7rem;
    }

    .func-selected-bar {
        padding: 8px 12px;
    }

    .func-selected-info span {
        font-size: 0.85rem;
    }

    .func-selected-info small {
        display: none;
    }

    .func-change-btn {
        font-size: 0.75rem;
        padding: 4px 10px;
    }
    
    /* 侧边栏在移动端隐藏或折叠 */
    .col-lg-4.order-2 {
        margin-top: 1rem;
    }
    
    .quick-action-item {
        padding: 10px;
    }
    
    .quick-action-icon {
        width: 36px;
        height: 36px;
    }
    
    .quick-action-content h6 {
        font-size: 0.9rem;
    }
    
    .link-stat-item {
        padding: 8px 10px;
    }
    
    .link-stat-count .visit-count {
        font-size: 1.1rem;
    }
    
    /* 模态框移动端优化 */
    .modal-dialog {
        margin: 10px;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    .table {
        font-size: 0.85rem;
    }
    
    .stat-card {
        padding: 12px !important;
    }
    
    .stat-card .fs-3 {
        font-size: 1.5rem !important;
    }
    
    /* 公告栏移动端优化 */
    .announcement {
        padding: 0.75rem 1rem;
        margin-bottom: 0.75rem;
        font-size: 0.85rem;
    }

    .announcement-close {
        transform: scale(0.85);
    }
}

/* 超小屏幕优化 (< 400px) */
@media (max-width: 400px) {
    .func-tab {
        padding: 8px 10px;
        min-width: 68px;
        gap: 4px;
    }

    .func-tab i {
        font-size: 1.1rem;
    }

    .func-tab span {
        font-size: 0.65rem;
    }
}

@media (max-width: 575.98px) {
    .function-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .d-flex.gap-2 {
        gap: 8px !important;
    }
    
    .btn {
        padding: 10px 16px;
    }
}

/* 表格样式优化 - 强制覆盖Bootstrap默认样式 */
.table {
    color: #f0f6fc !important;
    background-color: #161b22 !important;
    border-color: #30363d !important;
}

.table > :not(caption) > * > * {
    background-color: transparent !important;
    color: #f0f6fc !important;
    border-color: #30363d !important;
}

.table thead th {
    background: #21262d !important;
    border-color: #30363d !important;
    color: #f0f6fc !important;
    font-weight: 600 !important;
}

.table tbody td {
    border-color: #30363d !important;
    color: #f0f6fc !important;
    background-color: transparent !important;
}

.table tbody tr {
    background-color: transparent !important;
    color: #f0f6fc !important;
}

.table-hover tbody tr:hover {
    background: rgba(88, 166, 255, 0.1) !important;
    color: #f0f6fc !important;
}

.table-hover tbody tr:hover > * {
    background-color: transparent !important;
    color: #f0f6fc !important;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(48, 54, 61, 0.3) !important;
    color: #f0f6fc !important;
}

.table-bordered {
    border-color: #30363d !important;
}

.table-bordered > :not(caption) > * {
    border-color: #30363d !important;
}

.table-responsive {
    background-color: #161b22 !important;
}

/* 覆盖Bootstrap table-dark 样式 */
.table-dark {
    color: #f0f6fc !important;
    background-color: #161b22 !important;
    border-color: #30363d !important;
}

.table-dark > :not(caption) > * > * {
    background-color: transparent !important;
    color: #f0f6fc !important;
    border-color: #30363d !important;
}

.table-dark thead th {
    background-color: #21262d !important;
    border-color: #30363d !important;
    color: #f0f6fc !important;
}

.table-dark tbody td {
    background-color: transparent !important;
    color: #f0f6fc !important;
    border-color: #30363d !important;
}

.table-dark.table-hover tbody tr:hover {
    background-color: rgba(88, 166, 255, 0.1) !important;
    color: #f0f6fc !important;
}

.table-dark.table-hover tbody tr:hover > * {
    background-color: transparent !important;
    color: #f0f6fc !important;
}

/* 表格内所有文本元素 */
.table td, .table th, .table-dark td, .table-dark th {
    color: #f0f6fc !important;
}

.table small, .table-dark small, .table .text-muted, .table-dark .text-muted {
    color: #9ca3af !important;
}

.table .badge, .table-dark .badge {
    color: #fff !important;
}

/* 表格内链接 */
.table a, .table-dark a {
    color: #58a6ff !important;
}

.table a:hover, .table-dark a:hover {
    color: #79c0ff !important;
}

/* Alert 样式 */
.alert {
    border-radius: 8px;
}

.alert-danger {
    background: rgba(248, 81, 73, 0.1);
    border-color: var(--trae-danger);
    color: var(--trae-danger);
}

.alert-success {
    background: rgba(35, 134, 54, 0.1);
    border-color: var(--trae-accent);
    color: var(--trae-accent);
}

/* ==================== */
/* 分享模态框样式 (Bottom Sheet) */
/* ==================== */

/* Bottom Sheet 定位：固定在底部，水平居中 */
.share-modal .modal-dialog {
    position: fixed !important;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0 auto !important;
    width: 100%;
    max-width: 640px;
    transform: translateY(100%) !important;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* 模态框显示时滑入 */
.share-modal.show .modal-dialog {
    transform: translateY(0) !important;
}

.share-modal-content {
    background-color: var(--trae-card);
    border: 1px solid var(--trae-border);
    border-radius: 20px 20px 0 0;
    overflow: hidden;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5);
}

/* 顶部拖拽指示条 */
.share-modal-handle {
    display: flex;
    justify-content: center;
    padding: 10px 0 4px;
    background: var(--trae-card);
}

.share-modal-handle span {
    width: 40px;
    height: 4px;
    background: var(--trae-border);
    border-radius: 2px;
}

.share-modal-header {
    border-bottom: 1px solid var(--trae-border);
    padding: 0.5rem 1.25rem;
}

.share-modal-header .modal-title {
    color: var(--trae-text);
    font-weight: 600;
    font-size: 1.05rem;
}

.share-modal-body {
    padding: 1.25rem;
    max-height: 80vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* 顶部区域：二维码 + 文字编辑 */
.share-top-section {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
    align-items: flex-start;
}

/* 二维码展示区 */
.share-qr-area {
    flex-shrink: 0;
}

.share-qr-box {
    width: 200px;
    height: 200px;
    background: #fff;
    border-radius: 12px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* 二维码高清渲染：canvas/img 填满容器 */
.share-qr-box canvas,
.share-qr-box img {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.share-qr-loading {
    display: flex;
    align-items: center;
    color: #6b7280;
    font-size: 0.8rem;
}

.share-qr-error {
    color: var(--trae-danger);
    font-size: 0.8rem;
    text-align: center;
}

/* 文字编辑区 */
.share-text-area {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* 编辑器工具栏 */
.share-editor-toolbar {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.editor-tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: var(--trae-input);
    border: 1px solid var(--trae-border);
    border-radius: 8px;
    color: var(--trae-text);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    font-size: 0.95rem;
}

.editor-tool-btn:hover {
    border-color: var(--trae-primary);
    background: rgba(88, 166, 255, 0.1);
}

.editor-tool-btn i {
    pointer-events: none;
}

/* 隐藏的颜色选择器 */
.color-picker-hidden {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    border: none;
    padding: 0;
}

/* 字号选择器 */
.editor-tool-btn .font-size-select {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    border: none;
    padding: 0;
    background: transparent;
}

/* contenteditable 编辑器 */
.share-text-editor {
    min-height: 90px;
    max-height: 180px;
    overflow-y: auto;
    padding: 10px 12px;
    background: var(--trae-input);
    border: 1px solid var(--trae-border);
    border-radius: 8px;
    color: var(--trae-text);
    font-size: 0.9rem;
    line-height: 1.5;
    outline: none;
    transition: border-color 0.2s;
    -webkit-overflow-scrolling: touch;
}

.share-text-editor:focus {
    border-color: var(--trae-primary);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

/* 预设文案模板 */
.share-templates {
    margin-top: 8px;
}

.template-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.template-chip {
    display: inline-block;
    padding: 5px 10px;
    background: rgba(88, 166, 255, 0.1);
    border: 1px solid rgba(88, 166, 255, 0.3);
    border-radius: 16px;
    color: var(--trae-primary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.template-chip:hover {
    background: rgba(88, 166, 255, 0.2);
    border-color: var(--trae-primary);
}

/* 底部区域：多平台分享 + 保存二维码 */
.share-bottom-section {
    border-top: 1px solid var(--trae-border);
    padding-top: 1rem;
}

.share-platforms {
    display: flex;
    justify-content: space-around;
    gap: 8px;
    margin-bottom: 1rem;
}

.platform-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 6px;
    background: var(--trae-input);
    border: 1px solid var(--trae-border);
    border-radius: 12px;
    color: var(--trae-text);
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    min-width: 0;
}

.platform-btn:hover {
    transform: translateY(-2px);
    border-color: var(--trae-primary);
}

.platform-btn i {
    font-size: 1.5rem;
}

.platform-btn span {
    font-size: 0.7rem;
    font-weight: 500;
}

/* 各平台图标配色 */
.platform-wechat i { color: #07c160; }
.platform-qq i { color: #12b7f5; }
.platform-douyin i { color: #000; background: #fff; border-radius: 4px; padding: 0 2px; }
.platform-xhs i { color: #ff2442; }
.platform-kuaishou i { color: #ff4906; }

/* 保存二维码按钮 */
.share-save-qr-btn {
    background: linear-gradient(135deg, #238636 0%, #2ea043 100%);
    border: none;
    font-weight: 600;
    padding: 0.75rem;
    border-radius: 10px;
}

.share-save-qr-btn:hover {
    background: linear-gradient(135deg, #2ea043 0%, #3fb950 100%);
}

/* ==================== */
/* 分享模态框响应式适配  */
/* ==================== */

/* 平板及以下：二维码与编辑器纵向排列 */
@media (max-width: 575.98px) {
    .share-modal-body {
        padding: 1rem;
        max-height: 85vh;
    }
    
    .share-top-section {
        flex-direction: column;
        align-items: center;
    }
    
    .share-qr-box {
        width: 180px;
        height: 180px;
    }
    
    .share-text-area {
        width: 100%;
    }
    
    .share-text-editor {
        min-height: 80px;
        max-height: 150px;
    }
    
    .platform-btn {
        padding: 8px 4px;
    }
    
    .platform-btn i {
        font-size: 1.3rem;
    }
    
    .platform-btn span {
        font-size: 0.65rem;
    }
}

/* 超小屏幕 (320px+) 适配 */
@media (max-width: 400px) {
    .share-modal-body {
        padding: 0.75rem;
    }
    
    .share-qr-box {
        width: 160px;
        height: 160px;
    }
    
    .share-platforms {
        gap: 4px;
    }
    
    .platform-btn {
        padding: 6px 2px;
    }
    
    .platform-btn i {
        font-size: 1.2rem;
    }
    
    .platform-btn span {
        font-size: 0.6rem;
    }
    
    .editor-tool-btn {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
    }
}

/* 大屏优化：限制模态框最大宽度 */
@media (min-width: 992px) {
    .share-qr-box {
        width: 220px;
        height: 220px;
    }
    
    .share-text-editor {
        min-height: 120px;
    }
}
