:root {
    --glass-bg: rgba(255, 255, 255, 0.12);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.75);
    --accent: #64b5f6;
    --accent-hover: #42a5f5;
    --danger: #ef5350;
    --radius: 18px;
}

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

html, body {
    height: 100%;
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-primary);
    overflow-x: hidden;
}

.bg-layer {
    position: fixed;
    inset: 0;
    z-index: -2;
    background-size: cover;
    background-position: center;
    transition: opacity 0.8s ease;
}

.overlay {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.35) 0%,
        rgba(0, 0, 0, 0.15) 50%,
        rgba(0, 0, 0, 0.4) 100%
    );
    backdrop-filter: blur(2px);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 48px 24px 96px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    text-align: center;
    margin-bottom: 36px;
}

.time {
    font-size: 4.5rem;
    font-weight: 300;
    letter-spacing: 2px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.date {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-top: 6px;
    letter-spacing: 1px;
}

.greeting {
    font-size: 1.5rem;
    font-weight: 500;
    margin-top: 12px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.search-bar {
    position: relative;
    max-width: 600px;
    width: 100%;
    margin: 0 auto 40px;
}

.search-bar input {
    width: 100%;
    padding: 16px 56px 16px 22px;
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    box-shadow: var(--glass-shadow);
    transition: all 0.2s ease;
}

.search-bar input::placeholder {
    color: rgba(255, 255, 255, 0.55);
}

.search-bar input:focus {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.4);
}

.search-bar button {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.search-bar button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.bookmarks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 18px;
    width: 100%;
}

.bookmark-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 22px 14px;
    border-radius: var(--radius);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    box-shadow: var(--glass-shadow);
    text-decoration: none;
    color: var(--text-primary);
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    cursor: pointer;
    min-height: 140px;
}

.bookmark-card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.18);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.bookmark-card img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.15);
    padding: 6px;
}

.bookmark-card .title {
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
    word-break: break-word;
    line-height: 1.3;
}

.bookmark-card .actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.bookmark-card:hover .actions {
    opacity: 1;
}

.bookmark-card .actions button {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.35);
    color: var(--text-primary);
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.bookmark-card .actions button:hover {
    background: rgba(0, 0, 0, 0.55);
}

.bookmark-card .actions .delete:hover {
    background: var(--danger);
}

.add-btn {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 58px;
    height: 58px;
    border: none;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, background 0.2s ease;
}

.add-btn:hover {
    transform: scale(1.08);
    background: var(--accent-hover);
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    width: 100%;
    max-width: 420px;
    padding: 28px;
    border-radius: var(--radius);
    background: rgba(30, 30, 35, 0.85);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(24px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.modal-content h2 {
    margin-bottom: 18px;
    font-size: 1.3rem;
}

.modal-content input {
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 14px;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
}

.modal-content input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.modal-content input:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.12);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 8px;
}

.btn-secondary, .btn-primary {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-secondary:hover, .btn-primary:hover {
    opacity: 0.85;
}

.empty-tip {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-secondary);
    padding: 40px;
    font-size: 1rem;
}

@media (max-width: 600px) {
    .time {
        font-size: 3rem;
    }
    .greeting {
        font-size: 1.2rem;
    }
    .bookmarks {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 14px;
    }
    .bookmark-card {
        min-height: 120px;
        padding: 18px 10px;
    }
    .bookmark-card img {
        width: 40px;
        height: 40px;
    }
    .bookmark-card .title {
        font-size: 0.85rem;
    }
    .bookmark-card .actions {
        opacity: 1;
    }
}
