/* ========================================
   悬浮计时器 - 2027科技感样式
   作者：军哥懂保
   微信号：xunijiayuan
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

:root {
    --bg-primary: #0d0d1a;
    --bg-secondary: #12122a;
    --bg-tertiary: #1a1a35;
    --glass-bg: rgba(20, 20, 40, 0.85);
    --glass-border: rgba(99, 102, 241, 0.25);
    --text-primary: #ffffff;
    --text-secondary: #c4b5fd;
    --text-muted: #8888a0;
    --accent-1: #6366f1;
    --accent-2: #ec4899;
    --accent-3: #818cf8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gradient-main: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.4);
    --shadow-card: 0 20px 60px rgba(0, 0, 0, 0.5);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "微软雅黑", "Segoe UI", "PingFang SC", sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    user-select: none;
}

body {
    /* 动态渐变背景 */
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(236, 72, 153, 0.12) 0%, transparent 50%),
        linear-gradient(180deg, #0d0d1a 0%, #12122a 100%);
}

/* ========================================
   悬浮球
   ======================================== */
.floating-ball {
    position: fixed;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    z-index: 9999;
    cursor: grab;
    touch-action: none;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease;
}

.floating-ball:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.6);
}

.floating-ball.dragging {
    cursor: grabbing;
    transform: scale(1.05);
    transition: none;
}

.ball-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(145deg, #2a2a4a 0%, #151528 100%);
    border: 2px solid var(--accent-1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.floating-ball.running .ball-inner {
    border-color: var(--success);
    box-shadow: 
        0 0 20px rgba(16, 185, 129, 0.5),
        0 4px 20px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.floating-ball.paused .ball-inner {
    border-color: var(--warning);
    box-shadow: 
        0 0 20px rgba(245, 158, 11, 0.5),
        0 4px 20px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.ball-mode {
    font-size: 12px;
    line-height: 1;
    opacity: 0.8;
    margin-bottom: 2px;
}

.ball-time {
    font-size: 13px;
    font-weight: 700;
    font-family: "Consolas", "Courier New", monospace;
}

.ball-progress {
    position: absolute;
    inset: 2px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--success);
    animation: none;
    pointer-events: none;
}

.floating-ball.running .ball-progress {
    animation: pulse-ring 2s ease-in-out infinite;
}

@keyframes pulse-ring {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ========================================
   主面板
   ======================================== */
.main-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9998;
    width: 92%;
    max-width: 520px;
    max-height: 92vh;
    overflow-y: auto;
    animation: slideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.main-panel.hidden {
    display: none;
}

.panel-container {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 16px 20px 14px;
    box-shadow: var(--shadow-card), var(--shadow-glow);
}

/* 标题栏 */
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0 12px;
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
    margin-bottom: 14px;
}

.title-area {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.app-title {
    font-size: 18px;
    font-weight: 700;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.app-subtitle {
    font-size: 11px;
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    gap: 6px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    color: var(--accent-3);
}

.icon-btn#btnClose:hover {
    background: rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

/* 模式切换 */
.mode-switch {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.mode-btn {
    flex: 1;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    background: rgba(30, 30, 50, 0.8);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s;
    white-space: nowrap;
}

.mode-btn:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.6);
    color: var(--text-secondary);
}

.mode-btn.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.4), rgba(236, 72, 153, 0.4));
    border-color: var(--accent-3);
    color: white;
    font-weight: 700;
}

/* 阶段标签 */
.phase-badge {
    text-align: center;
    margin-bottom: 10px;
}

.phase-badge span {
    display: inline-block;
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
}

.phase-badge.work span {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.5);
    color: var(--success);
}

.phase-badge.short_break span {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.5);
    color: #60a5fa;
}

.phase-badge.long_break span {
    background: rgba(236, 72, 153, 0.2);
    border: 1px solid rgba(236, 72, 153, 0.5);
    color: #f472b6;
}

.hidden {
    display: none !important;
}

/* 时间显示 */
.time-display {
    text-align: center;
    padding: 16px 0;
    margin-bottom: 8px;
}

.time-display span {
    font-family: "Consolas", "Courier New", monospace;
    font-size: clamp(48px, 10vw, 72px);
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 0 30px rgba(99, 102, 241, 0.3);
    transition: color 0.3s;
}

.time-display.running span {
    color: var(--success);
    text-shadow: 0 0 30px rgba(16, 185, 129, 0.4);
}

.time-display.paused span {
    color: var(--warning);
    text-shadow: 0 0 30px rgba(245, 158, 11, 0.4);
}

/* 进度条 */
.progress-bar {
    height: 12px;
    background: rgba(30, 30, 50, 0.8);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 14px;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-main);
    border-radius: 6px;
    width: 0%;
    transition: width 0.1s linear;
}

