/* 豆包风格CSS - 浅色调极简设计 */

:root {
    --primary: #6366f1;
    --bg: #f9fafb;
    --card-bg: #ffffff;
    --text-dark: #1f2937;
    --text-gray: #6b7280;
    --border: #e5e7eb;
    --hover-bg: #f3f4f6;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --radius: 8px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', sans-serif;
    background: var(--bg);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ==================== 左侧固定栏 ==================== */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: var(--card-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 100;
}

.sidebar-header {
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    font-weight: 600;
    flex-shrink: 0;
}

.user-phone {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
}

/* 用户详细信息容器 */
.user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

/* 订阅状态标签 */
.user-subscription {
    font-size: 11px;
    color: var(--text-gray);
    opacity: 0.8;
}

/* 即将到期警告（7天内） */
.user-subscription.expiring-soon {
    color: #f59e0b;
}

/* 已过期 */
.user-subscription.expired {
    color: #ef4444;
}

/* ==================== v2.1.4新增：限额提示样式 ==================== */

.usage-limit-tip {
    margin-top: 5px;
    font-size: 11px;
    line-height: 1.2;
}

.usage-limit-normal {
    color: #8f8f8f;
}

.usage-limit-warning {
    color: #ff9500;
    font-weight: 500;
}

.usage-limit-danger {
    color: #ff3b30;
    font-weight: 600;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ==================== 店铺名称行 ==================== */

.store-name-row {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 2px 0;
    min-height: 18px;
}

.store-name-text {
    font-size: 16px;
    color: var(--text-gray);
    font-weight: 500;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.2s;
}

.store-dropdown-btn {
    width: 16px;
    height: 16px;
    padding: 2px;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-gray);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: auto;
}

.store-dropdown-btn:hover {
    background: var(--hover-bg);
    color: var(--primary);
}

.store-dropdown-btn.open svg {
    transform: rotate(180deg);
}

.store-dropdown-btn svg {
    transition: transform 0.2s ease;
}

/* ==================== 下拉菜单 ==================== */

.store-dropdown-menu {
    position: absolute;
    top: 80px;
    left: 16px;
    right: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 200;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.store-dropdown-menu.open {
    max-height: 400px;
    opacity: 1;
    padding: 8px 0;
}

.store-menu-list {
    max-height: 200px;
    overflow-y: auto;
}

.store-menu-item {
    width: 100%;
    padding: 10px 16px;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-dark);
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.store-menu-item:hover {
    background: var(--hover-bg);
}

.store-menu-item.active {
    background: #eef2ff;
    color: var(--primary);
    font-weight: 500;
}

.store-menu-item.active::before {
    content: '✓';
    font-size: 14px;
}

.store-menu-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

.store-menu-add {
    width: 100%;
    padding: 10px 16px;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    color: var(--primary);
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.store-menu-add:hover {
    background: #eef2ff;
}

/* 功能区按钮 */
.function-list {
    flex: 1;
    padding: 12px 16px;
    overflow-y: auto;
}

.function-btn {
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    text-align: left;
    cursor: pointer;
    color: var(--text-dark);
    font-size: 14px;
    transition: all 0.2s;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.function-btn:hover {
    background: var(--hover-bg);
}

.function-btn.active {
    background: #eef2ff;
    color: var(--primary);
    font-weight: 500;
}

.function-btn .icon {
    font-size: 16px;
}

/* 新对话按钮 - 默认状态（未选中） */
.new-chat-btn {
    background: transparent;
    color: var(--text-gray);
    border: none;
    margin-bottom: 8px;
    font-weight: 400;
    transition: all 0.2s;
}

.new-chat-btn:hover {
    background: var(--hover-bg);
    color: var(--primary);
}

/* 新对话按钮 - 选中状态 */
.new-chat-btn.active {
    background: #eef2ff;
    color: var(--primary);
    font-weight: 500;
}

.new-chat-btn.active:hover {
    background: #e0e7ff;
}

/* 历史对话列表 */
.history-section {
    padding: 0 16px 16px;
    margin-top: 8px;
}

.history-header {
    font-size: 12px;
    color: var(--text-gray);
    margin-bottom: 8px;
    padding: 4px 8px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0;
    transition: opacity 0.2s;
}

.history-header:hover {
    opacity: 0.7;
}

.toggle-icon {
    font-size: 10px;
    transition: transform 0.2s;
}

.history-list-collapsed {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.history-list-expanded {
    max-height: 400px;
    overflow-y: auto;
    transition: max-height 0.3s ease;
}

.history-item {
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
    transition: background 0.2s;
    margin-bottom: 4px;

    /* 弹性布局 */
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.history-title {
    flex: 1;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
}

.history-time {
    font-size: 11px;
    color: var(--text-tertiary);
    white-space: nowrap;
    flex-shrink: 0;
}

.history-item:hover {
    background: var(--hover-bg);
}

.history-item:hover .history-time {
    color: var(--text-secondary);
}

.history-item.active {
    background: var(--hover-bg);
    color: var(--text-dark);
}

/* 历史对话空状态 */
.history-empty {
    padding: 30px 15px;
    text-align: center;
    color: var(--text-secondary);
}

.history-empty .empty-icon {
    font-size: 40px;
    margin-bottom: 10px;
    opacity: 0.3;
}

.history-empty .empty-text {
    font-size: 14px;
    margin-bottom: 5px;
    color: var(--text-secondary);
}

.history-empty .empty-hint {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* ==================== 右侧主体区 ==================== */

.main-content {
    margin-left: 280px;
    padding: 0;
    min-height: calc(100vh - 80px);
    padding-bottom: 80px;
    background: var(--bg);
}

/* 数据卡片 */
.data-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin: 0 20px 24px;
}

.data-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: box-shadow 0.2s;
}

.data-card:hover {
    box-shadow: var(--shadow);
}

.data-card-title {
    font-size: 13px;
    color: var(--text-gray);
    margin-bottom: 8px;
}

.data-card-value {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-dark);
}

/* 图表区域 */
.chart-section {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-dark);
}

.period-buttons {
    display: flex;
    gap: 8px;
}

.period-btn {
    padding: 6px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text-gray);
    cursor: pointer;
    transition: all 0.2s;
}

.period-btn:hover {
    background: var(--hover-bg);
}

.period-btn.active {
    background: #eef2ff;
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 500;
}

.chart-container {
    height: 300px;
    position: relative;
}

/* 对话区域 */
.chat-section {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    min-height: calc(100vh - 80px);
    position: relative;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px 100px;
}

/* 新对话欢迎语 */
.welcome-message {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 100%;
}

.welcome-message .greeting {
    font-size: 48px;
    font-weight: 400;
    color: #1f2937;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.welcome-message .sub-greeting {
    font-size: 16px;
    color: #9ca3af;
    font-weight: 400;
}

.message {
    max-width: 80%;
    animation: fadeIn 0.3s ease;
}

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

.message.user {
    margin-left: auto;
}

.message.assistant {
    margin-right: auto;
}

.message-content {
    display: inline-block;
    padding: 12px 16px;
    border-radius: var(--radius);
    background: white;
    border: none;
    text-align: left;
    line-height: 1.6;
    font-size: 14px;
}

.message.user .message-content {
    background: #eef2ff;
    color: var(--text-dark);
}

.message.assistant .message-content {
    background: var(--bg);
}

.message-time {
    font-size: 12px;
    color: var(--text-gray);
    margin-top: 4px;
}

/* ==================== 底部通栏输入区 ==================== */

.input-bar {
    position: fixed;
    bottom: 0;
    left: 280px;
    right: 0;
    height: 80px;
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    z-index: 50;
}

.upload-btn {
    padding: 10px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-gray);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.upload-btn:hover:not(:disabled) {
    background: var(--hover-bg);
}

.upload-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.input-wrapper {
    flex: 1;
    display: flex;
    gap: 12px;
    position: relative;
}

.message-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
}

.message-input:focus {
    border-color: var(--primary);
}

.send-btn {
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.send-btn:hover:not(:disabled) {
    opacity: 0.9;
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 字数统计器样式 */
.char-counter {
    position: absolute;
    bottom: 8px;
    right: 80px;
    font-size: 12px;
    color: var(--text-gray);
    pointer-events: none;
}

.char-counter #char-count {
    font-weight: 600;
}

/* ==================== 高级功能按钮 ==================== */

.premium-btn {
    position: relative;
}

.premium-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.premium-btn:disabled::after {
    content: '🔒';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
}

.premium-tag {
    display: inline-block;
    font-size: 10px;
    padding: 2px 6px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    border-radius: 4px;
    margin-left: auto;
}

.premium-btn.unlocked .premium-tag {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

/* ==================== 升级会员按钮 ==================== */

.upgrade-membership-btn {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.upgrade-membership-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.upgrade-membership-btn .icon {
    font-size: 18px;
}

/* ==================== 响应式设计 ==================== */

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .input-bar {
        left: 0;
    }

    .data-cards {
        grid-template-columns: 1fr;
    }
}

/* ==================== 加载动画 ==================== */

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ==================== 通知提示 ==================== */

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 20px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    max-width: 300px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.success {
    border-left: 4px solid #10b981;
}

.notification.error {
    border-left: 4px solid #ef4444;
}

.notification.warning {
    border-left: 4px solid #f59e0b;
}

/* ==================== 订阅引导弹窗 ==================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-content h3 {
    margin-bottom: 15px;
    color: #1f2937;
    font-size: 18px;
}

.modal-content p {
    margin-bottom: 25px;
    color: #6b7280;
    line-height: 1.6;
    font-size: 14px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-primary, .btn-secondary {
    padding: 10px 24px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-primary {
    background: #6366f1;
    color: white;
}

.btn-primary:hover {
    background: #4f46e5;
}

.btn-secondary {
    background: #f3f4f6;
    color: #6b7280;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

/* ==================== 消息操作按钮 ==================== */

/* 消息操作按钮容器 */
.message-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
    padding-left: 12px;
}

/* AI识别提示 */
.save-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    color: #0c4a6e;
    font-size: 13px;
}

.save-hint .hint-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.save-hint strong {
    color: var(--primary);
    font-weight: 600;
}

/* 保存按钮网格布局（2x2） */
.save-buttons-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

/* 保存按钮 */
.save-data-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    background: #ffffff;
    color: #666;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

/* 推荐按钮（AI识别的类型） */
.save-data-btn.recommended {
    background: #eef2ff;
    color: var(--primary);
    border-color: var(--primary);
    border-width: 2px;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

/* 悬停状态 */
.save-data-btn:hover:not(.disabled-after-save):not(:disabled):not(.saved) {
    background: #f3f4f6;
    border-color: var(--primary);
    transform: translateY(-1px);
}

/* 保存中状态 */
.save-data-btn.saving {
    opacity: 0.6;
    cursor: wait;
}

/* 已保存状态 */
.save-data-btn.saved {
    background: #f0fdf4;
    color: #10b981;
    border-color: #10b981;
    cursor: default;
}

/* 保存后禁用状态 */
.save-data-btn.disabled-after-save {
    background: #f9fafb;
    color: #9ca3af;
    border-color: #e5e7eb;
}

/* 错误状态 */
.save-data-btn.error {
    background: #fef2f2;
    color: #ef4444;
    border-color: #ef4444;
}

/* 类型不匹配警告（保留兼容性，已不使用） */
.data-type-mismatch-warning {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #fffbeb;
    border: 1px solid #fbbf24;
    border-radius: 6px;
    font-size: 12px;
    color: #92400e;
    margin-top: 8px;
    width: 100%;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .save-buttons-grid {
        grid-template-columns: 1fr;
    }

    .save-data-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==================== 文件预览容器 ==================== */

.file-preview-container {
    position: fixed;
    bottom: 80px;
    left: 280px;
    right: 0;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    padding: 12px 16px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 40;
}

.file-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.file-preview-title {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.clear-files-btn {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 13px;
    padding: 4px 8px;
    transition: color 0.2s;
}

.clear-files-btn:hover {
    color: #ef4444;
}

/* 文件卡片列表 */
.file-preview-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 12px;
    transition: all 0.2s;
}

.file-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1);
}

.file-card.uploading {
    opacity: 0.6;
}

.file-card.success {
    border-color: #10b981;
    background: #f0fdf4;
}

.file-card.error {
    border-color: #ef4444;
    background: #fef2f2;
}

/* 文件信息 */
.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.file-icon {
    font-size: 20px;
}

.file-details {
    flex: 1;
}

.file-name {
    font-size: 14px;
    color: #111827;
    font-weight: 500;
    margin-bottom: 2px;
}

.file-meta {
    font-size: 12px;
    color: #6b7280;
}

/* 文件状态 */
.file-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-status-text {
    font-size: 12px;
    color: #6b7280;
}

.file-status-text.success {
    color: #10b981;
}

.file-status-text.error {
    color: #ef4444;
}

.remove-file-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #9ca3af;
    padding: 4px;
    transition: color 0.2s;
}

