/* 通用样式 */
:root {
    --primary-color: #3b82f6;
    --primary-color-rgb: 59, 130, 246; /* RGB values of #3b82f6 */
    --primary-color-light: #dbeafe;
    --primary-color-dark: #2563eb;
    --secondary-color: #6c757d;
    --secondary-color-dark: #5a6268;
    --text-color: #1f2937;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-gray: #6b7280;
    --text-color-dark: #1f2937;
    --text-color-light: #6b7280;
    --border-color: #e5e7eb;
    --bg-gray: #f3f4f6;
    --bg-secondary: #f8fafc;
    --card-bg: #ffffff;
    --card-background-color: #ffffff;
    --success-color: #10b981;
}

/* 夜间模式全局变量 */
html[data-theme="dark"] {
    --primary-color: #3b82f6;
    --primary-color-rgb: 59, 130, 246; /* RGB values of #3b82f6 */
    --primary-color-light: #1e3a8a;
    --primary-color-dark: #2563eb;
    --secondary-color: #6b7280;
    --secondary-color-dark: #4b5563;
    --text-color: #f9fafb;
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --text-gray: #9ca3af;
    --text-color-dark: #f9fafb;
    --text-color-light: #d1d5db;
    --border-color: #374151;
    --bg-gray: #374151;
    --bg-secondary: #1f2937;
    --card-bg: #1f2937;
    --card-background-color: #1f2937;
    --success-color: #10b981;
    --page-bg-color: #111827;
}

/* 夜间模式下的body样式 */
html[data-theme="dark"] body {
    background-color: #111827;
    color: var(--text-color);
}

/* 夜间模式下的header样式 */
html[data-theme="dark"] .header {
    background-color: #1f2937;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* 夜间模式下的卡片样式 */
html[data-theme="dark"] .card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* 夜间模式下的搜索框样式 */
html[data-theme="dark"] .search-box input {
    background-color: var(--bg-gray);
    color: var(--text-color);
    border-color: var(--border-color);
}

html[data-theme="dark"] .search-box input::placeholder {
    color: var(--text-gray);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-color);
    line-height: 1.5;
    margin: 0;
    padding: 0;
    background-color: #f9fafb;
}

/* 顶部导航栏 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 40px; /* 统一调整为40px */
    background-color: #fff;
    display: flex;
    align-items: center;
    padding: 0 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    z-index: 100;
}

.location {
    display: flex;
    align-items: center;
    font-size: 16px;
    font-weight: 500;
}

.location i {
    margin-right: 8px;
    color: var(--primary-color);
}

.search-box {
    flex: 1;
    margin: 0 16px;
    position: relative;
}

.search-box input {
    width: 100%;
    height: 32px;
    padding: 0 32px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    font-size: 14px;
    background-color: var(--bg-gray);
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-gray);
}

.publish-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

/* 主要内容容器 */
.page-container {
    margin-top: 44px;
    margin-bottom: 50px;
    padding: 16px;
}

/* 卡片样式 */
.card {
    background-color: #fff;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
}

.btn-primary:hover {
    background-color: #2563eb;
}

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

.btn-outline:hover:not(:disabled) {
    background-color: var(--primary-color);
    color: #fff;
}

.btn-outline:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: transparent;
    color: var(--text-gray);
    border-color: var(--border-color);
}

.w-full {
    width: 100%;
}

/* 底部导航样式在layout.css中定义 */

/* 历史记录样式 */
.history-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
}

.history-item:last-child {
    border-bottom: none;
}

/* 工具类 */
.text-center {
    text-align: center;
}

.text-gray-500 {
    color: var(--text-gray);
}

.text-sm {
    font-size: 14px;
}

.ml-2 {
    margin-left: 8px;
}

.ml-3 {
    margin-left: 12px;
}

.mb-2 {
    margin-bottom: 8px;
}

.py-4 {
    padding-top: 16px;
    padding-bottom: 16px;
}

.space-y-2 > * + * {
    margin-top: 8px;
}

/* 剩余次数和每日奖励 */
.quota-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quota-count {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary-color);
}

.daily-reward {
    display: flex;
    align-items: center;
    color: var(--primary-color);
    cursor: pointer;
}

.daily-reward i {
    margin-right: 4px;
}

/* 使用说明 */
.text-lg {
    font-size: 18px;
}

.font-bold {
    font-weight: 600;
}

/* 响应式布局 */
@media (max-width: 640px) {
    .page-container {
        padding: 12px;
    }
    
    .card {
        padding: 12px;
    }
}

/* 分析页面特定样式 */
.analysis-container {
    max-width: 800px;
    margin: 0 auto;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 32px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary-color);
    background-color: rgba(59, 130, 246, 0.05);
}

.upload-area i {
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.history-info {
    flex: 1;
}

.history-title {
    font-size: 16px;
    color: #333;
    margin-bottom: 5px;
}

.history-meta {
    font-size: 12px;
    color: #666;
}

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

.history-actions button {
    padding: 5px 10px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.btn-view {
    background: #e9ecef;
    color: #495057;
}

.btn-delete {
    background: #dc3545;
    color: #fff;
}

/* 图片相关样式 */
.w-16 {
    width: 4rem; /* 64px */
}

.h-16 {
    height: 4rem; /* 64px */
}

.object-cover {
    object-fit: cover;
}

.rounded {
    border-radius: 0.375rem; /* 6px */
}

.image-placeholder {
    width: 4rem;
    height: 4rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-gray);
    font-size: 1.5rem;
}

/* 历史记录项中的图片容器 */
.history-item img {
    flex-shrink: 0;
    max-width: 4rem;
    max-height: 4rem;
    border: 1px solid var(--border-color);
}

.history-item .image-placeholder {
    flex-shrink: 0;
}

/* 布局相关样式 */
.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.text-gray-400 {
    color: #9ca3af;
}

.text-gray-600 {
    color: #6b7280;
}

.mt-4 {
    margin-top: 1rem;
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.pb-4 {
    padding-bottom: 1rem;
}