/* 设置区域 */
.settings-area {
    background: rgba(20, 20, 35, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 14px;
}

.tab-nav {
    display: flex;
    background: rgba(30, 30, 50, 0.6);
    border-bottom: 1px solid var(--glass-border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.tab-nav::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    flex-shrink: 0;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab-btn.active {
    color: var(--text-secondary);
    border-bottom-color: var(--accent-1);
    background: rgba(99, 102, 241, 0.1);
}

.tab-content {
    padding: 14px;
    display: none;
}

.tab-content.active {
    display: block;
}

.input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.input-row label {
    font-size: 12px;
    color: var(--text-secondary);
}

.input-row input[type="number"] {
    width: 60px;
    padding: 6px 8px;
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    background: rgba(20, 20, 35, 0.8);
    color: var(--text-primary);
    font-size: 14px;
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
}

.input-row input[type="number"]:focus {
    border-color: var(--accent-3);
}

.shortcut-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.shortcut-btn {
    padding: 6px 12px;
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 16px;
    background: rgba(20, 20, 35, 0.6);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.shortcut-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--accent-3);
}

/* 声音Tab */
.checkbox-row {
    margin-bottom: 14px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid rgba(99, 102, 241, 0.5);
    background: rgba(20, 20, 35, 0.8);
    position: relative;
    transition: all 0.2s;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--gradient-main);
    border-color: var(--accent-3);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.slider-row label {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.slider-row input[type="range"] {
    flex: 1;
    height: 6px;
    background: rgba(99, 102, 241, 0.2);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.slider-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--gradient-main);
    border: 2px solid white;
    cursor: pointer;
}

.slider-row #volumeLabel {
    font-size: 12px;
    color: var(--text-muted);
    min-width: 36px;
    text-align: right;
}

/* 计次列表 */
.lap-list {
    max-height: 160px;
    overflow-y: auto;
    background: rgba(20, 20, 35, 0.6);
    border-radius: 8px;
    padding: 6px;
    margin-bottom: 10px;
}

.lap-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
    font-size: 12px;
}

.lap-item {
    padding: 8px 12px;
    border-radius: 6px;
    margin: 2px 0;
    font-family: "Consolas", monospace;
    font-size: 12px;
    background: rgba(99, 102, 241, 0.08);
    color: var(--text-primary);
}

.lap-list::-webkit-scrollbar {
    width: 6px;
}

.lap-list::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.4);
    border-radius: 3px;
}

/* 记录列表 */
.record-list {
    max-height: 180px;
    overflow-y: auto;
    background: rgba(20, 20, 35, 0.6);
    border-radius: 8px;
    padding: 6px;
    margin-bottom: 10px;
}

.record-list::-webkit-scrollbar {
    width: 6px;
}

.record-list::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.4);
    border-radius: 3px;
}

.record-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    margin: 2px 0;
    font-size: 12px;
    background: rgba(99, 102, 241, 0.08);
    color: var(--text-primary);
}

.record-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.record-name {
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.record-meta {
    font-size: 11px;
    color: var(--text-muted);
}

.record-del {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 1px solid rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.record-del:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: var(--danger);
}

/* 命名弹窗 */
.record-summary {
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-3);
    margin-bottom: 14px;
    padding: 8px;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.25);
}

.modal-btn-row {
    display: flex;
    gap: 10px;
}

.modal-btn-row .primary-btn,
.modal-btn-row .secondary-btn {
    flex: 1;
    padding: 12px 16px;
}

/* 控制按钮 */
.control-row {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.primary-btn {
    flex: 2;
    padding: 14px 24px;
    border-radius: 25px;
    border: none;
    background: var(--gradient-main);
    color: white;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.primary-btn:active {
    transform: translateY(0);
}

.secondary-btn {
    flex: 1;
    padding: 12px 16px;
    border-radius: 20px;
    border: 1px solid rgba(99, 102, 241, 0.4);
    background: rgba(30, 30, 50, 0.8);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.secondary-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.secondary-btn:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--accent-3);
}

.full-width {
    width: 100%;
    flex: none;
}

/* 底部 */
.panel-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    color: var(--text-muted);
    padding-top: 8px;
    border-top: 1px solid rgba(99, 102, 241, 0.15);
}

/* ========================================
   客户端下载区
   ======================================== */
.download-box {
    margin-top: 12px;
    padding: 12px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(236, 72, 153, 0.10) 100%);
    border: 1px solid rgba(99, 102, 241, 0.28);
}

.download-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 9px;
    letter-spacing: 0.4px;
}

.download-row {
    display: flex;
    gap: 9px;
}

.dl-btn {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    border-radius: 10px;
    text-decoration: none;
    color: #fff;
    border: 1px solid transparent;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    min-width: 0;
}

