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

:root {
    --black: #000000;
    --gray: #666666;
    --light-gray: #999999;
    --bg: #ffffff;
    --border: #e0e0e0;
    --accent: #2563eb;
    --sakura-pink: #E91E63;
    --sidebar-width: 480px;
    --terminal-bg: #1a1a1a;
    --terminal-text: #00ff00;
    --terminal-gray: #888888;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: var(--black);
    background: var(--bg);
    font-weight: 400;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* Prevent horizontal overflow on all elements */
* {
    max-width: 100%;
    box-sizing: border-box;
}

/* Word wrapping for long text */
.description-text, .one-line, .name, .role, .contact-item, .skill-item, .social-link {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    word-break: break-word;
}

.container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

/* Mobile menu button */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background: var(--black);
    border: none;
    width: 36px;
    height: 36px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    border-radius: 4px;
}

.mobile-menu-btn span {
    display: block;
    width: 16px;
    height: 2px;
    background: var(--bg);
    transition: all 0.3s ease;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg);
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 1000;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-content {
    padding: 0 20px;
    width: 100%;
}

/* Terminal styling */
.terminal {
    background: var(--terminal-bg);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    border: 1px solid #333;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(0);
}

.terminal:hover {
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.5);
    transform: translateY(-2px);
}

.terminal.minimized {
    transform: translateX(-280px);
    opacity: 0.3;
}

.terminal.minimized:hover {
    transform: translateX(-260px);
    opacity: 0.8;
}

.terminal-header {
    background: #2d2d2d;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #333;
}

.terminal-controls {
    display: flex;
    gap: 8px;
}

.control {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.control:hover {
    transform: scale(1.1);
}

.control.red {
    background: #ff5f57;
}

.control.yellow {
    background: #ffbd2e;
}

.control.green {
    background: #28ca42;
}

.terminal-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: #888;
    margin-left: auto;
}

