:root {
    --primary: #37352f;
    --secondary: #f1f1ef;
    --accent: #337ea9;
    --light: #ffffff;
    --notion-gray: #f7f6f3;
    --notion-dark-gray: #e3e2e0;
    --notion-text: #37352f;
    --notion-blue: #337ea9;
    --notion-orange: #e9a15a;
    --notion-border: rgba(55, 53, 47, 0.16);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 去除所有元素的点击高亮 */
* {
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

/* 针对按钮特别处理（可选） */
button,
.bubble-btn {
    -webkit-tap-highlight-color: transparent;
    outline: none;
    user-select: none;
    /* 防止文字被选中 */
}

body {
    font-family:
        "Montserrat",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    background-color: var(--notion-gray);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--notion-text);
    padding: 20px;
    line-height: 1.5;
}

.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--light);
    box-shadow: var(--shadow-sm);
    z-index: 100;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    font-size: 0.95rem;
}

.emoji-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: rgba(55, 53, 47, 0.08);
    border: 1px solid var(--notion-border);
    transition: all 0.2s ease;
}

.top-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-btn {
    background: none;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--notion-text);
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: rgba(55, 53, 47, 0.08);
}

.container {
    background: var(--light);
    border-radius: 12px;
    padding: 32px;
    width: 100%;
    max-width: 480px;
    text-align: center;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--notion-border);
    margin-top: 60px;
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

.container:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.header {
    margin-bottom: 32px;
}

/* 动态标题效果 */
.dynamic-title {
    font-size: 3rem;
    margin-bottom: 12px;
    font-weight: 800;
    color: var(--notion-text);
    letter-spacing: -0.5px;
    position: relative;
    display: inline-block;
    background-clip: text;
    -webkit-background-clip: text;
    animation: colorShift 8s infinite alternate;
}

/* 霓虹文字效果 */
.dynamic-title::after {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            var(--notion-blue),
            #e9a15a,
            #d35fb0,
            var(--notion-blue));
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: shine 3s linear infinite;
    opacity: 0.7;
    z-index: -1;
}

/* 颜色变化 */
@keyframes colorShift {
    0% {
        color: var(--notion-text);
    }

    25% {
        color: var(--notion-blue);
    }

    50% {
        color: #e9a15a;
    }

    75% {
        color: #d35fb0;
    }

    100% {
        color: var(--notion-text);
    }
}

/* 光晕效果 */
@keyframes shine {
    to {
        background-position: 200% center;
    }
}

p.subtitle {
    font-size: 1rem;
    color: rgba(55, 53, 47, 0.65);
    margin-bottom: 8px;
    font-weight: 500;
}

.bubble-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
    width: 100%;
    align-items: center;
    transition: all 0.3s ease;
}

/* 简约模式 - 网格布局 */
.bubble-container.minimal-mode {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

/* 简约模式下的按钮样式 */
.bubble-container.minimal-mode .bubble-btn {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.85rem;
    min-height: 50px;
}

.bubble-container.minimal-mode .bubble-btn:hover {
    transform: translateY(-1px);
}

.bubble-btn {
    background: white;
    color: var(--notion-text);
    border: 1px solid var(--notion-border);
    padding: 16px 20px;
    font-size: 0.9rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    width: 100%;
    min-height: 60px;
    position: relative;
    overflow: hidden;
    gap: 8px;
}

.bubble-btn:hover {
    background: rgba(55, 53, 47, 0.03);
    transform: translateY(-2px);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.05),
        0 1px 1px rgba(0, 0, 0, 0.03);
}

.countdown {
    background: rgba(55, 53, 47, 0.03);
    border-radius: 12px;
    padding: 16px;
    margin-top: 20px;
    opacity: 0;
    height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.countdown.active {
    opacity: 1;
    height: auto;
}

.countdown-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: rgba(55, 53, 47, 0.7);
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--notion-text);
    color: white;
    padding: 14px 24px;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    transform: translateX(150%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification.show {
    transform: translateX(0);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--light);
    border-radius: 12px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--notion-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mode-toggle {
    background: rgba(55, 53, 47, 0.08);
    border: 1px solid var(--notion-border);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--notion-text);
    transition: all 0.2s ease;
}

.mode-toggle:hover {
    background: rgba(55, 53, 47, 0.12);
    transform: rotate(90deg);
}

.mode-toggle i {
    font-size: 1rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: rgba(55, 53, 47, 0.6);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

/* 模式指示器 */
.mode-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    padding: 8px 16px;
    background: rgba(51, 126, 169, 0.08);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--notion-blue);
    font-weight: 600;
}

