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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

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

h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.25rem;
}

.subtitle {
    color: #666;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    font-weight: 500;
    font-size: 0.875rem;
    color: #444;
    margin-bottom: 0.375rem;
}

input[type="text"],
input[type="url"],
input[type="number"],
input[type="datetime-local"] {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9375rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    background: #fff;
}

input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.error-message {
    color: #dc2626;
    font-size: 0.8125rem;
    margin-top: 0.25rem;
    min-height: 1.25rem;
}

.hint {
    font-size: 0.8125rem;
    color: #888;
    margin-top: 0.375rem;
}

.feed-info {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
}

.info-header {
    margin-bottom: 0.5rem;
}

.info-title {
    font-weight: 600;
    font-size: 0.9375rem;
    color: #1e293b;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin: 0.5rem auto;
}

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

.feed-info.loading .info-content {
    display: none;
}

.feed-info.loading .info-header {
    display: none;
}

.feed-info.loading .spinner {
    display: block !important;
}

.info-content {
    transition: opacity 0.15s ease;
}

.info-row {
    display: flex;
    font-size: 0.875rem;
    padding: 0.2rem 0;
}

.info-row + .info-row {
    border-top: 1px solid #e2e8f0;
    padding-top: 0.4rem;
    margin-top: 0.2rem;
}

.info-label {
    font-weight: 500;
    color: #64748b;
    min-width: 120px;
}

.info-value {
    color: #334155;
    word-break: break-word;
}

.mode-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.mode-btn {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    transition: all 0.15s ease;
}

.mode-btn:hover {
    background: #f9fafb;
}

.mode-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
}

.mode-content {
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Item picker */
.item-picker {
    margin-bottom: 1rem;
}

.item-picker-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.item-picker-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.8125rem;
    transition: background 0.1s ease;
}

.item-picker-row:last-child {
    border-bottom: none;
}

.item-picker-row:hover {
    background: #f1f5f9;
}

.item-picker-row.selected {
    background: #eff6ff;
    border-left: 3px solid #3b82f6;
    padding-left: 0.5rem;
}

.item-picker-index {
    font-weight: 600;
    color: #64748b;
    min-width: 24px;
    flex-shrink: 0;
}

.item-picker-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #1e293b;
    font-weight: 500;
}

.item-picker-date {
    color: #64748b;
    flex-shrink: 0;
    font-size: 0.75rem;
}

.item-picker-days {
    color: #94a3b8;
    flex-shrink: 0;
    font-size: 0.75rem;
    white-space: nowrap;
}

.helpers {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.helper-btn {
    padding: 0.375rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #f9fafb;
    font-size: 0.8125rem;
    color: #555;
    cursor: pointer;
    transition: all 0.15s ease;
}

.helper-btn:hover {
    background: #e5e7eb;
}

.url-input-group {
    display: flex;
    gap: 0.5rem;
}

.url-input-group input {
    flex: 1;
}

.fetch-btn {
    padding: 0.625rem 1rem;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease;
}

.fetch-btn:hover:not(:disabled) {
    background: #2563eb;
}

.fetch-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.result {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e5e7eb;
}

.result-hint {
    font-size: 0.8125rem;
    color: #f59e0b;
    margin-bottom: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
}

.result .url-input-group input {
    font-size: 0.8125rem;
    background: #f9fafb;
    color: #555;
}

.copy-btn {
    padding: 0.625rem 1rem;
    background: #10b981;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease;
}

.copy-btn:hover {
    background: #059669;
}

.copy-feedback {
    color: #10b981;
    font-size: 0.8125rem;
    margin-top: 0.375rem;
    text-align: center;
    font-weight: 500;
}