.remove-file-btn:hover {
    color: #ef4444;
}

.remove-file-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 消息附件显示 */
.message-attachments {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0,0,0,0.1);
}

.attachments-label {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}

.attachment-item {
    font-size: 13px;
    color: #374151;
    padding: 4px 0;
}

/* ==================== 店铺设置 ==================== */

.sidebar-footer {
    display: none;  /* 隐藏底部区域，店铺设置已移至顶部 */
    margin-top: auto;
    padding: 12px;
    border-top: 1px solid var(--border);
}

.settings-btn {
    width: 100%;
    justify-content: flex-start;
    color: var(--text-gray);
}

.settings-btn:hover {
    background: var(--hover-bg);
    color: var(--text-dark);
}

.store-settings-modal {
    min-width: 400px;
    max-width: 500px;
}

.store-management-modal {
    min-width: 450px;
    max-width: 550px;
}

.edit-store-modal {
    min-width: 480px;
    max-width: 520px;
}

.create-store-modal {
    min-width: 480px;
    max-width: 520px;
}

.form-input-large {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 16px;
    color: var(--text-dark);
    transition: border-color 0.2s;
    font-family: inherit;
}

.form-input-large:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-input-large::placeholder {
    color: #9ca3af;
}

.store-list-container {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.store-item-card {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
}

.store-item-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

.store-item-card.active {
    border-color: var(--primary);
    background: #f0f4ff;
}

.store-item-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.store-item-check {
    font-size: 18px;
    color: var(--primary);
    width: 20px;
}

.store-item-name {
    font-size: 17px;
    font-weight: 500;
    color: var(--text-dark);
}

.store-item-arrow {
    font-size: 24px;
    color: var(--text-gray);
    font-weight: 300;
    transition: all 0.2s;
}

.store-item-card:hover .store-item-arrow {
    color: var(--primary);
    transform: translateX(2px);
}

/* 删除门店区域样式 */
.delete-store-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.btn-delete-store {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: transparent;
    border: 1px solid #ef4444;
    border-radius: var(--radius);
    color: #ef4444;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-delete-store:hover {
    background: #fef2f2;
    border-color: #dc2626;
    color: #dc2626;
}

.btn-delete-store .icon {
    font-size: 16px;
}

.delete-warning-text {
    margin-top: 12px;
    font-size: 13px;
    color: #ef4444;
    line-height: 1.5;
}

/* 删除确认弹窗样式 */
.delete-confirm-modal {
    max-width: 450px;
}

.delete-confirm-text {
    font-size: 16px;
    color: var(--text-dark);
    margin-bottom: 16px;
}

.delete-confirm-text strong {
    color: var(--primary);
    font-weight: 600;
}

.delete-warning-box {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius);
    padding: 16px;
    margin-top: 16px;
}

