/* common.css - 共享样式 */

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

/* Body */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    padding: 20px;
}

/* Container */
.container {
    max-width: 800px;
    margin: 0 auto;
}

.container.wide {
    max-width: 1200px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    color: #333;
    font-size: 28px;
    margin-bottom: 10px;
}

.header p, .stats {
    color: #666;
    font-size: 14px;
}

/* Navigation */
.nav {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    padding: 0 10px;
}

.nav a {
    color: #07c160;
    text-decoration: none;
    font-size: 16px;
}

.nav a:hover {
    text-decoration: underline;
}

/* Card */
.card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    background: #07c160;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn:hover {
    background: #06ae56;
}

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-secondary {
    background: #666;
}

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

.btn-warning {
    background: #ff9800;
}

.btn-warning:hover {
    background: #f57c00;
}

.btn-danger {
    background: #e53935;
}

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

.btn-small {
    padding: 4px 12px;
    font-size: 12px;
}

/* Tags */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    background: #e7f7ee;
    color: #07c160;
    border-radius: 4px;
    font-size: 12px;
}

.tag .remove {
    cursor: pointer;
    opacity: 0.6;
}

.tag .remove:hover {
    opacity: 1;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 13px;
}

.status-badge.reposted, .reposted-badge {
    background: #e3f2fd;
    color: #1976d2;
}

.status-badge.not-reposted {
    background: #fff3e0;
    color: #f57c00;
}

/* Toast 通知 */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background: #333;
    color: white;
    padding: 14px 24px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
    max-width: 350px;
}

.toast.success { background: #07c160; }
.toast.error { background: #e53935; }
.toast.info { background: #1976d2; }

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

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

.toast.hiding {
    animation: slideOut 0.3s ease forwards;
}

/* 确认对话框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

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

.modal-box {
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-message {
    font-size: 16px;
    color: #333;
    margin-bottom: 20px;
    line-height: 1.5;
}

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

.modal-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.modal-btn-cancel {
    background: #f0f0f0;
    color: #666;
}

.modal-btn-cancel:hover {
    background: #e0e0e0;
}

.modal-btn-confirm {
    background: #07c160;
    color: white;
}

.modal-btn-confirm:hover {
    background: #06ae56;
}

/* Loading */
.loading {
    display: none;
    text-align: center;
    padding: 20px;
    color: #666;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #07c160;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

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

/* 登录提示区块 */
.login-prompt {
    text-align: center;
    padding: 40px 20px;
}

.login-prompt .icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.login-prompt h2 {
    color: #333;
    margin-bottom: 10px;
}

.login-prompt p {
    color: #666;
    margin-bottom: 20px;
}