.dl-btn.apk {
    background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.28);
}

.dl-btn.exe {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.30);
}

.dl-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.45);
}

.dl-btn:active {
    transform: translateY(0);
}

.dl-ico {
    font-size: 19px;
    line-height: 1;
    flex-shrink: 0;
}

.dl-txt {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dl-txt b {
    font-size: 12.5px;
    font-weight: 700;
    white-space: nowrap;
}

.dl-txt small {
    font-size: 10px;
    opacity: 0.85;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dl-tip {
    margin-top: 9px;
    font-size: 10px;
    line-height: 1.65;
    color: var(--text-muted);
}

.dl-tip b {
    color: var(--text-secondary);
    font-weight: 600;
}

/* 设置项下方的小字说明 */
.tab-tip {
    margin-top: 8px;
    font-size: 10.5px;
    line-height: 1.6;
    color: var(--text-muted);
}

@media (max-width: 480px) {
    .download-row {
        flex-direction: column;
    }
    .dl-btn {
        padding: 10px 12px;
    }
}

/* ========================================
   右键菜单
   ======================================== */
.context-menu {
    position: fixed;
    z-index: 10000;
    background: rgba(25, 25, 40, 0.97);
    border: 1px solid rgba(99, 102, 241, 0.5);
    border-radius: 10px;
    padding: 6px;
    min-width: 160px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    animation: menuIn 0.15s ease-out;
}

@keyframes menuIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.menu-item {
    padding: 9px 18px;
    border-radius: 6px;
    color: #e0e0f0;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
}

.menu-item:hover {
    background: rgba(99, 102, 241, 0.3);
}

.menu-separator {
    height: 1px;
    background: rgba(99, 102, 241, 0.3);
    margin: 4px 8px;
}

/* ========================================
   登录弹窗
   ======================================== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-container {
    width: 90%;
    max-width: 360px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.modal-title {
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.form-row {
    margin-bottom: 14px;
}

.form-row label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-row input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    background: rgba(20, 20, 35, 0.8);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.form-row input:focus {
    border-color: var(--accent-3);
}

.modal-tip {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 14px;
}

/* ========================================
   移动端适配
   ======================================== */
@media (max-width: 480px) {
    .floating-ball {
        width: 60px;
        height: 60px;
    }

    .ball-mode { font-size: 10px; }
    .ball-time { font-size: 11px; }

    .main-panel {
        width: 96%;
        max-height: 95vh;
    }

    .panel-container {
        padding: 14px 16px 12px;
        border-radius: 16px;
    }

    .app-title { font-size: 16px; }
    .app-subtitle { font-size: 10px; }

    .mode-btn {
        padding: 8px 6px;
        font-size: 11px;
    }

    .tab-btn {
        padding: 8px 10px;
        font-size: 11px;
    }
}

/* ===== 分享按钮 ===== */
.share-btn {
    font-size: 18px !important;
}

/* ===== 分享有奖弹窗 ===== */
.share-container {
    max-width: 480px;
    padding: 24px;
    position: relative;
}

.share-title {
    color: #fbbf24 !important;
    font-size: 22px !important;
    text-align: center;
}

.share-subtitle {
    text-align: center;
    color: #a0a0c0;
    font-size: 13px;
    margin-bottom: 16px;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: transparent;
    border: none;
    color: #8888a0;
    font-size: 18px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 15px;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.share-section {
    margin-bottom: 16px;
}

.share-section-title {
    color: #c4b5fd;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 10px;
}

.vip-title {
    color: #fbbf24 !important;
}

.reward-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.reward-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.reward-dot {
    font-size: 16px;
}

.reward-cond {
    color: #e0e0f0;
    min-width: 70px;
}

.reward-prize {
    font-weight: bold;
}

.reward-note {
    margin-top: 8px;
    font-size: 11.5px;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.08);
    border: 1px dashed rgba(251, 191, 36, 0.35);
    border-radius: 8px;
    padding: 6px 10px;
    line-height: 1.5;
}

.benefit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.benefit-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 10px;
    padding: 10px;
    font-size: 12px;
    color: #e0e0f0;
}

.benefit-icon {
    font-size: 18px;
}

.invite-code-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(251, 191, 36, 0.08);
    border: 1px dashed rgba(251, 191, 36, 0.5);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.invite-label {
    color: #a0a0c0;
    font-size: 13px;
}

.invite-code {
    color: #fbbf24;
    font-size: 18px;
    font-weight: bold;
    font-family: Consolas, monospace;
    letter-spacing: 1px;
}

.copy-btn {
    margin-left: auto;
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.5);
    border-radius: 8px;
    color: #fbbf24;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 12px;
}

.copy-btn:hover {
    background: rgba(251, 191, 36, 0.3);
}