.delete-warning-box p {
    font-size: 14px;
    font-weight: 600;
    color: #dc2626;
    margin-bottom: 12px;
}

.delete-warning-box ul {
    margin: 0;
    padding-left: 20px;
}

.delete-warning-box li {
    font-size: 13px;
    color: #991b1b;
    line-height: 1.8;
}

.btn-danger {
    padding: 10px 24px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text-dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-gray);
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-dark);
}

.modal-body {
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-dark);
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
}

.form-readonly {
    padding: 10px 12px;
    background: var(--hover-bg);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-gray);
}

.premium-section {
    margin-top: 16px;
}

.premium-label {
    font-size: 12px;
    color: var(--text-gray);
    margin-bottom: 8px;
    font-weight: 500;
}

.btn-add-store {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-add-store:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-primary, .btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: #5558e3;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--hover-bg);
    color: var(--text-dark);
}

.btn-secondary:hover {
    background: var(--border);
}

/* ==================== 数据明细表格 ==================== */

.data-table-section {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.data-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border);
}

.data-table-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.data-table-actions {
    display: flex;
    gap: 10px;
}

.btn-export {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.btn-export:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-export .icon {
    font-size: 16px;
}

.data-table-container {
    overflow-x: auto;
}

/* 空状态 */
.data-table-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.data-table-empty p {
    font-size: 14px;
    margin: 0;
}

/* 数据表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table thead {
    background: var(--bg-secondary);
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.2s ease;
}

.data-table tbody tr:hover {
    background: var(--bg-hover);
}

.data-table td {
    padding: 12px 16px;
    color: var(--text-dark);
}

.data-table td:first-child {
    color: var(--text-muted);
    font-weight: 500;
}

/* 操作按钮列 */
.action-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-start;
}

