:root {
    --bg-color: #f0f2f5;
    --text-color: #1d1d1f;
    --card-bg: #fff;
    --card-hover: #f5f5f7;
    --accent-color: #0071e3;
    --secondary-text: #86868b;
    --border-radius: 24px;
    --gap: 20px;
    --shadow: 0 4px 24px rgba(0, 0, 0, .04);
    --transition: all .3s cubic-bezier(.25, .8, .25, 1)
}

html.dark-theme,
:root.dark-theme {
    --bg-color: #161616;
    --text-color: #dcdcdc;
    --card-bg: #1c1c1e;
    --card-hover: #2c2c2e;
    --accent-color: #2997ff;
    --secondary-text: #86868b;
    --shadow: 0 4px 24px rgba(0, 0, 0, .4)
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft JhengHei', 'Microsoft YaHei', 'PingFang TC', 'Noto Sans TC', sans-serif
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    transition: background-color .3s ease
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(3, auto);
    gap: var(--gap);
    max-width: 1000px;
    width: 100%
}

.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden
}

.card:hover {
    transform: scale(1.02);
    background: var(--card-hover);
    box-shadow: 0 8px 32px rgba(0, 0, 0, .08)
}

.card-profile {
    grid-column: span 2;
    grid-row: span 2;
    align-items: center;
    text-align: center
}

.logo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin-bottom: 20px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .1)
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px
}

.subtitle {
    color: var(--secondary-text);
    font-size: 1.1rem
}

.social-icons {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 240px;
    margin-left: auto;
    margin-right: auto
}

.social-icons a {
    color: var(--secondary-text);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    transition: var(--transition)
}

.social-icons a:hover {
    transform: translateY(-3px)
}

.social-icons a[aria-label*="Twitter"]:hover {
    color: #1DA1F2
}

.social-icons a[aria-label*="Facebook"]:hover {
    color: #1877F2
}

.social-icons a[aria-label*="Instagram"]:hover {
    color: #E4405F
}

.social-icons a[aria-label*="發送郵件"]:hover {
    color: #28a745
}

.social-icons svg {
    width: 30px;
    height: 30px
}

.card-status {
    grid-column: span 2;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 99%, #fecfef 100%);
    color: #333
}

.card-status:hover {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 99%, #fecfef 100%)
}

.status-content {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.8;
    text-align: center
}

.status-text {
    font-weight: 600;
    font-size: 1.2rem;
    transition: color .3s ease
}

html.dark-theme .card-status:hover .status-text {
    color: #333;
    cursor: default
}

.card-time {
    grid-column: span 1;
    align-items: center;
    text-align: center;
    min-height: 120px
}

#showbox {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    font-size: 1.1rem;
    margin-top: 10px
}

.card-theme {
    grid-column: span 1;
    cursor: pointer;
    align-items: center;
    padding: 0
}

.card-theme:hover {
    background: var(--card-bg);
    transform: none
}

.btn-toggle {
    background: none;
    border: none;
    width: auto;
    height: auto;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 600;
    padding: 24px;
    position: absolute;
    top: 6px;
    left: 6px;
    right: 6px;
    bottom: 6px;
    border-radius: 18px;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none
}

.theme-icon {
    font-size: 2rem;
    margin-bottom: 10px
}

.card-security {
    grid-column: span 1;
    font-family: monospace;
    background: #2d2d2d;
    color: #0f0;
    justify-content: center;
    padding: 20px;
    align-items: flex-start
}

.card-security:hover {
    background: #2d2d2d
}

.terminal-prompt::before {
    content: "X:\\> ";
    color: #f30
}

.terminal-prompt {
    margin-bottom: 10px
}

.terminal-prompt:last-child {
    margin-bottom: 0
}

.bottom-row {
    grid-column: span 4;
    display: flex;
    gap: var(--gap)
}

.bottom-row .card-theme {
    flex: 3
}

.bottom-row .card-security {
    flex: 5
}

.bottom-row .card-time {
    flex: 2
}

.bottom-row .card-theme,
.bottom-row .card-security,
.bottom-row .card-time {
    grid-column: unset
}

@media (max-width:768px) {
    .bento-grid {
        display: flex;
        flex-direction: column
    }

    .bottom-row {
        flex-direction: column
    }

    .card {
        min-height: 150px
    }

    .card-profile {
        min-height: 300px
    }

    .logo {
        width: 100px;
        height: 100px
    }

    h1 {
        font-size: 1.5rem
    }

    #showbox {
        font-size: 1rem
    }
}

footer {
    text-align: center;
    padding: 20px 0;
    color: var(--text-color);
    margin-top: 10px
}

html.dark-theme footer {
    color: #999
}

.profile-link {
    text-decoration: none;
    color: var(--text-color);
    display: block
}

.profile-link:visited,
.profile-link:hover,
.profile-link:active {
    color: var(--text-color);
    text-decoration: none
}