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

body {
    font-family: system-ui, -apple-system, sans-serif;
    line-height: 1.5;
    background: #f5f5f5;
    color: #333;
}

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

header {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 1.5rem;
    margin-right: auto;
}

.subscribe-form, .refresh-form {
    display: flex;
    gap: 0.5rem;
}

input[type="url"] {
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 300px;
}

button {
    padding: 0.5rem 1rem;
    background: #0066cc;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

button:hover {
    background: #0052a3;
}

.layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1rem;
}

.sidebar {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    height: fit-content;
}

.sidebar h2 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #666;
}

.feed-list {
    list-style: none;
}

.feed-list li {
    border-bottom: 1px solid #eee;
}

.feed-list li:last-child {
    border-bottom: none;
}

.feed-list a {
    display: block;
    padding: 0.5rem 0;
    text-decoration: none;
    color: inherit;
}

.feed-list a:hover {
    background: #f5f5f5;
}

.feed-title {
    display: block;
    font-weight: 500;
    color: #333;
}

.feed-latest {
    display: block;
    font-size: 0.85rem;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.feed-status {
    cursor: help;
}

.content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feed-section {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.feed-section h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.feed-section h3 a {
    color: inherit;
    text-decoration: none;
}

.feed-section h3 a:hover {
    color: #0066cc;
}

.feed-refresh {
    display: inline;
}

.feed-refresh button {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
    line-height: 1;
}

.feed-refresh button:hover {
    color: #0066cc;
}

.entry-list {
    line-height: 1.6;
}

.entry-list a {
    color: #0066cc;
    text-decoration: none;
}

.entry-list a:visited {
    color: #551a8b;
}

.entry-list a:hover {
    text-decoration: underline;
}

.no-entries {
    color: #888;
    font-style: italic;
}

.refreshing {
    opacity: 0.6;
}

.refreshing .feed-title::after {
    content: " ⟳";
    animation: spin 1s linear infinite;
    display: inline-block;
}

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

.refresh-done .feed-title::after {
    content: " ✓";
    color: #2a2;
}

.refresh-error .feed-title::after {
    content: " ✗";
    color: #c22;
}

#refresh-btn.refreshing {
    opacity: 0.7;
    pointer-events: none;
}

.progress-text {
    font-size: 0.85rem;
    color: #666;
    margin-left: 0.5rem;
}

.user-nav {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.user-nav a {
    color: #666;
    text-decoration: none;
}

.user-nav a:hover {
    color: #0066cc;
}

.logout-btn {
    background: none;
    color: #666;
    padding: 0.25rem 0.5rem;
    font-size: 0.9rem;
}

.logout-btn:hover {
    background: #eee;
    color: #333;
}

.login-container {
    max-width: 320px;
    margin: 4rem auto;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.login-container h1 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-container form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.login-container input {
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

.login-container button {
    padding: 0.75rem;
    font-size: 1rem;
}

.login-container .error {
    color: #c22;
    text-align: center;
    margin-bottom: 1rem;
}

.login-container .back-link {
    text-align: center;
    margin-top: 1rem;
}

.login-container .back-link a {
    color: #666;
    text-decoration: none;
}

.login-container .back-link a:hover {
    color: #0066cc;
}

.account-container {
    max-width: 480px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.account-container h1 {
    margin-bottom: 1.5rem;
}

.account-container .back-link {
    margin-bottom: 1rem;
}

.account-container .back-link a {
    color: #666;
    text-decoration: none;
}

.account-container .back-link a:hover {
    color: #0066cc;
}

.account-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #eee;
}

.account-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.account-section h2 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: #333;
}

.account-section form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.account-section input[type="password"] {
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

.section-desc {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.opml-actions {
    display: flex;
    gap: 0.75rem;
}

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #0066cc;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
}

.btn:hover {
    background: #0052a3;
}

.btn-secondary {
    background: #666;
}

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

.success {
    color: #2a2;
    margin-bottom: 1rem;
}

input[type="file"] {
    margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
    .layout {
        grid-template-columns: 1fr;
    }

    input[type="url"] {
        width: 200px;
    }
}