.mode-label {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 按钮编辑区域 */
.buttons-edit-area {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 默认按钮区域 */
.default-buttons-area {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 自定义按钮区域 */
.custom-buttons-area {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 简约模式 - 网格布局 */
.buttons-edit-area.minimal-mode {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.buttons-edit-area.minimal-mode .button-edit-item {
    background: white;
    border: 1px solid var(--notion-border);
    border-radius: 8px;
    padding: 12px;
    transition: all 0.2s ease;
}

.buttons-edit-area.minimal-mode .button-edit-item:hover {
    border-color: var(--notion-blue);
    box-shadow: 0 2px 8px rgba(51, 126, 169, 0.1);
}

.buttons-edit-area.minimal-mode .button-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.buttons-edit-area.minimal-mode .button-header label {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(55, 53, 47, 0.7);
    margin-bottom: 0;
}

.buttons-edit-area.minimal-mode .btn-text,
.buttons-edit-area.minimal-mode .icon-selector {
    width: 100%;
    padding: 8px 10px;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

/* 添加按钮区域 */
.add-button-section {
    padding: 16px 0;
    border-top: 1px solid var(--notion-border);
    margin-top: 8px;
}

.add-btn {
    width: 100%;
    background: rgba(51, 126, 169, 0.08);
    color: var(--notion-blue);
    border: 1px dashed var(--notion-blue);
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.add-btn:hover {
    background: rgba(51, 126, 169, 0.15);
    border-style: solid;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--notion-text);
    text-align: left;
}

.form-group input,
.btn-text {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--notion-border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border 0.2s ease;
}

.form-group input:focus,
.btn-text:focus {
    border-color: var(--notion-blue);
    outline: none;
    box-shadow: 0 0 0 3px rgba(51, 126, 169, 0.1);
}

.icon-selector {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--notion-border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
    transition: border 0.2s ease;
    margin-top: 8px;
}

.icon-selector:focus {
    border-color: var(--notion-blue);
    outline: none;
    box-shadow: 0 0 0 3px rgba(51, 126, 169, 0.1);
}

/* 按钮表单头部 */
.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.form-header label {
    margin-bottom: 0;
}

.remove-btn {
    background: rgba(229, 80, 80, 0.1);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #e55050;
    transition: all 0.2s ease;
}

.remove-btn:hover {
    background: rgba(229, 80, 80, 0.2);
    transform: scale(1.1);
}

/* 自定义按钮表单 */
.custom-button-form {
    background: rgba(55, 53, 47, 0.02);
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--notion-border);
}

.emoji-selection {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-top: 12px;
}

.emoji-option {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(55, 53, 47, 0.05);
    border: 2px solid transparent;
}

.emoji-option.active {
    border-color: var(--notion-blue);
    transform: scale(1.15);
    background: rgba(51, 126, 169, 0.1);
}

.modal-footer {
    padding: 16px 24px;
    background: rgba(55, 53, 47, 0.03);
    display: flex;
    justify-content: flex-end;
}

.save-btn {
    background: var(--notion-blue);
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    color: white;
}

/* ===== 改进的语言选择器样式 ===== */
.language-dropdown {
    position: relative;
    display: inline-block;
}

.language-toggle {
    background: rgba(55, 53, 47, 0.08);
    border: 1px solid var(--notion-border);
    border-radius: 18px;
    padding: 8px 16px;
    color: var(--notion-text);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    min-width: 80px;
    justify-content: center;
}

.language-toggle:hover {
    background: rgba(55, 53, 47, 0.12);
    transform: translateY(-1px);
}

.language-toggle.active {
    background: var(--light);
    box-shadow: var(--shadow-sm);
}

.language-toggle i {
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

.language-toggle.active i {
    transform: rotate(180deg);
}

.language-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--light);
    border: 1px solid var(--notion-border);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 8px;
    margin-top: 8px;
    min-width: 140px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.language-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.language-option:hover {
    background: rgba(55, 53, 47, 0.05);
}

.language-option.active {
    background: rgba(51, 126, 169, 0.1);
    color: var(--notion-blue);
}

.language-option .flag {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.language-option .name {
    flex: 1;
    font-weight: 500;
}

/* 点击外部关闭下拉菜单 */
.language-dropdown-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999;
    display: none;
}

.language-dropdown.active .language-dropdown-backdrop {
    display: block;
}

/* 移动端优化 */
@media (max-width: 480px) {
    .language-toggle {
        padding: 6px 12px;
        font-size: 0.85rem;
        min-width: 70px;
    }

    .language-menu {
        min-width: 120px;
        right: -10px;
    }

    .language-option {
        padding: 8px 10px;
        font-size: 0.85rem;
    }
}

/* 确保顶部控制器的布局适应新设计 */
.top-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
}

/* 响应式调整：在小屏幕上调整间距 */
@media (max-width: 360px) {
    .top-controls {
        gap: 8px;
    }

    .language-toggle {
        min-width: 65px;
        padding: 6px 10px;
    }

    /* 移动端简约模式优化 */
    .bubble-container.minimal-mode {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .bubble-container.minimal-mode .bubble-btn {
        padding: 10px 12px;
        font-size: 0.8rem;
        min-height: 45px;
    }
}

/* ===== 新手引导样式 ===== */
.onboarding-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9998;
    backdrop-filter: blur(2px);
}

.onboarding-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--light);
    border-radius: 16px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    z-index: 9999;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.onboarding-content h2 {
    font-size: 1.5rem;
    margin-bottom: 16px;
    color: var(--notion-text);
    font-weight: 700;
}

.onboarding-body {
    margin-bottom: 24px;
    min-height: 80px;
}

.onboarding-body p {
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(55, 53, 47, 0.8);
}

.onboarding-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.onboarding-dots {
    display: flex;
    gap: 8px;
    flex: 1;
}

.onboarding-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--notion-dark-gray);
    transition: all 0.3s ease;
}

.onboarding-dot.active {
    background: var(--notion-blue);
    width: 24px;
    border-radius: 4px;
}

.onboarding-buttons {
    display: flex;
    gap: 12px;
}

.onboarding-btn-primary,
.onboarding-btn-secondary {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: inherit;
}

.onboarding-btn-primary {
    background: var(--notion-blue);
    color: white;
}

.onboarding-btn-primary:hover {
    background: #2a6a8f;
    transform: translateY(-1px);
}

.onboarding-btn-secondary {
    background: transparent;
    color: var(--notion-text);
    border: 1px solid var(--notion-border);
}

.onboarding-btn-secondary:hover {
    background: rgba(55, 53, 47, 0.05);
}

/* 高亮元素 */
.onboarding-highlight {
    position: relative;
    z-index: 10000;
    box-shadow: 0 0 0 4px var(--notion-blue), 0 0 20px rgba(51, 126, 169, 0.5);
    border-radius: 8px;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 0 4px var(--notion-blue), 0 0 20px rgba(51, 126, 169, 0.5);
    }

    50% {
        box-shadow: 0 0 0 6px var(--notion-blue), 0 0 30px rgba(51, 126, 169, 0.7);
    }
}

