/* ============================================
   MJJ提醒系统 - 样式表
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;900&display=swap');

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    background-color: #f0f2f5;
    color: #333;
}

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

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.title-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-link {
    display: block;
    width: 64px;
    height: 64px;
    transition: transform 0.6s ease;
}

.logo-link:hover {
    transform: rotate(360deg);
}

.logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

h1 {
    color: #000;
    margin: 0;
    font-size: 35px;
    font-weight: 900;
}

.add-button {
    background-color: #0a76a1;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.add-button:hover {
    background-color: #4640ff;
    transform: translateY(-1px);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(4px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-content {
    position: relative;
    background-color: #fff;
    margin: 50px auto;
    padding: 0;
    width: 90%;
    max-width: 800px;
    border-radius: 30px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    animation: modalSlideIn 0.3s ease;
    overflow: hidden;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fafafa;
}

.modal-header h2 {
    margin: 0;
    color: #1a1a1a;
    font-size: 18px;
    font-weight: 600;
}

.close {
    color: #999;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close:hover {
    color: #666;
    background-color: #f0f0f0;
}

/* Form */
form {
    padding: 24px 32px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.form-group {
    margin-bottom: 0;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #1a1a1a;
    font-size: 14px;
    font-weight: 500;
}

input[type="text"],
input[type="datetime-local"],
input[type="url"],
textarea,
select {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    font-size: 20px;
    transition: all 0.3s;
    background-color: #fafafa;
    color: #1a1a1a;
}

input[type="datetime-local"] {
    cursor: pointer;
}

input::placeholder,
textarea::placeholder {
    color: #bfbfbf;
}

input:hover::placeholder,
textarea:hover::placeholder {
    color: #8c8c8c;
}

input[type="text"]:hover,
input[type="datetime-local"]:hover,
input[type="url"]:hover,
textarea:hover,
select:hover {
    border-color: #40a9ff;
    background-color: #fff;
}

input[type="text"]:focus,
input[type="datetime-local"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #1890ff;
    background-color: #fff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
}

textarea {
    height: 50px;
    resize: none;
    line-height: 1.6;
}

.form-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.submit-btn {
    background-color: #1890ff;
    color: white;
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.submit-btn:hover {
    background-color: #40a9ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(24, 144, 255, 0.35);
}

.cancel-btn {
    background-color: #f0f0f0;
    color: #666;
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.cancel-btn:hover {
    background-color: #e0e0e0;
    color: #333;
    transform: translateY(-1px);
}

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

/* Cards Grid */
.reminders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.card-container {
    position: relative;
}

.dashed-border {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px dashed #e8e8e8;
    border-radius: 40px;
    pointer-events: none;
}

.theme-once .dashed-border { border-color: #1890ff; }
.theme-weekly .dashed-border { border-color: #fa8c16; }
.theme-monthly .dashed-border { border-color: #722ed1; }
.theme-yearly .dashed-border { border-color: #52c41a; }

.reminder-card {
    background-color: #f1f1f1f7;
    border-radius: 40px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    border: 2px solid;
    border-top-width: 10px;
    position: relative;
    z-index: 1;
}

.theme-once .reminder-card { border-color: #188bff; }
.theme-weekly .reminder-card { border-color: #fa8c16d3; }
.theme-monthly .reminder-card { border-color: #722ed1; }
.theme-yearly .reminder-card { border-color: #3da919; }

.reminder-card:hover {
    transform: translate(-10px, -10px);
}

.card-header,
.card-content,
.card-actions {
    position: relative;
    z-index: 1;
}

.card-header {
    padding: 12px;
    border-bottom: 1px solid #242424;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    margin: 0;
    color: #000;
    font-size: 20px;
    font-weight: 900;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.card-content {
    padding: 12px;
}

.content-text {
    color: #000;
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 24px;
}

.time-text,
.cycle-text {
    color: #332929;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
}

.time-text.next-remind { color: #1880ff; font-weight: 500; }
.time-text.next-remind.disabled { color: #807b7b; font-weight: normal; font-style: italic; }
.time-text.next-remind.waiting { color: #8057bde0; font-weight: normal; font-style: italic; }
.time-text.next-remind.waiting .icon { opacity: 0.8; }
.time-text.next-remind.disabled .icon { opacity: 0.5; }

.icon { fill: currentColor; }

.status {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
    flex-shrink: 0;
}

.status.pending { background-color: #e6f7ff; color: #1890ff; }
.status.completed { background-color: #f6ffed; color: #52c41a; }

.card-actions {
    padding: 12px;
    border-top: 1px solid #111;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.link-btn {
    background-color: transparent;
    color: #188fffcb;
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s;
    text-decoration: none;
}

.link-btn:hover { background-color: #e6f7ff; transform: translateY(-1px); }
.link-btn .icon,
.delete-btn .icon { width: 18px; height: 18px; }

.delete-btn {
    background-color: transparent;
    color: #ff4d4f;
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s;
}

.delete-btn:hover { background-color: #fff1f0; }

.card-title {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
    flex: 1;
}

.type-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    transition: all 0.3s ease;
    background-color: currentColor;
    flex-shrink: 0;
}

.type-icon svg { fill: white; }
.type-icon.once { color: #1890ff; }
.type-icon.weekly { color: #52c41a; }
.type-icon.monthly { color: #722ed1; }
.type-icon.yearly { color: #fa8c16; }

/* Time shortcuts */
.time-shortcuts {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.time-shortcut-btn {
    padding: 4px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    background-color: white;
    color: #666;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.time-shortcut-btn:hover { border-color: #1890ff; color: #1890ff; background-color: #f0f9ff; }
.time-shortcut-btn:active { background-color: #e6f7ff; }

/* Toast */
.toast {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.toast.show { visibility: visible; opacity: 1; transform: translateY(0); }

.toast-content {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    color: #1a1a1a;
}

.toast-icon { fill: currentColor; }
.toast.success .toast-icon { color: #52c41a; }
.toast.error .toast-icon { color: #ff4d4f; }
.toast.error .toast-content { border-left: 4px solid #ff4d4f; }
.toast.success .toast-content { border-left: 4px solid #52c41a; }

/* Confirm Modal */
.confirm-modal .modal-content {
    max-width: 400px;
    padding: 0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: modalSlideIn 0.3s ease;
}

.modal-body { padding: 24px; text-align: center; color: #1a1a1a; font-size: 16px; }

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.confirm-btn {
    background-color: #1890ff;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.confirm-btn:hover { background-color: #40a9ff; transform: translateY(-1px); }

.confirm-modal .cancel-btn {
    background-color: #f0f0f0;
    color: #666;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.confirm-modal .cancel-btn:hover { background-color: #d9d9d9; transform: translateY(-1px); }

/* Password */
.password-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.password-container {
    background: rgba(255, 255, 255, 0.8);
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: fadeIn 0.3s ease;
    text-align: center;
    min-width: 320px;
}

.password-container::before {
    content: '🔒';
    font-size: 48px;
    display: block;
    margin-bottom: 20px;
    animation: bounce 1s infinite;
}

.password-container input {
    padding: 12px 16px;
    margin-bottom: 20px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 16px;
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
    outline: none;
}

.password-container input:focus { border-color: #007bff; box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25); }
.password-container input::placeholder { color: #999; }

.password-container button {
    padding: 12px 24px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.password-container button:hover { background: #0056b3; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); }
.password-container button:active { transform: translateY(0); box-shadow: none; }

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

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@supports not (backdrop-filter: blur(10px)) {
    .password-overlay { background: rgba(255, 255, 255, 0.95); }
    .password-container { background: white; }
}

body.locked {
    overflow: hidden;
    height: 100vh;
    position: fixed;
    width: 100%;
}

/* Responsive */
@media (max-width: 768px) {
    .container { padding: 16px; }
    .reminders-grid { grid-template-columns: 1fr; }
    .modal-content { width: 95%; margin: 10px auto 20px; }
    form { grid-template-columns: 1fr; padding: 16px; gap: 16px; }
    .form-actions { margin-top: 16px; padding-top: 12px; }
    .modal-header { padding: 16px; }
    textarea { height: 80px; }
    .time-shortcuts { gap: 6px; margin-bottom: 12px; }
    .time-shortcut-btn { padding: 4px 8px; font-size: 11px; }
}
