:root {
    --primary-color: #177fb2;
    --text-color: #333;
    --bg-color: #fff;
    --border-color: #ddd;
    --success-color: #4caf50;
    --error-color: #f44336;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏样式 */
.navbar {
    background-color: var(--primary-color);
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    color: white;
    font-size: 1.5rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

.nav-links a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.nav-links a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

/* 上传区域样式 */
.upload-container {
    margin: 2rem auto;
    padding: 2rem;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s;
}

.upload-container.drag-over {
    border-color: var(--primary-color);
    background-color: rgba(23, 127, 178, 0.1);
}

.upload-icon {
    color: var(--primary-color);
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
}

/* 结果展示区域 */
.results-container {
    margin: 2rem 0;
}

.image-result {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.image-preview {
    max-width: 200px;
    max-height: 200px;
    margin: 1rem 0;
    border-radius: 4px;
}

.link-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 1rem 0;
}

.link-item {
    position: relative;
    display: flex;
    align-items: center;
}

.link-item input {
    flex: 1;
    padding: 0.5rem 2.5rem 0.5rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
    background-color: #f8f9fa;
    font-family: 'Courier New', monospace;
}

.copy-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary-color);
    padding: 0.25rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.copy-btn:hover {
    background-color: rgba(23, 127, 178, 0.1);
}

/* 历史记录样式 */
.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.history-item {
    border: 1px solid #e0e4e7;
    border-radius: 12px;
    overflow: hidden;
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.history-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.history-item img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-bottom: 1px solid #f0f3f5;
}

.history-info {
    padding: 1.25rem;
    font-size: 0.9rem;
    border-bottom: 1px solid #f0f3f5;
    background: #fafbfc;
}

.history-info p {
    margin: 0.5rem 0;
    color: #5f6368;
    display: flex;
    align-items: center;
}

.history-info strong {
    color: #202124;
    min-width: 80px;
    font-weight: 500;
}

.history-item .link-group {
    padding: 1rem;
    background: white;
    gap: 0.75rem;
}

.history-item .link-item {
    position: relative;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 0.75rem;
    border: 1px solid #e8eaed;
    transition: border-color 0.2s ease;
}

.history-item .link-item:hover {
    border-color: var(--primary-color);
}

.history-item .link-item label {
    font-size: 0.75rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    display: block;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.history-item .link-item input {
    width: 100%;
    border: none;
    background: white;
    border-radius: 6px;
    padding: 0.75rem 3rem 0.75rem 0.75rem;
    font-size: 0.85rem;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    color: #5f6368;
    border: 1px solid #dadce0;
    box-sizing: border-box;
}

.history-item .copy-btn {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.5rem;
    transition: all 0.2s ease;
    opacity: 0.8;
    cursor: pointer;
    z-index: 10;
}

.history-item .copy-btn:hover {
    opacity: 1;
    background: #1565c0;
}

/* 移动端样式 - 通过JS添加.mobile类 */
.mobile .navbar .container {
    flex-direction: column;
    gap: 1rem;
}

.mobile .navbar-brand {
    align-self: center;
    justify-self: center;
}

.mobile .nav-links {
    flex-direction: row;
    justify-content: center;
    flex-wrap: nowrap;
    width: 100%;
    gap: 0.3rem;
    overflow-x: auto;
    padding: 0 0.5rem;
}

.mobile .nav-links a {
    padding: 0.5rem 0.6rem;
    font-size: 0.85rem;
    border-radius: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.mobile .nav-links a i {
    display: none;
}

/* 隐藏移动端的菜单切换按钮 */
.menu-toggle {
    display: none;
}

.mobile .history-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
}

/* 防止移动端输入框聚焦时页面放大和滚动跳转 */
.mobile input[type="text"] {
    font-size: 16px !important;
    -webkit-transform: scale(1);
    transform: scale(1);
    -webkit-appearance: none;
    appearance: none;
    pointer-events: none;
    user-select: all;
    -webkit-user-select: all;
}

/* 防止移动端滚动时的突然跳转 */
.mobile {
    -webkit-overflow-scrolling: touch;
    overflow-scrolling: touch;
}

.mobile body {
    position: relative;
    overflow-x: hidden;
}

/* 移动端复制按钮优化 */
.mobile .history-item .copy-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    padding: 6px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.mobile .history-item .copy-btn:active {
    background: #1565c0;
    opacity: 0.8;
}

/* 移动端链接项优化 */
.mobile .history-item .link-item {
    padding: 0.6rem;
}

/* 移动端输入框右侧留出更多空间给复制按钮 */
.mobile .history-item .link-item input {
    padding: 0.6rem 40px 0.6rem 0.6rem !important;
    font-size: 14px !important;
}

.mobile .history-item .link-item label {
    font-size: 0.7rem !important;
    margin-bottom: 0.4rem !important;
}

/* 通知样式 */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 1rem;
    border-radius: 4px;
    color: white;
    animation: slideIn 0.3s ease-out;
    z-index: 1000;
}

.notification.success {
    background-color: var(--success-color);
}

.notification.error {
    background-color: var(--error-color);
}

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

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

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