:root {
    --primary: #ff6b9d;
    --primary-light: #ffb3c6;
    --primary-dark: #e84a7f;
    --secondary: #7c5cff;
    --bg: #fff5f7;
    --bg-card: #ffffff;
    --text: #333333;
    --text-light: #666666;
    --border: #f0e6ed;
    --success: #52c41a;
    --error: #ff4d4f;
    --shadow: 0 4px 20px rgba(255, 107, 157, 0.15);
    --radius: 12px;
    --radius-sm: 8px;
}

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

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

a {
    color: var(--primary);
    text-decoration: none;
}

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

/* Auth Pages */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fff5f7 0%, #ffe6ee 100%);
}

.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.auth-box {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow);
}

.auth-title {
    text-align: center;
    color: var(--primary);
    font-size: 28px;
    margin-bottom: 8px;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 30px;
}

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

.auth-form input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    transition: border-color 0.3s;
}

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

.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.4);
}

.auth-links {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.error-msg {
    background: #fff2f0;
    color: var(--error);
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
}

.success-msg {
    background: #f6ffed;
    color: var(--success);
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
}

/* Bind Page */
.bind-box .invite-code-display {
    text-align: center;
    background: #fafafa;
    padding: 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

.bind-box .code {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary);
    letter-spacing: 2px;
    margin: 10px 0;
}

.bind-box .tips {
    font-size: 13px;
    color: var(--text-light);
}

.bind-divider {
    text-align: center;
    color: var(--text-light);
    margin: 20px 0;
    position: relative;
}

.bind-divider::before,
.bind-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--border);
}

.bind-divider::before {
    left: 0;
}

.bind-divider::after {
    right: 0;
}

/* Header */
.header {
    background: var(--bg-card);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 20px;
    font-weight: bold;
    color: var(--primary);
}

.nav {
    display: flex;
    gap: 10px;
}

.nav a {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: var(--text);
    transition: all 0.2s;
}

.nav a:hover,
.nav a.active {
    background: var(--primary-light);
    color: var(--primary-dark);
}

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

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-weight: bold;
}

/* Main Content */
.main {
    padding: 30px 0;
    min-height: calc(100vh - 70px);
}

.page-header {
    margin-bottom: 30px;
}

.page-title {
    font-size: 24px;
    color: var(--text);
    margin-bottom: 8px;
}

.page-subtitle {
    color: var(--text-light);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-card .icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.stat-card .value {
    font-size: 28px;
    font-weight: bold;
    color: var(--primary);
}

.stat-card .label {
    color: var(--text-light);
    font-size: 14px;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

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

.card-title {
    font-size: 18px;
    font-weight: 600;
}

/* Diary */
.diary-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.diary-item {
    background: #fafafa;
    border-radius: var(--radius-sm);
    padding: 20px;
    transition: transform 0.2s;
}

.diary-item:hover {
    transform: translateX(5px);
}

.diary-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.diary-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-weight: bold;
}

.diary-meta {
    flex: 1;
}

.diary-author {
    font-weight: 600;
}

.diary-date {
    font-size: 13px;
    color: var(--text-light);
}

.diary-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.diary-content {
    color: var(--text);
    line-height: 1.8;
    margin-bottom: 12px;
}

.diary-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.diary-tag {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-bottom: 30px;
}

.timeline-dot {
    position: absolute;
    left: -26px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid var(--bg-card);
}

.timeline-date {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 8px;
}

/* Form Styles */
.form-horizontal {
    display: grid;
    gap: 15px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: border-color 0.3s;
}

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

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.btn-secondary {
    padding: 10px 20px;
    background: #f5f5f5;
    color: var(--text);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

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

/* Account */
.account-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.account-item {
    text-align: center;
    padding: 20px;
    background: #fafafa;
    border-radius: var(--radius-sm);
}

.account-item .amount {
    font-size: 24px;
    font-weight: bold;
}

.account-item.shared .amount {
    color: var(--primary);
}

.account-item.income .amount {
    color: var(--success);
}

.account-item.expense .amount {
    color: var(--error);
}

.account-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.account-record {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: #fafafa;
    border-radius: var(--radius-sm);
}

.account-info {
    display: flex;
    flex-direction: column;
}

.account-category {
    font-weight: 500;
}

.account-desc {
    font-size: 13px;
    color: var(--text-light);
}

.account-amount {
    font-size: 16px;
    font-weight: 600;
}

.account-amount.positive {
    color: var(--success);
}

.account-amount.negative {
    color: var(--error);
}

/* Map */
.map-container {
    height: 400px;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 20px;
}

#map {
    width: 100%;
    height: 100%;
}

.location-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #fafafa;
    border-radius: var(--radius-sm);
    margin-bottom: 15px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
}

.status-dot.online {
    background: var(--success);
    animation: pulse 2s infinite;
}

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

.partner-location {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    margin-bottom: 15px;
}

/* Quiz */
.quiz-question {
    background: #fafafa;
    padding: 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

.quiz-question h3 {
    margin-bottom: 15px;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quiz-option {
    padding: 12px 15px;
    background: white;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.quiz-option:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.quiz-option.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

.quiz-option.correct {
    border-color: var(--success);
    background: #f6ffed;
}

.quiz-option.wrong {
    border-color: var(--error);
    background: #fff2f0;
}

/* Wish */
.wish-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.wish-card {
    background: #fafafa;
    border-radius: var(--radius-sm);
    padding: 20px;
    position: relative;
}

.wish-card .status-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
}

.wish-card .status-badge.pending {
    background: #fff7e6;
    color: #fa8c16;
}

.wish-card .status-badge.preparing {
    background: #e6f7ff;
    color: #1890ff;
}

.wish-card .status-badge.completed {
    background: #f6ffed;
    color: var(--success);
}

.wish-title {
    font-weight: 600;
    margin-bottom: 8px;
}

.wish-price {
    color: var(--primary);
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 8px;
}

/* Todo */
.todo-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.todo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: #fafafa;
    border-radius: var(--radius-sm);
}

.todo-item.completed {
    opacity: 0.6;
}

.todo-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.todo-checkbox.checked {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.todo-content {
    flex: 1;
}

.todo-title {
    font-weight: 500;
}

.todo-due {
    font-size: 13px;
    color: var(--text-light);
}

/* Messages */
.message-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message-item {
    display: flex;
    gap: 12px;
    padding: 15px;
    background: #fafafa;
    border-radius: var(--radius-sm);
}

.message-item.unread {
    background: var(--primary-light);
}

.message-content {
    flex: 1;
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.message-from {
    font-weight: 600;
}

.message-time {
    font-size: 12px;
    color: var(--text-light);
}

.message-preview {
    color: var(--text-light);
    font-size: 14px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.empty-state p {
    margin-bottom: 20px;
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
    }
    
    .nav {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .account-summary {
        grid-template-columns: 1fr;
    }
    
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .auth-box {
        padding: 30px 20px;
    }
}

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

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

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

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius);
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-close {
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 5px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
}

.tab {
    padding: 12px 20px;
    cursor: pointer;
    color: var(--text-light);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab:hover {
    color: var(--primary);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Utility */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--error); }
.text-light { color: var(--text-light); }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.p-20 { padding: 20px; }
.hidden { display: none; }