.qr-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.qr-code {
    width: 100px;
    height: 100px;
    background: white;
    border-radius: 8px;
    padding: 6px;
    display: grid;
    grid-template-columns: repeat(14, 1fr);
    gap: 0;
}

.qr-code span {
    display: block;
}

.qr-text h4 {
    color: #c4b5fd;
    font-size: 14px;
    margin-bottom: 6px;
}

.qr-text p {
    color: #8888a0;
    font-size: 12px;
    line-height: 1.5;
}

.share-btn-row {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.share-platform-btn {
    flex: 1;
    border: none;
    border-radius: 10px;
    color: white;
    padding: 10px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
}

.share-platform-btn:hover {
    opacity: 0.85;
}

.share-footer {
    text-align: center;
    color: #4a4a60;
    font-size: 11px;
}

/* 手机端适配 */
@media (max-width: 480px) {
    .share-container {
        margin: 20px 12px;
        padding: 18px;
    }
    .benefit-grid {
        grid-template-columns: 1fr;
    }
    .qr-code {
        width: 80px;
        height: 80px;
    }
}

@media (max-width: 480px) {
    .control-row {
        flex-wrap: wrap;
    }

    .secondary-btn {
        flex: 1;
        min-width: calc(50% - 5px);
    }

    .primary-btn {
        flex: 0 0 100%;
        order: -1;
    }
}

/* 横屏适配 */
@media (orientation: landscape) and (max-height: 500px) {
    .main-panel {
        transform: translate(-50%, -50%) scale(0.85);
    }

    .time-display { padding: 8px 0; }
    .time-display span { font-size: 48px; }
}

/* ============ 版本更新提示条 ============ */
.update-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: linear-gradient(135deg, #6366f1 0%, #a78bfa 50%, #ec4899 100%);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    animation: slideDown 0.4s ease;
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

.update-banner-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    color: #fff;
}

.update-emoji {
    font-size: 24px;
    flex-shrink: 0;
}

.update-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.update-text strong {
    font-size: 14px;
}

.update-log {
    font-size: 12px;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.update-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.update-btn {
    padding: 8px 18px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
}

.update-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.update-btn.primary {
    background: #fff;
    color: #6366f1;
    border-color: #fff;
    font-weight: bold;
}

.update-btn.primary:hover {
    background: #f0f0f0;
}

/* 版本号标签 */
.version-tag {
    display: inline-block;
    padding: 2px 10px;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: 10px;
    font-size: 11px;
    color: #a78bfa;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 6px;
}

.version-tag:hover {
    background: rgba(99, 102, 241, 0.4);
    color: #fff;
}

.version-tag.checking {
    opacity: 0.6;
    cursor: wait;
}

/* ============ 广告位（配置化，三端统一） ============ */
.ad-entry {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(236, 72, 153, 0.12));
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s;
}

.ad-entry:hover {
    border-color: rgba(236, 72, 153, 0.6);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(236, 72, 153, 0.2));
    transform: translateY(-1px);
}

.ad-badge {
    flex-shrink: 0;
    padding: 2px 8px;
    border-radius: 6px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    font-size: 11px;
    font-weight: bold;
}

.ad-entry-title {
    flex: 1;
    font-size: 13px;
    color: #c4b5fd;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ad-entry-btn {
    flex-shrink: 0;
    padding: 4px 12px;
    border-radius: 14px;
    background: linear-gradient(135deg, #6366f1, #ec4899);
    color: #fff;
    font-size: 12px;
    font-weight: bold;
}

/* 广告弹窗 */
.ad-container {
    max-width: 560px;
    padding: 0 !important;
    overflow: hidden;
    background: #0d0d1a;
    border: 1px solid rgba(99, 102, 241, 0.4);
}

.ad-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(236, 72, 153, 0.25));
    border-bottom: 1px solid rgba(99, 102, 241, 0.25);
}

.ad-title {
    flex: 1;
    font-size: 14px;
    font-weight: bold;
    color: #e0e0f0;
}

.ad-video-wrap {
    background: #000;
    line-height: 0;
}

.ad-video-wrap video {
    width: 100%;
    height: auto;
    max-height: 70vh;
    display: block;
    background: #000;
}

.ad-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(20, 20, 35, 0.6);
}

.ad-advertiser {
    font-size: 12px;
    color: #8888a0;
}

.ad-link-btn {
    flex-shrink: 0;
    padding: 6px 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, #6366f1, #ec4899);
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    text-decoration: none;
    transition: opacity 0.2s;
}

.ad-link-btn:hover {
    opacity: 0.85;
}

@media (max-width: 480px) {
    .ad-container {
        margin: 16px 12px;
    }
    .ad-video-wrap video {
        max-height: 55vh;
    }
}