.terminal-body {
    padding: 20px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.terminal-body * {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.terminal-line {
    margin-bottom: 6px;
}

.prompt {
    color: var(--terminal-text);
    font-weight: 500;
}

.output {
    margin-bottom: 16px;
    margin-left: 0;
}

.name {
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.role {
    color: var(--terminal-gray);
    font-size: 13px;
}

.hidden-text {
    color: #000000;
    transition: color 0.3s ease;
}

.role:hover .hidden-text {
    color: var(--terminal-gray);
}

.contact-item {
    color: #ffffff;
    font-size: 13px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-all;
    max-width: 100%;
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.social-link {
    color: #00aaff;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.social-link:hover {
    color: #ffffff;
}

.social-link i {
    width: 16px;
    font-size: 14px;
}

.skill-item {
    color: #ffffff;
    font-size: 13px;
    margin-bottom: 3px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

.skill-item a {
    color: #00aaff;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.skill-item a:hover {
    color: #ffffff;
    border-bottom: 1px solid #00aaff;
}

/* Main content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 40px;
    max-width: calc(100vw - var(--sidebar-width));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.content-wrapper {
    max-width: 600px;
    width: 100%;
    margin-left: -80px;
}

/* Ensure main content positioning on desktop */
@media (min-width: 901px) {
    .main-content {
        margin-left: var(--sidebar-width);
        max-width: calc(100vw - var(--sidebar-width));
    }
}

/* Sections */
.section {
    margin-bottom: 24px;
}

.main-content h2 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--sakura-pink);
    margin-bottom: 16px;
    border-bottom: 2px solid var(--sakura-pink);
    padding-bottom: 6px;
    display: inline-block;
}

/* One-line items */
.one-line {
    font-size: 14px;
    color: var(--black);
    line-height: 1.3;
    margin-bottom: 6px;
    padding: 2px 0;
}

/* Education styling */
.degree {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
}

.school {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
}

.at-symbol {
    color: var(--light-gray);
    font-weight: 300;
}

.honor {
    font-weight: 600;
    margin-right: 4px;
}

.country {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--light-gray);
    font-weight: 500;
    margin-right: 4px;
}

/* Experience styling */
.position {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
}

.company {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
}

.highlight-number {
    font-weight: 700;
    font-size: 16px;
    color: var(--accent);
}

.description-text {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    color: var(--gray);
    font-size: 14px;
}


.one-line strong {
    font-weight: 600;
}

/* Experience items */
.exp-item {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

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

.exp-item .one-line:first-child {
    margin-bottom: 4px;
}

.exp-item .one-line:last-child {
    color: var(--gray);
    font-size: 13px;
}

/* Research items */
.research-item {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

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

.research-item .one-line:first-child {
    margin-bottom: 4px;
}

.research-item .one-line:nth-child(2) {
    color: var(--gray);
    font-size: 13px;
    margin-bottom: 8px;
}

/* Links in content */
.links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.links a {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--black);
    text-decoration: none;
    border: 1px solid var(--border);
    padding: 4px 8px;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.links a:hover {
    background: var(--black);
    color: var(--bg);
    border-color: var(--black);
}

/* Tablet styles */
@media (max-width: 1024px) {
    .main-content {
        padding: 30px;
    }

    .content-wrapper {
        margin-left: -40px;
    }

    .sidebar {
        width: 400px;
    }

    :root {
        --sidebar-width: 400px;
    }
}

/* Small tablet styles */
@media (max-width: 900px) {
    .mobile-menu-btn {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 350px;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0 !important;
        padding: 80px 25px 40px;
        max-width: 100vw;
        width: 100%;
    }

    .content-wrapper {
        max-width: 100%;
        margin-left: 0 !important;
        width: 100%;
    }

    .terminal {
        margin: 0;
    }
}

/* Mobile styles */
@media (max-width: 768px) {
    .main-content {
        margin-left: 0 !important;
        padding: 70px 16px 60px;
        overflow-x: hidden;
        width: 100%;
    }

    .terminal {
        margin: 0;
        border-radius: 8px;
        width: 100%;
        max-width: 100%;
    }

    .terminal-body {
        padding: 14px 10px;
        font-size: 11px;
        width: 100%;
        overflow-x: hidden;
    }

    .name {
        font-size: 15px;
    }

    .social-link {
        font-size: 10px;
    }

    .skill-item {
        font-size: 10px;
    }

    .main-content h2 {
        font-size: 11px;
        letter-spacing: 1px;
    }

    .one-line {
        font-size: 13px;
        line-height: 1.3;
    }

    .description-text {
        font-size: 12px;
        line-height: 1.4;
    }

    .exp-item .one-line:last-child {
        font-size: 12px;
    }

    .research-item .one-line:nth-child(2) {
        font-size: 12px;
    }

    .links {
        gap: 6px;
        flex-wrap: wrap;
    }

    .links a {
        font-size: 9px;
        padding: 5px 8px;
        white-space: nowrap;
    }

    .highlight-number {
        font-size: 14px;
    }

    .content-wrapper {
        width: 100%;
        max-width: 100%;
        margin-left: 0 !important;
        padding: 0;
    }
}

/* Extra mobile rules for long content */
@media (max-width: 600px) {
    .terminal-body {
        word-break: break-all;
    }

    .contact-item {
        word-break: break-all;
    }

    .skill-item {
        word-break: break-word;
    }

    .social-link {
        word-break: break-word;
    }
}

/* Small mobile styles */
@media (max-width: 480px) {
    .main-content {
        margin-left: 0 !important;
        padding: 65px 12px 80px;
        overflow-x: hidden;
        width: 100%;
    }

    .sidebar {
        width: 100vw;
    }

    .terminal {
        margin: 0;
        border-radius: 6px;
        width: 100%;
        max-width: 100%;
    }

    .terminal-body {
        padding: 10px 8px;
        font-size: 10px;
        width: 100%;
        overflow-x: hidden;
    }

    .terminal-header {
        padding: 8px 10px;
    }

    .name {
        font-size: 14px;
    }

    .role {
        font-size: 11px;
    }

    .contact-item {
        font-size: 11px;
    }

    .social-link {
        font-size: 9px;
    }

    .skill-item {
        font-size: 9px;
    }

    .main-content h2 {
        font-size: 10px;
        letter-spacing: 1px;
    }

    .one-line {
        font-size: 12px;
        margin-bottom: 6px;
        line-height: 1.3;
    }

    .description-text {
        font-size: 11px;
        line-height: 1.4;
    }

    .exp-item .one-line:last-child {
        font-size: 11px;
    }

    .research-item .one-line:nth-child(2) {
        font-size: 11px;
    }

    .links {
        gap: 4px;
        flex-wrap: wrap;
    }

    .links a {
        font-size: 8px;
        padding: 4px 6px;
        white-space: nowrap;
    }

    .mobile-menu-btn {
        top: 12px;
        left: 12px;
        width: 30px;
        height: 30px;
    }

    .mobile-menu-btn span {
        width: 12px;
    }

    .section {
        margin-bottom: 18px;
    }

    .exp-item, .research-item {
        margin-bottom: 12px;
        padding-bottom: 8px;
    }

    .content-wrapper {
        width: 100%;
        max-width: 100%;
        margin-left: 0 !important;
        padding: 0;
    }
}

/* Print styles */
@media print {
    body {
        font-size: 11px;
        line-height: 1.2;
    }

    .container {
        display: block;
    }

    .mobile-menu-btn {
        display: none;
    }

    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        background: var(--bg);
        display: block;
        page-break-inside: avoid;
    }

    .terminal {
        background: var(--bg);
        border: 1px solid var(--border);
        box-shadow: none;
    }

    .terminal-header {
        background: var(--bg);
        border-bottom: 1px solid var(--border);
    }

    .terminal-body {
        color: var(--black);
    }

    .prompt {
        color: var(--black);
    }

    .name {
        color: var(--black);
    }

    .role, .contact-item, .skill-item {
        color: var(--gray);
    }

    .social-link {
        color: var(--accent);
    }

    .sidebar-content {
        padding: 15px 0;
    }

    .main-content {
        margin-left: 0;
        padding: 15px 0;
        max-width: 100%;
    }

    .section {
        margin-bottom: 15px;
        page-break-inside: avoid;
    }

    .exp-item, .research-item {
        margin-bottom: 12px;
        padding-bottom: 8px;
        page-break-inside: avoid;
    }

    .one-line {
        font-size: 10px;
        margin-bottom: 4px;
    }

    .links {
        gap: 6px;
    }

    .links a {
        font-size: 8px;
        padding: 2px 4px;
    }
}

/* Friend Links Sphere Component */
.friend-links-container {
    position: fixed;
    bottom: 0;
    right: 0;
    z-index: 1000;
    pointer-events: none;
}

.corner-fold {
    position: relative;
    width: 60px;
    height: 60px;
    background: #000000;
    clip-path: polygon(100% 0%, 0% 100%, 100% 100%);
    cursor: pointer;
    pointer-events: all;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -2px -2px 10px rgba(0, 0, 0, 0.3);
}

.corner-fold:hover {
    width: 70px;
    height: 70px;
    box-shadow: -4px -4px 15px rgba(0, 0, 0, 0.4);
}

.corner-fold.expanded {
    width: 250px;
    height: 120px;
    background: #000000;
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
    border-radius: 8px;
    border: 2px solid #333333;
    box-shadow: -10px -10px 30px rgba(0, 0, 0, 0.4),
                0 0 15px rgba(255, 255, 255, 0.1);
}

.fold-icon {
    position: absolute;
    bottom: 8px;
    right: 8px;
    font-size: 16px;
    color: white;
    transition: all 0.4s ease;
}

.corner-fold:hover .fold-icon {
    bottom: 12px;
    right: 12px;
    font-size: 18px;
}

.corner-fold.expanded .fold-icon {
    opacity: 0;
}

.friend-link {
    color: #ffffff;
    text-decoration: none;
    transition: all 0.3s ease;
}

.friend-link:hover {
    color: #FFB7C5;
    text-decoration: underline;
}

.friend-info {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 220px;
    text-align: center;
    color: white;
    transition: all 0.2s ease;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.corner-fold.expanded .friend-info {
    opacity: 1;
    pointer-events: all;
    visibility: visible;
    transition: opacity 0.4s ease 0.3s, visibility 0s ease 0.3s; /* 展开时延迟0.3s显示 */
}

.corner-fold.expanded .friend-info:hover {
    transform: translate(-50%, -50%) scale(1.05);
}

.friend-name {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 6px;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
    line-height: 1.2;
    color: #ffffff !important;
    display: block;
}

.friend-quote {
    font-family: 'Inter', sans-serif;
    font-style: italic;
    font-size: 12px;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
    line-height: 1.2;
    color: #ffffff !important;
    display: block;
}

/* Mobile adaptations for Friend Links */
@media (max-width: 768px) {
    .corner-fold {
        width: 50px;
        height: 50px;
    }

    .corner-fold:hover {
        width: 60px;
        height: 60px;
    }

    .corner-fold.expanded {
        width: 220px;
        height: 100px;
    }

    .fold-icon {
        bottom: 6px;
        right: 6px;
        font-size: 14px;
    }

    .corner-fold:hover .fold-icon {
        bottom: 8px;
        right: 8px;
        font-size: 16px;
    }

    .friend-info {
        width: 190px;
    }

    .friend-name {
        font-size: 12px;
        margin-bottom: 4px;
    }

    .friend-quote {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .corner-fold {
        width: 45px;
        height: 45px;
    }

    .corner-fold:hover {
        width: 50px;
        height: 50px;
    }

    .corner-fold.expanded {
        width: 200px;
        height: 90px;
    }

    .fold-icon {
        bottom: 5px;
        right: 5px;
        font-size: 12px;
    }

    .corner-fold:hover .fold-icon {
        bottom: 6px;
        right: 6px;
        font-size: 14px;
    }

    .friend-info {
        width: 170px;
    }

    .friend-name {
        font-size: 11px;
        margin-bottom: 3px;
    }

    .friend-quote {
        font-size: 9px;
    }
}