:root {
    --bg: #F3F4F6;
    --surface: #FFFFFF;
    --text: #1F2937;
    --text-light: #6B7280;
    --primary: #FF6B6B;
    --primary-hover: #FF5252;
    --secondary: #E5E7EB;
    --border: #E5E7EB;
    
    --yt: #FF0000;
    --x: #000000;
    --ig: #E1306C;
    
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: 0.2s ease;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #111827;
        --surface: #1F2937;
        --text: #F9FAFB;
        --text-light: #9CA3AF;
        --secondary: #374151;
        --border: #374151;
        --x: #FFFFFF;
    }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

.app-container {
    max-width: 500px;
    margin: 0 auto;
    min-height: 100vh;
    background-color: var(--bg);
    position: relative;
    padding-bottom: 80px; /* For anchor ad */
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
}

.glass-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(var(--surface), 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.glass-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.icon-btn {
    background: var(--secondary);
    border: none;
    padding: 8px 12px;
    border-radius: 20px;
    color: var(--text);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.icon-btn:hover { filter: brightness(0.95); }

.input-section {
    padding: 16px 20px;
    display: flex;
    gap: 8px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.input-section input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    font-size: 0.9rem;
}

.input-section button, .primary-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.primary-btn:hover { background: var(--primary-hover); }

.tabs {
    display: flex;
    padding: 12px 20px 0;
    gap: 16px;
    overflow-x: auto;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.tab {
    background: none;
    border: none;
    padding: 8px 4px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

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

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    border-radius: 3px 3px 0 0;
}

.badge {
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 4px;
}

.list-container {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Card */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sns-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    color: white;
    text-transform: uppercase;
}
.sns-badge.yt { background: var(--yt); }
.sns-badge.x { background: var(--x); }
.sns-badge.ig { background: var(--ig); }
.sns-badge.other { background: var(--text-light); }

.card-date {
    font-size: 0.75rem;
    color: var(--text-light);
}

.card-title {
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.4;
    word-break: break-all;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.category-tag {
    font-size: 0.75rem;
    background: var(--secondary);
    color: var(--text);
    padding: 2px 8px;
    border-radius: 10px;
}

.stars {
    color: #FBBF24;
    font-size: 0.9rem;
    letter-spacing: 2px;
}

/* Modals */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
    opacity: 1;
    transition: opacity 0.3s;
}
.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: var(--surface);
    width: 100%;
    max-width: 400px;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
    transform: translateY(0);
    transition: transform 0.3s;
}
.modal.hidden .modal-content {
    transform: translateY(20px);
}

.form-group {
    margin-top: 16px;
}
.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 6px;
    font-weight: 600;
}
.form-group input[type="text"], .form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
}

.radio-group {
    display: flex;
    gap: 12px;
}

.star-rating {
    display: flex;
    gap: 4px;
}
.star-rating span {
    font-size: 1.8rem;
    color: var(--border);
    cursor: pointer;
    transition: color 0.2s, transform 0.1s;
}
.star-rating span:hover {
    transform: scale(1.1);
}
.star-rating span.active { color: #FBBF24; }

.modal-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 24px;
}
.right-actions {
    display: flex;
    gap: 8px;
}

.secondary-btn {
    background: var(--secondary);
    color: var(--text);
    border: none;
    padding: 10px 16px;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
}
.danger-btn {
    background: #FEE2E2;
    color: #EF4444;
    border: none;
    padding: 10px 16px;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
}
@media (prefers-color-scheme: dark) {
    .danger-btn { background: rgba(239, 68, 68, 0.2); }
}

.qr-box {
    background: white;
    padding: 16px;
    border-radius: 8px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin: 16px 0;
}
.text-center { text-align: center; }
.full-width { width: 100%; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.category-select-wrapper { display: flex; gap: 8px; }
.small-btn {
    background: var(--secondary); border: none; padding: 0 12px;
    border-radius: 8px; color: var(--text); cursor: pointer; white-space: nowrap; font-weight: 600;
}
.anchor {
    position: fixed;
    bottom: 0;
    width: 100%;
    max-width: 500px;
    height: 60px;
    background: rgba(var(--surface), 0.9);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--text-light);
    backdrop-filter: blur(10px);
}
.anchor::after { content: '広告枠 (Ad Slot)'; }
.empty-state { text-align: center; color: var(--text-light); padding: 40px 20px; }

/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