/* ===== 密码验证样式 ===== */
.password-modal .modal-content {
    max-width: 420px;
}

.password-error {
    color: #e55050;
    font-size: 0.85rem;
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(229, 80, 80, 0.05);
    border-radius: 6px;
    border-left: 3px solid #e55050;
}

.password-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: rgba(51, 126, 169, 0.05);
    border-radius: 8px;
    margin-top: 16px;
    font-size: 0.85rem;
    color: rgba(55, 53, 47, 0.7);
}

.password-hint i {
    color: var(--notion-blue);
    font-size: 1rem;
}

/* 移动端优化 */
@media (max-width: 480px) {
    .onboarding-modal {
        padding: 24px;
        max-width: 95%;
    }

    .onboarding-content h2 {
        font-size: 1.3rem;
    }

    .onboarding-body p {
        font-size: 0.9rem;
    }

    .onboarding-footer {
        flex-direction: column;
        gap: 12px;
    }

    .onboarding-dots {
        order: 2;
    }

    .onboarding-buttons {
        width: 100%;
        order: 1;
    }

    .onboarding-btn-primary,
    .onboarding-btn-secondary {
        flex: 1;
        padding: 12px;
    }

    /* 简约模式移动端优化 */
    .buttons-edit-area.minimal-mode {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .buttons-edit-area.minimal-mode .button-edit-item {
        padding: 10px;
    }

    .buttons-edit-area.minimal-mode .btn-text,
    .buttons-edit-area.minimal-mode .icon-selector {
        padding: 6px 8px;
        font-size: 0.85rem;
    }

    .modal-body {
        padding: 16px;
        max-height: 70vh;
    }
}