.btn-edit,
.btn-delete {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-edit {
    background: var(--success-bg);
    color: var(--success-color);
}

.btn-edit:hover {
    background: var(--success-color);
    color: white;
}

.btn-delete {
    background: #fee;
    color: #c00;
}

.btn-delete:hover {
    background: #c00;
    color: white;
}

/* 编辑记录弹窗 */
.edit-record-modal {
    min-width: 500px;
    max-width: 600px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group .required {
    color: #f56565;
    margin-left: 2px;
}

.form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* 删除确认弹窗 */
.delete-confirm-modal {
    min-width: 450px;
    max-width: 500px;
}

.warning-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0 0 16px 0;
}

.delete-preview {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.record-preview p {
    margin: 8px 0;
    font-size: 14px;
    color: var(--text-dark);
}

.record-preview strong {
    color: var(--text-primary);
    font-weight: 600;
}

.warning-note {
    font-size: 13px;
    color: #f56565;
    margin: 0;
    text-align: center;
}

.btn-danger {
    padding: 10px 20px;
    background: #f56565;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    background: #e53e3e;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .file-preview-container {
        left: 0;
    }

    .store-settings-modal {
        min-width: auto;
        width: 90vw;
    }

    .data-table-section {
        padding: 15px;
        margin-top: 15px;
    }

    .data-table-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .data-table {
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 8px 10px;
    }

    .action-buttons {
        flex-direction: column;
        gap: 4px;
    }

    .btn-edit,
    .btn-delete {
        font-size: 12px;
        padding: 5px 10px;
    }

    .edit-record-modal,
    .delete-confirm-modal {
        min-width: auto;
        width: 90vw;
        max-width: none;
    }
}

/* ==================== 视图控制按钮组 ==================== */

.view-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    margin: 0 20px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.view-mode-buttons {
    display: flex;
    gap: 8px;
}

.view-mode-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg);
    color: var(--text-dark);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.view-mode-btn:hover {
    background: #f3f4f6;
    border-color: var(--primary);
}

.view-mode-btn.active {
    background: #eef2ff;
    color: var(--primary);
    border-color: var(--primary);
}

.view-mode-btn .icon {
    font-size: 16px;
}

.collapse-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.collapse-btn:hover {
    background: #f3f4f6;
    color: var(--text-dark);
}

.collapse-btn .icon {
    font-size: 12px;
    transition: transform 0.2s ease;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .view-controls {
        flex-direction: column;
        gap: 12px;
        padding: 12px;
        margin: 0 10px 12px;
    }

    .view-mode-buttons {
        width: 100%;
    }

    .view-mode-btn {
        flex: 1;
        justify-content: center;
        font-size: 13px;
        padding: 8px 12px;
    }

    .collapse-btn {
        width: 100%;
        justify-content: center;
    }
}
